Merge lp:~serge-hallyn/ubuntu/precise/pulseaudio/pa-upstart into lp:ubuntu/precise/pulseaudio

Proposed by Serge Hallyn
Status: Work in progress
Proposed branch: lp:~serge-hallyn/ubuntu/precise/pulseaudio/pa-upstart
Merge into: lp:ubuntu/precise/pulseaudio
Diff against target: 57 lines (+45/-0)
2 files modified
debian/changelog (+7/-0)
debian/pulseaudio.upstart (+38/-0)
To merge this branch: bzr merge lp:~serge-hallyn/ubuntu/precise/pulseaudio/pa-upstart
Reviewer Review Type Date Requested Status
Clint Byrum (community) Needs Fixing
Chris Halse Rogers Needs Information
Ubuntu branches Pending
Review via email: mp+95664@code.launchpad.net

Description of the change

To post a comment you must log in.
Revision history for this message
Chris Halse Rogers (raof) wrote :

Is this change fixing a bug? We're quite a while past Feature Freeze, and unless it's likely to fix a bug, converting to an upstart job doesn't seem to be a valuable upload at this point in time.

If not, we could defer this to Q. Apart from the timing, it looks right.

review: Needs Information
Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

Thanks. I don't think it's urgent, it was simply a continuation of https://code.launchpad.net/~pali/ubuntu/precise/pulseaudio/pulseaudio. The original author did not mention any bugs this fixes. Waiting until Q should be fine.

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

Other feedback:

* This should probably use /run, not /var/run. I believe once we are in Q we should be able to do so without a versioned depends on sysvinit.

* mkdir, chown, chmod, can all be supplanted by install:

install -d -m755 -o pulse -g -pulse /run/pulse

Its part of coreutils and will always be available in runlevel 2.

* start on started udev and runlevel [2345] is wrong

as pulseaudio will be stopped, but not started again on a move from runlevel 1 to 2.

I recommend instead just using start on runlevel [2345], and then to make sure there is no race with udev (which starts so early, its pretty unlikely anyway), use wait-for-state in the pre-start:

start wait-for-state WAIT_FOR=udev WAITER=pulseaudio

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

> This should probably use /run, not /var/run.

/run requires a versioned dependency on initscripts, and is not worth doing for this cycle for anything that doesn't have to start in early boot.

> I recommend instead just using start on runlevel [2345], and then to
> make sure there is no race with udev (which starts so early, its
> pretty unlikely anyway)

There's no race here; we don't enter runlevel 2 until the network has had a chance to come up, and that doesn't happen until udev triggers it.

Unmerged revisions

169. By Serge Hallyn

[ Pali Rohár ]
Convert System V pulseaudio init script to upstart

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 2012-02-29 11:03:32 +0000
3+++ debian/changelog 2012-03-02 20:31:18 +0000
4@@ -1,3 +1,10 @@
5+pulseaudio (1:1.1-0ubuntu12) precise; urgency=low
6+
7+ [ Pali Rohár ]
8+ * Convert System V pulseaudio init script to upstart
9+
10+ -- Serge Hallyn <serge.hallyn@ubuntu.com> Fri, 02 Mar 2012 14:27:29 -0600
11+
12 pulseaudio (1:1.1-0ubuntu11) precise; urgency=low
13
14 * Cherry-pick a few crash-related patches from upstream git
15
16=== added file 'debian/pulseaudio.upstart'
17--- debian/pulseaudio.upstart 1970-01-01 00:00:00 +0000
18+++ debian/pulseaudio.upstart 2012-03-02 20:31:18 +0000
19@@ -0,0 +1,38 @@
20+# System PulseAudio service
21+
22+description "System PulseAudio sound server"
23+author "Pali Rohár <pali.rohar@gmail.com>"
24+
25+start on (started udev and runlevel [2345])
26+stop on runlevel [016]
27+
28+expect daemon
29+respawn
30+
31+env PULSEAUDIO_SYSTEM_START=0
32+env DISALLOW_MODULE_LOADING=1
33+env PULSEAUDIO_ARGS=
34+
35+pre-start script
36+ [ -r /etc/default/pulseaudio ] && . /etc/default/pulseaudio
37+ [ "$PULSEAUDIO_SYSTEM_START" != "1" ] && { stop; exit 0; }
38+ mkdir -p /var/run/pulse
39+ chown pulse:pulse /var/run/pulse
40+ chmod 755 /var/run/pulse
41+end script
42+
43+script
44+ [ -r /etc/default/pulseaudio ] && . /etc/default/pulseaudio
45+ exec /usr/bin/pulseaudio --system --daemonize --high-priority --log-target=syslog --disallow-exit --disallow-module-loading=$DISALLOW_MODULE_LOADING $PULSEAUDIO_ARGS
46+end script
47+
48+post-start script
49+ if [ -e /var/run/pulse/.esd_auth ]; then
50+ chown pulse:pulse-access /var/run/pulse/.esd_auth
51+ chmod 640 /var/run/pulse/.esd_auth
52+ fi
53+ if [ -e /var/run/pulse/.pulse-cookie ]; then
54+ chown pulse:pulse-access /var/run/pulse/.pulse-cookie
55+ chmod 640 /var/run/pulse/.pulse-cookie
56+ fi
57+end script

Subscribers

People subscribed via source and target branches

to all changes: