salt icon indicating copy to clipboard operation
salt copied to clipboard

Support upstart priority when enabling Ubuntu services

Open dlindquist opened this issue 12 years ago • 2 comments

Currently, enabling a service though salt runs:

update-rc.d myservice defaults

Would like the ability to specify the service start/stop priority (which determines the order that services are started in). This can be done by specify an additional arguments to update-rc.d (see man update-rc.d for more info):

update-rc.d myservice defaults 19     # start and stop priority = 19
update-rc.d myservice defaults 19 21  # start priority = 19, stop priority = 21

One wrinkle for this is that changing the service priority requires seems to requires re-adding. For example:

# update-rc.d -f myservice defaults 20
update-rc.d: warning: /etc/init.d/myservice missing LSB information
update-rc.d: see <http://wiki.debian.org/LSBInitScripts>
 Adding system startup for /etc/init.d/myservice ...
   /etc/rc0.d/K20myservice -> ../init.d/myservice
   /etc/rc1.d/K20myservice -> ../init.d/myservice
   /etc/rc6.d/K20myservice -> ../init.d/myservice
   /etc/rc2.d/S20myservice -> ../init.d/myservice
   /etc/rc3.d/S20myservice -> ../init.d/myservice
   /etc/rc4.d/S20myservice -> ../init.d/myservice
   /etc/rc5.d/S20myservice -> ../init.d/myservice
# update-rc.d -f myservice defaults 19
update-rc.d: warning: /etc/init.d/myservice missing LSB information
update-rc.d: see <http://wiki.debian.org/LSBInitScripts>
 System start/stop links for /etc/init.d/myservice already exist.
# update-rc.d -f myservice remove
 Removing any system startup links for /etc/init.d/myservice ...
   /etc/rc0.d/K20myservice
   /etc/rc1.d/K20myservice
   /etc/rc2.d/S20myservice
   /etc/rc3.d/S20myservice
   /etc/rc4.d/S20myservice
   /etc/rc5.d/S20myservice
   /etc/rc6.d/K20myservice
# update-rc.d -f myservice defaults 19
update-rc.d: warning: /etc/init.d/myservice missing LSB information
update-rc.d: see <http://wiki.debian.org/LSBInitScripts>
 Adding system startup for /etc/init.d/myservice ...
   /etc/rc0.d/K19myservice -> ../init.d/myservice
   /etc/rc1.d/K19myservice -> ../init.d/myservice
   /etc/rc6.d/K19myservice -> ../init.d/myservice
   /etc/rc2.d/S19myservice -> ../init.d/myservice
   /etc/rc3.d/S19myservice -> ../init.d/myservice
   /etc/rc4.d/S19myservice -> ../init.d/myservice
   /etc/rc5.d/S19myservice -> ../init.d/myservice

dlindquist avatar Apr 16 '14 21:04 dlindquist

Thanks! We should definitely add support for this, and thanks for documenting that "wrinkle". =)

basepi avatar Apr 17 '14 22:04 basepi

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

If this issue is closed prematurely, please leave a comment and we will gladly reopen the issue.

stale[bot] avatar Jul 09 '17 00:07 stale[bot]