One systemctl command to both start and enable

5,276

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.

Share:
5,276
Rui F Ribeiro
Author by

Rui F Ribeiro

Updated on September 18, 2022

Comments

  • Rui F Ribeiro
    Rui F Ribeiro over 1 year

    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?