Upstart can NOT handle service/job started by others
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
upstart (Ubuntu) |
Invalid
|
Undecided
|
Unassigned |
Bug Description
-- Problem Description --
Upstart can not see a service/job/process that has been started and running by someone else. Old style init.d/systemd fully/partially handle start/stop correctly (on other Linux systems without Upstart), no matter who started the process.
Our PMLinux collecting agent "daemon_PMLnx" was designed to start/run by root with any means, such as crontab, inittab, service, or even command line at a terminal. The program itself will quit immediately at the beginning if finds the process already running.
Generally, we prefer to organize PMLinux as a service, plus create a start hook in the crontab to run "daemon_PMLnx" at 3am every day, in order to guarantee a restart won't be forgot if someone ever stopped the job.
Here are some command outputs from Ubuntu/Upstart:
# uname -a
Linux ubuntu 3.13.0-24-generic #46-Ubuntu SMP Thu Apr 10 19:09:21 UTC 2014 ppc64le ppc64le ppc64le GNU/Linux
# dpkg -l upstart
Name Version Architecture Description
-======
ii upstart 1.12.1-0ubuntu4 ppc64el event-based init daemon
# ps -ef | grep -e PMLnx$ -e CRON$
root 10263 771 0 17:59 ? 00:00:00 CRON
root 10264 10263 0 17:59 ? 00:00:00 /bin/sh -c /var/perf/
root 10265 10264 0 17:59 ? 00:00:00 /var/perf/
# start PMLinux
PMLinux stop/waiting <--- bad!
# status PMLinux
PMLinux stop/waiting <--- bad!
# stop PMLinux
stop: Unknown instance: <--- bad!
# kill -2 10265
# start PMLinux
PMLinux start/running, process 10562
# ps -ef | grep -e PMLnx$
root 10562 1 0 19:49 ? 00:00:00 /var/perf/
# start PMLinux
start: Job is already running: PMLinux
# stop PMLinux
PMLinux stop/waiting
# stop PMLinux
stop: Unknown instance:
# cat /etc/init/
# daemon_PMLnx - Collecting Agent of IBM Performance Management for Power Linux (PMLinux)
#
# daemon_PMLnx collects PMLinux data at periodic scheduled times
# working HOME directory - /var/perf/pm
description "IBM PMLinux collecting daemon"
author "IBM PMLinux Team, Rochester, USA"
start on runlevel [2345]
stop on runlevel [!2345]
# console output # not works as expected: output to the working terminal (instead of system console)
pre-start script
unset myErrMSG
if [ ! -x /var/perf/
# elif ps -C daemon_PMLnx >/dev/null; then
# export myErrMSG='PMLinux collecting daemon is already running!'
elif [ ! -L /var/adm/perfmgr ] || [ ! -d /var/adm/perfmgr ]; then
fi
if [ -n "$myErrMSG" ]; then
fi
end script
post-start script
if ps -C daemon_PMLnx >/dev/null; then
else
fi
end script
post-stop script
echo "`date +'%D %T'` PMLinux collecting daemon stopped."
end script
exec /var/perf/
The attachment is a screenshot to demonstrate an old init under a different distro 1 that can find/stop PMLinux daemon started from user terminal.
affects: | ubuntu → upstart (Ubuntu) |
tags: |
added: severity-high targetmilestone-inin1410 removed: severity-major |
tags: |
added: severity-medium removed: severity-high |
tags: |
added: targetmilestone-inin14042 removed: targetmilestone-inin1410 |
Changed in upstart (Ubuntu): | |
status: | New → Invalid |
Default Comment by Bridge