Re: [Bug 1276766] Re: 'status startpar-bridge' fails with 'status: Unknown parameter: JOB'

2014-03-15 Thread Stig Sandbeck Mathisen
Steve Langasek  writes:

> Not being particularly familiar with puppet's internals, I don't know
> if the above is wrong per se. But startpar-bridge (and other jobs
> present on Ubuntu by default, such as network-interface and
> network-interface-security) are instantiated jobs; calling 'status
> network-interface' without specifying a network interface is not
> meaningful, and any errors returned from 'status' about 'unknown
> parameter' or 'unknown instance' should not be treated as failures by
> puppet.

That was what I was missing; instantiation. Thanks. :)

> If puppet needs to get a list of all jobs running on the system,
> including instantiated jobs, it should use the 'initctl list'
> interface.

It does, but I think something is off inside puppet's guts.

As far as I can see in the source (ruby code at
https://github.com/puppetlabs/puppet/blob/master/lib/puppet/provider/service/upstart.rb#L47)
it does "initctl list", and picks the first word of each line, unless
the service in question is "network-interface" or
"network-interface-security".

It looks like puppet does not handle instances in a generic way, but
special cases it for "network-interface" and
"network-interface-security", and then hardcoded with INTERFACE=foo and
JOB=bar.

It looks like the instance variable name differs between services, so if
my assumption is correct, I wonder what would be the "generic" way of
enumerating services the correct way would be to find this variable for
all instanciated services.

-- 
Stig Sandbeck Mathisen

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1276766

Title:
  'status startpar-bridge' fails with 'status: Unknown parameter: JOB'

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/puppet/+bug/1276766/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs


Re: [Bug 1276766] Re: 'status startpar-bridge' fails with 'status: Unknown parameter: JOB'

2014-03-15 Thread Steve Langasek
Hi Stig,

On Sat, Mar 15, 2014 at 08:19:04PM +0100, Stig Sandbeck Mathisen wrote:
> Steve Langasek  writes:

> > This is a bug in puppet, then; there's no reason that puppet should be
> > trying to call 'status startpar-bridge', and the fact that it's doing
> > so is a bug in the puppet code in question.

> When you run "puppet resource service", puppet will enumerate _all_
> services on that server (init scripts, upstart jobs, systemd services,
> whatnot, and then check if it is running, and if it is enabled on boot.

> When the operatingsystem is "ubuntu", the service provider is "upstart",
> The relevant code for handling services on ubuntu is:

>   defaultfor :operatingsystem => :ubuntu

>   commands :start   => "/sbin/start",
>:stop=> "/sbin/stop",
>:restart => "/sbin/restart",
>:status_exec  => "/sbin/status",
>:initctl => "/sbin/initctl"

> Is this wrong for Ubuntu?

Not being particularly familiar with puppet's internals, I don't know if the
above is wrong per se.  But startpar-bridge (and other jobs present on
Ubuntu by default, such as network-interface and network-interface-security)
are instantiated jobs; calling 'status network-interface' without specifying
a network interface is not meaningful, and any errors returned from 'status'
about 'unknown parameter' or 'unknown instance' should not be treated as
failures by puppet.

If puppet needs to get a list of all jobs running on the system, including
instantiated jobs, it should use the 'initctl list' interface.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1276766

Title:
  'status startpar-bridge' fails with 'status: Unknown parameter: JOB'

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/puppet/+bug/1276766/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs


Re: [Bug 1276766] Re: 'status startpar-bridge' fails with 'status: Unknown parameter: JOB'

2014-03-15 Thread Stig Sandbeck Mathisen
Steve Langasek  writes:

> This is a bug in puppet, then; there's no reason that puppet should be
> trying to call 'status startpar-bridge', and the fact that it's doing
> so is a bug in the puppet code in question.

When you run "puppet resource service", puppet will enumerate _all_
services on that server (init scripts, upstart jobs, systemd services,
whatnot, and then check if it is running, and if it is enabled on boot.

When the operatingsystem is "ubuntu", the service provider is "upstart",
The relevant code for handling services on ubuntu is:

  defaultfor :operatingsystem => :ubuntu

  commands :start   => "/sbin/start",
   :stop=> "/sbin/stop",
   :restart => "/sbin/restart",
   :status_exec  => "/sbin/status",
   :initctl => "/sbin/initctl"

Is this wrong for Ubuntu?

-- 
Stig Sandbeck Mathisen

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1276766

Title:
  'status startpar-bridge' fails with 'status: Unknown parameter: JOB'

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/puppet/+bug/1276766/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs