Page MenuHomePhabricator

trebuchet puppet provider broken on systems without upstart
Closed, ResolvedPublic

Description

found out this while deploying restbase on restbase1003 (jessie)

Debug: Executing '/usr/sbin/service cassandra status'
Debug: Puppet::Type::Package::ProviderTrebuchet: file /sbin/status does not exist
Error: /Package[restbase/deploy]: Provider trebuchet is not functional on this host

and indeed in modules/trebuchet/lib/puppet/provider/package/trebuchet.rb

32   commands :git_cmd    => '/usr/bin/git',
33            :salt_cmd   => '/usr/bin/salt-call',
34            :status_cmd => '/sbin/status'

Related Objects

View Standalone Graph
This task is connected to more than 200 other tasks. Only direct parents and subtasks are shown here. Use View Standalone Graph to show more of the graph.
StatusSubtypeAssignedTask
Resolved GWicke
Resolved GWicke

Event Timeline

fgiunchedi raised the priority of this task from to Medium.
fgiunchedi updated the task description. (Show Details)
fgiunchedi subscribed.

cc @ori as the original author, I couldn't find a drop-in version for systemd, the obvious systemctl status <service> doesn't have the same semantics

root@restbase1003:/var/log/cassandra# systemctl status cassandra
● cassandra.service - LSB: distributed storage system for structured data
   Loaded: loaded (/etc/init.d/cassandra)
   Active: active (exited) since Fri 2015-02-13 16:08:13 UTC; 1h 29min ago
  Process: 61653 ExecStart=/etc/init.d/cassandra start (code=exited, status=0/SUCCESS)
root@restbase1003:/var/log/cassandra# echo $?
0

note it exited however status' exit code is zero

root@restbase1003:/var/log/cassandra# systemctl status cassandraz
● cassandraz.service
   Loaded: not-found (Reason: No such file or directory)
   Active: inactive (dead)
root@restbase1003:/var/log/cassandra# echo $?
3
root@restbase1003:/var/log/cassandra# 

root@restbase1003:/var/log/cassandra# systemctl status ntp
● ntp.service - LSB: Start NTP daemon
   Loaded: loaded (/etc/init.d/ntp)
   Active: active (running) since Fri 2015-02-13 09:45:52 UTC; 7h ago
   CGroup: /system.slice/ntp.service
           └─13094 /usr/sbin/ntpd -p /var/run/ntpd.pid -g -u 110:115

Feb 13 09:45:52 restbase1003 ntpd[13094]: proto: precision = 0.107 usec
Feb 13 09:45:52 restbase1003 ntpd[13094]: Listen and drop on 0 v4wildcard 0.0.0.0 UDP 123
Feb 13 09:45:52 restbase1003 ntpd[13094]: Listen and drop on 1 v6wildcard :: UDP 123
Feb 13 09:45:52 restbase1003 ntpd[13094]: Listen normally on 2 lo 127.0.0.1 UDP 123
Feb 13 09:45:52 restbase1003 ntpd[13094]: Listen normally on 3 eth0 10.64.32.159 UDP 123
Feb 13 09:45:52 restbase1003 ntpd[13094]: Listen normally on 4 lo ::1 UDP 123
Feb 13 09:45:52 restbase1003 ntpd[13094]: Listen normally on 5 eth0 fe80::8edc:d4ff:fe00:550 UDP 123
Feb 13 09:45:52 restbase1003 ntpd[13094]: Listen normally on 6 eth0 2620:0:861:103:8edc:d4ff:fe00:55... 123
Feb 13 09:45:52 restbase1003 ntpd[13094]: peers refreshed
Feb 13 09:45:52 restbase1003 ntpd[13094]: Listening on routing socket on fd #23 for interface updates
Hint: Some lines were ellipsized, use -l to show in full.
root@restbase1003:/var/log/cassandra# echo $?
0
root@restbase1003:/var/log/cassandra#

misread the code, just the string "running" is checked, so switching between /sbin/status and /bin/systemctl status might DTRT

# Make sure that the salt-minion service is running.
def check_salt_minion_status
  status = status_cmd('salt-minion')
  fail Puppet::ExecutionFailure unless status.include? 'running'
rescue Puppet::ExecutionFailure
  raise Puppet::ExecutionFailure, <<-END
    The Trebuchet package provider requires that the salt-minion
    service be running.
  END
end

@faidon reported what looks like a missing submodule checkout after re-running puppet with the patch above:

restbase1003 restbase[25378]: module.js:340   
restbase1003 restbase[25378]: throw err;      
restbase1003 restbase[25378]: ^               
restbase1003 restbase[25378]: Error: Cannot find module '/usr/lib/restbase/deploy/restbase/server.js'

We don't have access to these systems yet, so can't investigate (see T89366).

GWicke claimed this task.

This looks fixed now, at least on the three nodes that are live so far.