Bug 42940

Summary: RFE: enable-and-start in one command
Product: systemd Reporter: Jan ONDREJ (SAL) <ondrejj>
Component: generalAssignee: Lennart Poettering <lennart>
Status: RESOLVED FIXED QA Contact:
Severity: enhancement    
Priority: medium CC: garyvdm, radek, rektide
Version: unspecified   
Hardware: Other   
OS: All   
See Also: https://bugs.freedesktop.org/show_bug.cgi?id=56108
Whiteboard:
i915 platform: i915 features:

Description Jan ONDREJ (SAL) 2011-11-14 23:16:47 UTC
Can you please add an ability to enable and start service in one command? In most cases I run:

systemctl enable name.service
systemctl start name.service

Sometimes I forgot to enable service and it's only started and does not run on next boot. Can you please add an:

systemctl enable-and-start name.service

subcommand or something similar to do this in one command?

Thank you.
Comment 1 Zbigniew Jedrzejewski-Szmek 2013-08-25 02:48:01 UTC
I think we should add something like this. Maybe '--start' option to 'enable' verb?

If we add this, we shouldn't forget about symmetric combination for disabling:
'systemctl --stop disable'?
Comment 2 Lennart Poettering 2013-09-09 18:54:58 UTC
(In reply to comment #1)
> I think we should add something like this. Maybe '--start' option to
> 'enable' verb?
> 
> If we add this, we shouldn't forget about symmetric combination for
> disabling:
> 'systemctl --stop disable'?

Sounds sensible.

Though we need to be carefully not to tape over too much over the differences between units and unit files. i.e. we need to handle nicely that template unit files can be enabled but not started...

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.