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.
Author by
Rui F Ribeiro
Updated on September 18, 2022Comments
-
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 bothstart
andenable
a program controlled bysystemctl
?-
Jeff Schaller over 5 yearsRelating-only: unix.stackexchange.com/q/374280/117549
-
don_crissti over 5 yearsYeah, it has been discussed in several places like the post Jeff linked to or here... even in comments etc...
-