Merge lp:~clint-fewbar/ubuntu/natty/portmap/new-boot-events into lp:ubuntu/natty/portmap

Proposed by Clint Byrum
Status: Merged
Merged at revision: 15
Proposed branch: lp:~clint-fewbar/ubuntu/natty/portmap/new-boot-events
Merge into: lp:ubuntu/natty/portmap
Diff against target: 94 lines (+52/-3)
5 files modified
debian/changelog (+12/-0)
debian/portmap.portmap-boot.upstart (+10/-0)
debian/portmap.portmap-wait.upstart (+22/-0)
debian/portmap.portmap.upstart (+5/-2)
debian/rules (+3/-1)
To merge this branch: bzr merge lp:~clint-fewbar/ubuntu/natty/portmap/new-boot-events
Reviewer Review Type Date Requested Status
Steve Langasek Needs Fixing
Review via email: mp+45292@code.launchpad.net

Description of the change

This changes the way portmap is started on bootup so that it includes the ON_BOOT=y flag, which is needed to satisfy statd's very specific startup needs. It also adds the 'portmap-wait' job that allows starting and/or waiting on portmap to startup without using its started event.

To post a comment you must log in.
Revision history for this message
Steve Langasek (vorlon) wrote :

On Wed, Jan 05, 2011 at 08:44:10PM -0000, Clint Byrum wrote:
> === renamed file 'debian/upstart' => 'debian/portmap.portmap.upstart'
> --- debian/upstart 2010-04-17 01:42:21 +0000
> +++ debian/portmap.portmap.upstart 2011-01-05 20:44:09 +0000
> @@ -7,8 +7,8 @@
> description "RPC port mapper"
> author "Steve Langasek <email address hidden>"
>
> -start on (virtual-filesystems
> - and net-device-up IFACE=lo)
> +# Note that portmap is started by portmap-boot.conf and so intentionally
> +# has no start on
>
> expect fork
> respawn
>

The previous job had 'and net-device-up IFACE=lo' as a start condition, but
this has been dropped from the new portmap-boot job without explanation.
Have you confirmed that the interface doesn't need to be up for portmap to
start successfully? If not, this condition should be reintroduced.

Please wrap changelog entries at 80 characters - you should find that
lintian reports an error for over-long changelog lines here.

--
Steve Langasek Give me a lever long enough and a Free OS
Debian Developer to set it on, and I can move the world.
Ubuntu Developer http://www.debian.org/
<email address hidden> <email address hidden>

Revision history for this message
Steve Langasek (vorlon) :
review: Needs Fixing
Revision history for this message
Clint Byrum (clint-fewbar) wrote :

Steve thanks for the review. I realize now that I had proposed merging without pushing my latest changes.

The latest version has fixed upstart jobs, including net-device-up IFACE=lo and the appropriate initctl command.

I've also wrapped all of the changelog lines at 72 chars (to allow room for nesting later)

Revision history for this message
Steve Langasek (vorlon) wrote :

Hi Clint,

One last round of nits:

- dh_installinit -- start 43 S 2 3 4 5 . start 32 0 6 . stop 81 1 .
+ dh_installinit -pportmap --upstart-only --no-start --name portmap-boot
+ dh_installinit -pportmap --upstart-only --no-start --name portmap-wait
+ dh_installinit -pportmap --upstart-only -R --name portmap

* For this to be mergeable with Debian later, we should keep the start, stop arguments to dh_installinit here. They're not relevant in an upstart case, but Debian has ports that aren't upstart-able so we should maintain backwards-compatibility with sysvinit-only startup.

* The '-pportmap' is correct, but redundant given that we're only building one binary package here; I suggest omitting this.

* --upstart-only: this option says to not anything to the maintainer scripts. For two of these scripts, --no-start + --upstart-only is redundant and you only need one of them. For the third script, --upstart-only and -R are contradictory, and I think *both* should be omitted.

So I think the final installinit calls should be:

       dh_installinit --upstart-only --name portmap-boot
       dh_installinit --upstart-only --name portmap-wait
       dh_installinit --name portmap

review: Needs Fixing
Revision history for this message
Steve Langasek (vorlon) wrote :

 --upstart-only: sorry, I'm apparently having difficulty reading my own manpage scribblings! Yes, you should definitely be passing both --upstart-only and --no-start for the portmap-boot and portmap-wait jobs. For the portmap job, you should pass neither --upstart-only nor -R.

19. By Clint Byrum

simplifying dh_installinit and re-introducing sysv args to ease merge to Debian

Revision history for this message
Clint Byrum (clint-fewbar) wrote :

Ok, I originally used the flags I did because the rcX.d links were created for some reason, but I think that was a big of thrashing on my part.

I've pushed up the latest version with the start and stop arguments added back in, and the suggested argument simplifications.

Thanks for the nits. Lets hope there are less and less as I learn what to pay attention to. ;)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2010-06-04 10:01:08 +0000
3+++ debian/changelog 2011-01-11 16:13:04 +0000
4@@ -1,3 +1,15 @@
5+portmap (6.0.0-2ubuntu2) natty; urgency=low
6+
7+ * debian/upstart renamed to debian/portmap.portmap.upstart,
8+ debian/portmap.portmap-boot.upstart, debian/rules: Added to set
9+ special ON_BOOT flag during boot, which allows statd to use an
10+ AND with 'started portmap ON_BOOT=y'. This version of portmap is a
11+ dependency of nfs-utils to fix LP: #525154
12+ * debian/portmap.portmap-wait.upstart: job to wait for portmap to
13+ finish starting. also dependedon on by nfs-utils.
14+
15+ -- Clint Byrum <clint@ubuntu.com> Wed, 05 Jan 2011 11:47:26 -0800
16+
17 portmap (6.0.0-2ubuntu1) maverick; urgency=low
18
19 * Merge from Debian unstable. Remaining changes:
20
21=== added file 'debian/portmap.portmap-boot.upstart'
22--- debian/portmap.portmap-boot.upstart 1970-01-01 00:00:00 +0000
23+++ debian/portmap.portmap-boot.upstart 2011-01-11 16:13:04 +0000
24@@ -0,0 +1,10 @@
25+# portmap-boot
26+
27+description "Upstart job to start portmap on boot only"
28+author "Clint Byrum"
29+
30+start on virtual-filesystems and net-device-up IFACE=lo
31+
32+task
33+
34+exec initctl emit --no-wait start-portmap ON_BOOT=y
35
36=== added file 'debian/portmap.portmap-wait.upstart'
37--- debian/portmap.portmap-wait.upstart 1970-01-01 00:00:00 +0000
38+++ debian/portmap.portmap-wait.upstart 2011-01-11 16:13:04 +0000
39@@ -0,0 +1,22 @@
40+# portmap-wait
41+
42+description "Start this job to wait until portmap is started or fails to start"
43+author "Clint Byrum <clint.byrum@canonical.com>"
44+
45+stop on started portmap or stopped portmap
46+
47+# Needed to make starting the job successful despite being killed
48+normal exit 2
49+task
50+
51+script
52+
53+ status portmap | grep -q "start/running" && exit 0
54+
55+ start portmap || true
56+
57+ # Waiting forever is ok.. upstart will kill this job when
58+ # the portmap we tried to start above either starts or stops
59+ while sleep 3600; do;:;done
60+
61+end script
62
63=== renamed file 'debian/upstart' => 'debian/portmap.portmap.upstart'
64--- debian/upstart 2010-04-17 01:42:21 +0000
65+++ debian/portmap.portmap.upstart 2011-01-11 16:13:04 +0000
66@@ -7,8 +7,11 @@
67 description "RPC port mapper"
68 author "Steve Langasek <steve.langasek@canonical.com>"
69
70-start on (virtual-filesystems
71- and net-device-up IFACE=lo)
72+start on start-portmap
73+
74+# ON_BOOT is set on start-portmap in portmap-boot.conf
75+# Used by statd which must not start on started portmap during boot
76+export ON_BOOT
77
78 expect fork
79 respawn
80
81=== modified file 'debian/rules'
82--- debian/rules 2010-02-25 09:05:08 +0000
83+++ debian/rules 2011-01-11 16:13:04 +0000
84@@ -45,7 +45,9 @@
85 dh_installdebconf
86 dh_installdocs
87 dh_installexamples
88- dh_installinit -- start 43 S 2 3 4 5 . start 32 0 6 . stop 81 1 .
89+ dh_installinit --upstart-only --no-start --name portmap-boot
90+ dh_installinit --upstart-only --no-start --name portmap-wait
91+ dh_installinit --name portmap -- start 43 S 2 3 4 5 . start 32 0 6 . stop 81 1 .
92 dh_installcron
93 dh_installman
94 dh_installinfo

Subscribers

People subscribed via source and target branches

to all changes: