Merge lp:~jamesodhunt/ubuntu/precise/upstart/bug-974147 into lp:ubuntu/precise/upstart

Proposed by James Hunt
Status: Needs review
Proposed branch: lp:~jamesodhunt/ubuntu/precise/upstart/bug-974147
Merge into: lp:ubuntu/precise/upstart
Diff against target: 53 lines (+21/-0)
2 files modified
debian/changelog (+10/-0)
debian/upstart-job (+11/-0)
To merge this branch: bzr merge lp:~jamesodhunt/ubuntu/precise/upstart/bug-974147
Reviewer Review Type Date Requested Status
Steve Langasek Pending
Review via email: mp+101022@code.launchpad.net

Description of the change

debian/upstart-job: Do not start or restart disabled jobs (LP: #974147)

Hi Steve,

I'm not 100% happy with the restart case, hence my big comment in debian/upstart-job, but I think it's the best we can do. That said, simply calling "exit 0" would be the path of least surprise for users if the job is disabled but is found to be running. Maybe a compromise might be to go with my logic, but add a warning along the lines of:

  WARNING: reload command stopped disabled job '$JOB', but will NOT restart it.

To post a comment you must log in.
1388. By Serge Hallyn

debian/apparmor-profile-load: don't run in a container. This can hopefully
be removed in precise, after stacked profiles are supported. (LP: #978297)

1389. By Colin Watson

sync up changelog with upload

1390. By James Hunt

* debian/upstart-job: Add in handling for disabled jobs:
  - Do not restart a job if disabled, unless job was forcibly started.
  - Do stop a disabled job that was forcibly started.
  Resolves issue where 'invoke-rc.d restart' erroneously started disabled
  jobs on package upgrade (LP: #974147)

Unmerged revisions

1390. By James Hunt

* debian/upstart-job: Add in handling for disabled jobs:
  - Do not restart a job if disabled, unless job was forcibly started.
  - Do stop a disabled job that was forcibly started.
  Resolves issue where 'invoke-rc.d restart' erroneously started disabled
  jobs on package upgrade (LP: #974147)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'debian/changelog'
--- debian/changelog 2012-04-12 09:32:54 +0000
+++ debian/changelog 2012-04-16 08:11:22 +0000
@@ -1,3 +1,13 @@
1upstart (1.5-0ubuntu5) precise; urgency=low
2
3 * debian/upstart-job: Add in handling for disabled jobs:
4 - Do not restart a job if disabled, unless job was forcibly started.
5 - Do stop a disabled job that was forcibly started.
6 Resolves issue where 'invoke-rc.d restart' erroneously started disabled
7 jobs on package upgrade (LP: #974147)
8
9 -- James Hunt <james.hunt@ubuntu.com> Mon, 16 Apr 2012 09:06:46 +0100
10
1upstart (1.5-0ubuntu4) precise; urgency=low11upstart (1.5-0ubuntu4) precise; urgency=low
212
3 * debian/apparmor-profile-load: don't run in a container. This can13 * debian/apparmor-profile-load: don't run in a container. This can
414
=== modified file 'debian/upstart-job'
--- debian/upstart-job 2011-03-08 12:39:34 +0000
+++ debian/upstart-job 2012-04-16 08:11:22 +0000
@@ -37,6 +37,8 @@
37$ECHO "Rather than invoking init scripts through /etc/init.d, use the service(8)"37$ECHO "Rather than invoking init scripts through /etc/init.d, use the service(8)"
38$ECHO "utility, e.g. service $INITSCRIPT $COMMAND"38$ECHO "utility, e.g. service $INITSCRIPT $COMMAND"
3939
40initctl show-config -e "$JOB"|grep -q '^ start on' || DISABLED=1
41
40case $COMMAND in42case $COMMAND in
41status)43status)
42 $ECHO44 $ECHO
@@ -55,6 +57,8 @@
55 exit 057 exit 0
56 elif [ -n "$RUNNING" ] && [ "$COMMAND" = "start" ]; then58 elif [ -n "$RUNNING" ] && [ "$COMMAND" = "start" ]; then
57 exit 059 exit 0
60 elif [ -n "$DISABLED" ] && [ "$COMMAND" = "start" ]; then
61 exit 0
58 fi62 fi
59 $COMMAND "$JOB"63 $COMMAND "$JOB"
60 ;;64 ;;
@@ -69,6 +73,13 @@
69 if [ -n "$RUNNING" ] ; then73 if [ -n "$RUNNING" ] ; then
70 stop "$JOB"74 stop "$JOB"
71 fi75 fi
76 # If the job is disabled and is not currently running, the job is
77 # not restarted. However, if the job is disabled but has been forced into the
78 # running state, we *do* stop and restart it since this is expected behaviour
79 # for the admin who forced the start.
80 if [ -n "$DISABLED" ] && [ -z "$RUNNING" ]; then
81 exit 0
82 fi
72 start "$JOB"83 start "$JOB"
73 ;;84 ;;
74reload|force-reload)85reload|force-reload)

Subscribers

People subscribed via source and target branches

to all changes: