Ubuntu

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

Proposed by James Hunt on 2012-04-05
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
To merge this branch: bzr merge lp:~jamesodhunt/ubuntu/precise/upstart/bug-974147
Reviewer Review Type Date Requested Status
Steve Langasek 2012-04-05 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 on 2012-04-10

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 on 2012-04-12

sync up changelog with upload

1390. By James Hunt on 2012-04-16

* 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 on 2012-04-16

* 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

1=== modified file 'debian/changelog'
2--- debian/changelog 2012-04-12 09:32:54 +0000
3+++ debian/changelog 2012-04-16 08:11:22 +0000
4@@ -1,3 +1,13 @@
5+upstart (1.5-0ubuntu5) precise; urgency=low
6+
7+ * debian/upstart-job: Add in handling for disabled jobs:
8+ - Do not restart a job if disabled, unless job was forcibly started.
9+ - Do stop a disabled job that was forcibly started.
10+ Resolves issue where 'invoke-rc.d restart' erroneously started disabled
11+ jobs on package upgrade (LP: #974147)
12+
13+ -- James Hunt <james.hunt@ubuntu.com> Mon, 16 Apr 2012 09:06:46 +0100
14+
15 upstart (1.5-0ubuntu4) precise; urgency=low
16
17 * debian/apparmor-profile-load: don't run in a container. This can
18
19=== modified file 'debian/upstart-job'
20--- debian/upstart-job 2011-03-08 12:39:34 +0000
21+++ debian/upstart-job 2012-04-16 08:11:22 +0000
22@@ -37,6 +37,8 @@
23 $ECHO "Rather than invoking init scripts through /etc/init.d, use the service(8)"
24 $ECHO "utility, e.g. service $INITSCRIPT $COMMAND"
25
26+initctl show-config -e "$JOB"|grep -q '^ start on' || DISABLED=1
27+
28 case $COMMAND in
29 status)
30 $ECHO
31@@ -55,6 +57,8 @@
32 exit 0
33 elif [ -n "$RUNNING" ] && [ "$COMMAND" = "start" ]; then
34 exit 0
35+ elif [ -n "$DISABLED" ] && [ "$COMMAND" = "start" ]; then
36+ exit 0
37 fi
38 $COMMAND "$JOB"
39 ;;
40@@ -69,6 +73,13 @@
41 if [ -n "$RUNNING" ] ; then
42 stop "$JOB"
43 fi
44+ # If the job is disabled and is not currently running, the job is
45+ # not restarted. However, if the job is disabled but has been forced into the
46+ # running state, we *do* stop and restart it since this is expected behaviour
47+ # for the admin who forced the start.
48+ if [ -n "$DISABLED" ] && [ -z "$RUNNING" ]; then
49+ exit 0
50+ fi
51 start "$JOB"
52 ;;
53 reload|force-reload)

Subscribers

People subscribed via source and target branches

to all changes: