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 agree to our terms of service, privacy policy and cookie policy

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