Log in

No account? Create an account

Previous Entry Share Next Entry
How to disable upstart job in Fedora rawhide?
(Warning: czenglish :)

There have been some requests to mark job files as %config(noreplace) in Fedora upstart package. Typical use case is to disable reboot on control-alt-delete, see #447997 - RFE: mark control-alt-delete %config(noreplace), #612175 - mark /etc/init/ files as config files. Job files are more likely scripts than config files, mark them as %config(noreplace) is unsuitable and these files are overwritten with each update.

Since upstart-1.0-2.fc16 (which is currently in Fedora rawhide (f16)) there is new directory /lib/upstart/init for job defaults. All job files from upstart package are installed there. In case upstart is just installed or upgraded from version < 1.0-2, symlinks referencing to /lib/upstart/init are created in /etc/init/.

  cd /lib/upstart/init
  for j in *.conf; do
    if [ ! -e /etc/init/$j ]; then
      ln -sf /lib/upstart/init/$j /etc/init

So starting with this update it is possible to disable or change job without being overwritten by next update.

1. disable job
You can simply remove symlink from /etc/init/ or you can change job (see 2. change job) and add manual stanza to job file.

2. change job
remove symlink and copy default job file from /lib/upstart/init to /etc/init:
# rm /etc/init/control-alt-delete.conf
# cp /lib/upstart/init/control-alt-delete.conf /etc/init
# echo "debug" >> /etc/init/control-alt-delete.conf