22

Using one command to both start and enable systemctl managed software would be useful to spare a few lines in a few scripts, making them a bit more aesthetic (not really a problem but a nice thing to have).

Is there one systemctl command to both start and enable a program controlled by systemctl?

31

Yes, there is, since systemd 220 (May 2015):

systemctl enable --now

This will enable and start the named units. See the systemctl manpage for details.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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