[Pkg-puppet-devel] Bug#515660: Bug#515660: Bug#515660: service type stops working with Debian's insserv

martin f krafft madduck at debian.org
Thu Aug 6 19:54:24 UTC 2009


also sprach Nigel Kersten <nigel at explanatorygap.net> [2009.08.06.2128 +0200]:
> I see the problem.
> 
>     def enabled?
>         output = update "-n", "-f", @resource[:name], "remove"
> 
>         # If it's enabled, then it will print output showing removal of
>         # links.
>         if output =~ /etc\/rc[\dS].d\/S|not installed/
>             return :true
>         else
>             return :false
>         end
>     end

Ouch! Good spot.

> There must be a better way to do this...

invoke-rc.d --query cron start

This will return 104 if cron would be started in the current
runlevel, which means that the init.d script symlink exists for the
runlevel.

If it returns 101 or 106, then cron is disabled by policy (but the
init.d script exists).

If it returns 100, then the init.d script does not exist.

If it returns 105, then all bets are off.

man invoke-rc.d

-- 
 .''`.   martin f. krafft <madduck at d.o>      Related projects:
: :'  :  proud Debian developer               http://debiansystem.info
`. `'`   http://people.debian.org/~madduck    http://vcs-pkg.org
  `-  Debian - when you have better things to do than fixing systems
 
"whale feces or working at microsoft? i would probably be the whale
 feces researcher. salt air and whale flatulence; what
 could go wrong?"
             -- michael moyer, executive editor of _popular science_
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: Digital signature (see http://martin-krafft.net/gpg/)
URL: <http://lists.alioth.debian.org/pipermail/pkg-puppet-devel/attachments/20090806/0969d487/attachment.pgp>


More information about the Pkg-puppet-devel mailing list