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?
signature.asc
Description: OpenPGP digital signature