Author: arkurth
Date: Thu Jul 20 17:54:25 2017
New Revision: 1802519
URL: http://svn.apache.org/viewvc?rev=1802519&view=rev
Log:
VCL-1061
Updated Upstart.pm::_get_service_info to check for 'Connection refused' when
executing 'initctl list'.
Modified:
vcl/trunk/managementnode/lib/VCL/Module/OS/Linux/init/Upstart.pm
Modified: vcl/trunk/managementnode/lib/VCL/Module/OS/Linux/init/Upstart.pm
URL:
http://svn.apache.org/viewvc/vcl/trunk/managementnode/lib/VCL/Module/OS/Linux/init/Upstart.pm?rev=1802519&r1=1802518&r2=1802519&view=diff
==============================================================================
--- vcl/trunk/managementnode/lib/VCL/Module/OS/Linux/init/Upstart.pm (original)
+++ vcl/trunk/managementnode/lib/VCL/Module/OS/Linux/init/Upstart.pm Thu Jul 20
17:54:25 2017
@@ -185,6 +185,11 @@ sub _get_service_info {
notify($ERRORS{'WARNING'}, 0, "failed to execute command to
list Upstart services on $computer_node_name");
return;
}
+ elsif (grep(/Connection refused/i, @$initctl_output)) {
+ # Ubuntu 16 and later display the following:
+ # initctl: Unable to connect to Upstart: Failed to connect
to socket /com/ubuntu/upstart: Connection refused
+ notify($ERRORS{'DEBUG'}, 0, "initctl command cannot be used to
retrieve list of all services on $computer_node_name, command:
'$initctl_command', output:\n" . join("\n", @$initctl_output));
+ }
elsif ($initctl_exit_status ne '0') {
notify($ERRORS{'WARNING'}, 0, "failed to retrieve list of all
services on $computer_node_name using the initctl command, exit status:
$initctl_exit_status, command:\n$initctl_command\noutput:\n" . join("\n",
@$initctl_output));
return;