Local job changes

Johan Kiviniemi netsplit.com-upstart-devel at johan.kiviniemi.name
Tue Sep 26 15:15:49 BST 2006


On Tue, Sep 26, 2006 at 03:09:51PM +0200, Jürg Billeter wrote:
> The most important change for admins is probably enabling/disabling
> jobs but there might be more changes desired. Currently you can just
> delete a job file (or set it to disabled with the patch from Jοhan
> Kiviniemi) to disable a job easily. This method doesn't fit well with
> package updates, though. Depending on the policy of the package
> manager, distro or local changes to the job files might get lost.

I'd consider that to be entirely the package manager's fault. A good
package manager would interactively do a three-way merge using the
actual config file in /etc, the previous version's packaged (i.e.
default) config file and the new version's packaged config file. A
package manager _never_ just rewrites a config file that has been
modified by the admin.

At least dpkg isn't currently capable of doing that, and i'm guessing
rpm has a similar problem.

Gentoo has a great tool called dispatch-conf. I really hope it were
ported to other distributions as well.

A simple way to test what a good package manager would do:

• Change to a temporary directory and run
  % for f in rc0.{old,current,new}; do cp /etc/event.d/rc0 $f; done
  where rc0.old and .new represent the packaged default configurations
  and rc0.current represents the current file in /etc.
• Add 'disabled' to rc0.current, and add '# Added by new version'
  somewhere in rc0.new.
• Merge the changes interactively: (be sure that EDITOR=vim or whatever
  your editor of choice is)
  % if merge -p rc0.current rc0.old rc0.new >rc0.merged
    then
      sdiff --output=rc0.final rc0.current rc0.merged
    else
      sdiff --output=rc0.final rc0.current rc0.new
    fi
• Now rc0.final is ready to replace rc0.current.

Please excuse the off-topic message. :-)

Regards,
-- 
Jοhan Kiviniemi  http://johan.kiviniemi.name/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
Url : https://lists.ubuntu.com/archives/upstart-devel/attachments/20060926/395946c7/attachment.pgp 


More information about the Upstart-devel mailing list