Service management in ubuntu like chkconfig

From Finninday
Jump to: navigation, search

I'm puzzled that there isn't a direct correlary for chkconfig in the debian world.

Taking apart the init script for mythtv, I see that their current state of the art is this:

 initctl show-config -e "$JOB"

Which produces output on a sample daemon like this:

root@potato:/etc/init.d# initctl show-config -e idmapd
idmapd
  start on local-filesystems (job:, env:)
  start on mounting (job:, env: TYPE=nfs4)
  stop on runlevel (job:, env: [06])

get current status of a daemon

root@potato:/etc/init.d# initctl status mythtv-backend
mythtv-backend stop/waiting

But where does initctl keep its brains? Each job is configured in /etc/init/*conf like this:

# MythTV Backend service

description     "MythTV Backend"
author          "Mario Limonciello <superm1@ubuntu.com>"

#start on (local-filesystems and net-device-up IFACE=lo and started udev-finish)
stop on starting shutdown

#expect fork
respawn

exec /usr/bin/mythbackend --logfile /var/log/mythtv/mythbackend.log --user mythtv

So if I want to activate this job, I can uncomment the "start on" and then reload the job configuration like so

root@potato:/etc/init# initctl reload-configuration