Ask Your Question
1

Service class working differently on ubuntu and debian [resolved] [closed]

asked 2016-08-30 08:01:52 -0500

ElliotCooper gravatar image

updated 2016-08-31 02:08:31 -0500

I have written a simple service class which looks like the following::

class  nginx_generic::nginx_ssl {

    service { 'nginxssl':
        start   => "service nginx start",
        stop    => "service nginx stop",
        status  => "service nginx status",
    }
    }

Which appears to work differently on Debian and Ubuntu.

On a debian server (wheezy, puppet 3.7.3-1puppetlabs1 ) the status of of nginx is correctly evaluated with the given command i.e.:

Debug: Executing 'service nginx status

However, on an ubuntu system (ubuntu 14.04, puppet 3.7.3-1puppetlabs1 ) the custom status command is ignored and the default attempted i.e.

Debug: Service[nginxssl](provider=upstart): Could not find nginxssl.conf in /etc/init
Debug: Service[nginxssl](provider=upstart): Could not find nginxssl.conf in /etc/init.d
Debug: Service[nginxssl](provider=upstart): Could not find nginxssl in /etc/init
Debug: Service[nginxssl](provider=upstart): Could not find nginxssl in /etc/init.d
Debug: Service[nginxssl](provider=upstart): Could not find nginxssl.sh in /etc/init
Debug: Service[nginxssl](provider=upstart): Could not find nginxssl.sh in /etc/init.d
Error: /Stage[main]/Memset_ssl_generic::Nginx_ssl/Service[nginxssl]: Could not evaluate: Could not find init script or upstart conf file for 'nginxssl'

I am not able to find out why the puppet client behaves differently ubuntu and debian nor how I can get the ubuntu puppet client to use the configured status command.

Any help would be much appreciated!

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by ElliotCooper
close date 2016-09-01 03:53:51.199302

Comments

I don't understand why you wouldn't use the native service directly, by doing: service {'nginx': ensure => 'running', enable => 'true', }

DarylW gravatar imageDarylW ( 2016-08-31 08:22:15 -0500 )edit

I didn't use ensure=> running because I only wanted nginx restarted if it was already running. If ensure => running is not present puppet will restart the service if it is running and do nothing if it isn't. As I already had an nginx class that contained ensure => running I wrote a new one without.

ElliotCooper gravatar imageElliotCooper ( 2016-08-31 08:41:34 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2016-08-31 02:08:04 -0500

ElliotCooper gravatar image

It turned out to be a bug in version 3.7.3-1puppetlabs1 of puppet. I upgraded the problem client to the latest 3.8 (3.8.7-1puppetlab) and the issue was no longer present.

edit flag offensive delete link more

Question Tools

Stats

Asked: 2016-08-30 08:01:52 -0500

Seen: 26 times

Last updated: Aug 31 '16