Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to have a custom service that I've placed into /lib/systemd/system start at boot, but th eonly way I know how at the moment is to run

systemctl enable myservice.service

but I would like to be able to do this without booting into the actual file system so that I can automate the deployment of this configuration.

share|improve this question
I assume that you have your Debian filesystem mounted somewhere? Can you simply run chroot /mountpoint systemctl enable myservice.service? – Zoredache May 29 '13 at 1:21
Or rather systemd-nspawn -b -D /mountpoint instead of chroot – but in this case symlinking will be sufficient. – Debilski Aug 25 '14 at 16:02
up vote 4 down vote accepted

What systemctl enable does is creates a symlink for the service you specify from the /lib/systemd/system folder to /etc/systemd/, so you can simply do:

ln -s '/lib/systemd/system/myservice.service' '/etc/systemd/'

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.