Ansible 0.8 :: Debian Lenny :: handler :: unable to find service binary

When I try to restart a service on Debian Lenny (whatever the service) I get this out :

NOTIFIED: [restart munin-node] *********************
failed: [176.31.85.177] => {“failed”: true, “item”: “”, “msg”: “unable to find service binary”}

This is my hanlder :

  • name: restart munin-node
    action: service name=munin-node state=restarted

And this works fine on Debian Squeeze

Thanks!

Tchoum wrote:

When I try to restart a service on Debian Lenny (whatever the service) I
get this out :

You know Lenny hasn't even been getting security updates since February,
right? If it works on current distributions, it seems rather pointless to me
to try to fix it on ancient things...

Daniel

ansible service module relies on a redhat/derivatives program called ‘service’ which doesn’t work on debian/derivatives.

command /etc/init.d/ should work until someone has time to make the service module more generic.

so why does it work on debian squeeze?

2012/10/27 Brian Coca <briancoca@gmail.com>

I know… and I don’t agree with you… sometimes you can not simply migrate…

2012/10/27 Daniel Hokka Zakrisson <daniel@hozac.com>

This is not true. It also is aware of upstart if installed.

the service program works on Debian, it sounds like your install of
Lenny just doesn't have it.

I'll gladly take patches to make the module more backwards compatible
with older (admittedly, unsupported) versions.

I recognize everyone can't migrate instantly and we need to support
that within reason.

Sorry, had not tested this in a long time, had missed the upstart support. My previous answer still applies to older versions.

Brian Coca

the service command is an lsb requirement. All debian distributions should have it available. Look for lsb compliance packages for it.

-sv

the service command is an lsb requirement. All debian distributions should
have it available. Look for lsb compliance packages for it.

-sv

Yes. Indeed:

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 11.04
Release: 11.04
Codename: natty
$ which service
/usr/sbin/service
$ dpkg -S /usr/sbin/service
sysvinit-utils: /usr/sbin/service

Regards,

– Zack

For modern debian and derivatives I was wrong in my initial post, but many are stuck with lenny and even sarge which don’t may not have the service command or upstart available.

For all those and people with BSD derivatives currently using the init/rc scripts directly is the easiest option. I have on my list to add them as fallback to the service module but it might take me a while to get to it.

Odd - this post seems to suggest it is there for Lenny, too.

http://www.sizledcore.com/2010/04/how-to-configure-startup-services-in-debian-lenny/

Look for the chkconfig pkg in lenny:

Package: chkconfig
Priority: optional
Section: admin
Installed-Size: 76
Maintainer: Peter Eisentraut <petere@debian.org>
Architecture: all
Version: 11.0-79.1-1
Depends: perl
Recommends: insserv
Conflicts: sysvconfig
Filename: pool/main/c/chkconfig/chkconfig_11.0-79.1-1_all.deb
Size: 11888
MD5sum: 6e6b27d42b770798aef201a994e11cab
SHA1: c5752d1c015231ad0d9c08be8b6cec832c12ea30
SHA256: e84feba1ea8b6705ae0a35f180fe22a4adaefb0d501aea6886673253cf3b599e
Description: system tool to enable or disable system services
  Chkconfig is a utility to update and query runlevel information for system
  services. Chkconfig manipulates the numerous symbolic links in /etc/init.d/,
  to relieve system administrators of some of the drudgery of manually editing
  the symbolic links.
  .
  This package also contains the program "service" for running init scripts in
  a predictable environment.
  .
  In Debian, there are several tools with similar functionality, but users
  coming from other Linux distributions will find the tools in this package
  more familiar.
Tag: admin::configuring, implemented-in::perl, implemented-in::shell, role::program, scope::utility, use::configuring

good luck
-sv

+1 I think this would be great. It would certainly help for Solaris.
While the newer Solaris's support SMF there is still a need for rc
script support for older versions of Solaris as well as some software
on newer solaris's that haven't been upgraded to use SMF.

The service module has been patched, it now handles rc dirs and init dirs as well as rc.conf in BSD.

I should also mention, more work is planned to make it OS sensitive and load specific classes that deal with each case as a recent update to the user module does.

Hi Brian, I see in your fork of ansible you have patched the service
module bit it doesn't seem to be in ansible proper. Intended?

Thanks,

Please disregard, I was looking at an old branch. Thanks very much for
your efforts here!

Romeo