[Pkg-sysvinit-devel] Bug#705254: [Pkg-systemd-maintainers] Bug#705254: Provide "is-enabled" command for update-rc.d

Michael Biebl biebl at debian.org
Fri Apr 12 20:40:53 UTC 2013


Am 12.04.2013 22:27, schrieb Michael Biebl:
> A rough idea how this check could look like:
> 1/ grep for Default-Start and Default-Stop in the LSB header
> 2/ To check if a service is enabled:
>    for i in Default-Start: check if /etc/rc$i.d/S??$service
>    for i in Default-Stop: check if /etc/rc$i.d/K??$service
> if all of those checks are true, is-enabled returns true
> 3/ To check if a service is disabled:
>    for i in Default-Start: check if exists /etc/rc$i.d/K??$service
>    for i in Default-Stop: check if  /etc/rc$i.d/K??$service
> if all of those checks are true, is-enabled returns false

The point here is to turn S into K symlinks for the is-disabled case.

That said, the above check is flawed, since it doesn't take into account
if the administrator has made custom changes, i.e. deleted symlinks
manually or added one manually. So I'd say we always need to check *all*
runlevels for existing symlinks and compare that with the expected set
of S and K symlinks.

Michael



-- 
Why is it that all of the instruments seeking intelligent life in the
universe are pointed away from Earth?

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 901 bytes
Desc: OpenPGP digital signature
URL: <http://lists.alioth.debian.org/pipermail/pkg-sysvinit-devel/attachments/20130412/9d4ddc72/attachment.pgp>


More information about the Pkg-sysvinit-devel mailing list