sudo systemctl edit name.service to edit a service, now I no longer need these modifications and I wish to restore it to its default setting.
How can I restore it?
I'm running Ubuntu 16.04.
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It only takes a minute to sign up.Sign up to join this community
If you're running a version of
systemd higher than of "229", then you can simply use:
systemctl revert name.service
This allows dropping all user configuration and reverting back to the vendor default of a unit file.
- It basically undoes what:
- "systemctl edit"
- "systemctl set-property" and
- "systemctl mask" do.
Ubuntu 16.04 uses "systemd version 229", so you should remove override file manually:
sudo rm -r /etc/systemd/system/name.service.d
Then reload systemd daemon and restart your service:
sudo systemctl daemon-reload sudo systemctl restart name.service
Remember that if you used
edit subcommand to copy the original unit instead of creating a drop-in file, then you should remove
/etc/systemd/system/name.service instead of the directory.