[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: I have a beef with policy 3.3.3



Just going through some really old mails, when I stumbled upon this
thread:

On Mon, May 01, 2000 at 01:59:15PM -0400, Branden Robinson wrote:
> It says this:
> 
> The system administrator will have the opportunity to customize runlevels
> by either running update-rc.d, by simply adding, moving, or removing the
> symbolic links in /etc/rcn.d if symbolic links are being used, or by
> modifying /etc/runlevel.conf if the file-rc method is being used.
> 
> It also says this:
> 
> To get the default behavior for your package, put in your postinst script
> 
> update-rc.d package defaults >/dev/null
> 
> But there is a problem with this advice:
> 
> apocalypse:/home/branden# update-rc.d -f xdm remove
> update-rc.d: /etc/init.d/xdm exists during rc.d purge (continuing)
>  Removing any system startup links for /etc/init.d/xdm ...
>    /etc/rc0.d/K01xdm
>    /etc/rc1.d/K01xdm
>    /etc/rc2.d/S99xdm
>    /etc/rc3.d/S99xdm
>    /etc/rc4.d/S99xdm
>    /etc/rc5.d/S99xdm
>    /etc/rc6.d/K01xdm
> apocalypse:/home/branden# update-rc.d xdm defaults 99 01
>  Adding system startup for /etc/init.d/xdm ...
>    /etc/rc0.d/K01xdm -> ../init.d/xdm
>    /etc/rc1.d/K01xdm -> ../init.d/xdm
>    /etc/rc6.d/K01xdm -> ../init.d/xdm
>    /etc/rc2.d/S99xdm -> ../init.d/xdm
>    /etc/rc3.d/S99xdm -> ../init.d/xdm
>    /etc/rc4.d/S99xdm -> ../init.d/xdm
>    /etc/rc5.d/S99xdm -> ../init.d/xdm
> 
> You can see that the second command is exactly what will happen the next
> time xdm is upgraded.
> 
> update-rc.d has no way of knowing if the symlinks in the rc directories
> aren't there because the local admin removed them, or because the package
> was just installed.  A postinst script cannot distinguish between an
> initial install and an upgrade, therefore you can't add some kind of
> conditional around the update-rc.d call in the postinst.
> 
> I suggest that update-rc.d and/or policy be modified.

David Damerell and I had a discussion about a year and a half ago
about this issue, and came up with the following suggestion (slightly
modified):

The issue only occurs when a system administrator wishes to install
the package but not to have it started automatically.  The following
enhancements to update-rc.d will solve this and another annoying
problem, partially responsible for this mess.  (I am going to refer to
symlinks, not forgetting that file-rc works differently.)

(1) update-rc.d should accept a -f/--force option which forces setting
    the symlinks as requested.  It is advertised, but not currently
    implemented.  Then sysadmins would never need to play with
    symlinks manually.  Another important option would be "display" to
    show the current status of that script's symlinks.  Maybe the
    "remove" option could be enhanced to selectively remove links from
    various runlevels.

(2) The need to be able to disable the automatic start/stop links.
    Have options "disable", "enable" which change every
    /etc/rc?.d/[SK]??service symlink into /etc/rc?.d/D[SK]??service
    and back again.  ("disable" should also stop the service, although
    whether "enable" should call start-stop-service or start-rc.d or
    whatever is debatable.)  Then update-rc.d should recognise the
    presence of an /etc/rc?.d/D[SK]??service link as also indicating
    the presence of pre-existing links, just as it currently does with
    /etc/rc?.d/[SK]??service links.

   Julian

-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

  Julian Gilbey, Dept of Maths, QMW, Univ. of London. J.D.Gilbey@qmw.ac.uk
        Debian GNU/Linux Developer,  see http://www.debian.org/~jdg
  Donate free food to the world's hungry: see http://www.thehungersite.com/



Reply to: