Merge lp:~pali/ubuntu/oneiric/pulseaudio/pulseaudio into lp:ubuntu/oneiric/pulseaudio

Proposed by Pali
Status: Work in progress
Proposed branch: lp:~pali/ubuntu/oneiric/pulseaudio/pulseaudio
Merge into: lp:ubuntu/oneiric/pulseaudio
Diff against target: 162 lines (+43/-83)
5 files modified
debian/pulseaudio.default (+2/-0)
debian/pulseaudio.init (+0/-83)
debian/pulseaudio.install (+1/-0)
debian/pulseaudio.upstart (+38/-0)
debian/rules (+2/-0)
To merge this branch: bzr merge lp:~pali/ubuntu/oneiric/pulseaudio/pulseaudio
Reviewer Review Type Date Requested Status
Pali (community) Needs Resubmitting
Scott Moser Needs Fixing
Ubuntu branches Pending
Review via email: mp+67286@code.launchpad.net

Description of the change

* Convert System V pulseaudio init script to upstart
* Added support for additional pulseaudio command line arguments in upstart

To post a comment you must log in.
Revision history for this message
Scott Moser (smoser) wrote :

I built your branch, but it failed to install. The issue was the way you are 'stop'ing in the upstart script.
exiting in a 'script' section will cause upstart to try to respawn the job. Eventually that will hit the respawn limit.

So, the changes I suggest are:
 * fix the issue of 'start' with a pre-start script (you can see a similar example in the libvirt-bin package).
 * you should also probably do the 'mkdir -p /var/run/pulse' in pre-start.
 * Also, if you use dh_installinit, you can actually leave the old .init file around, and do not have to modify debian/pulseaudio.install as dh_installinit will do that for you.
   - mkdir -p $(CURDIR)/debian/tmp/etc/init
   - cp -a $(CURDIR)/debian/pulseaudio.upstart $(CURDIR)/debian/tmp/etc/init/pulseaudio.conf
   + dh_installinit
 * re-add the pulseaudio.init
   bzr revert -r 143 debian/pulseaudio.init
   bzr add debian/pulseaudio.init

review: Needs Fixing
Revision history for this message
Chris Halse Rogers (raof) wrote :

I'm marking this as “In Progress” to drop it off the sponsorship queue.

Once you've addressed the review above, please set the status back to “Needs Review” and it will go back onto the sponsorship queue.

Revision history for this message
Pali (pali) wrote :

Here is new merge request:
https://code.launchpad.net/~pali/ubuntu/precise/pulseaudio/pulseaudio/+merge/92622

I tried to "resubmit proposal" button, but launchpad does not worked.

review: Needs Resubmitting
Revision history for this message
Evan Broder (broder) wrote :

Pali - currently both merge proposals are marked as "Needs Review", which causes them both to show up on the sponsorship queue. Could you please change this one back to "Work In Progress"?

(I would do it, but am blocked by bug #612391)

Revision history for this message
Pali (pali) wrote :

changed back to work in progress. maybe this merge request could be closed or marked as superseded (but I do not know how).

Unmerged revisions

145. By Pali

Added support for additional pulseaudio command line arguments in upstart

144. By Pali

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/pulseaudio.default'
2--- debian/pulseaudio.default 2011-05-27 14:05:01 +0000
3+++ debian/pulseaudio.default 2011-07-08 07:51:29 +0000
4@@ -20,3 +20,5 @@
5 # 0 = no, 1 = yes
6 DISALLOW_MODULE_LOADING=1
7
8+# Additional pulseaudio command line arguments
9+# PULSEAUDIO_ARGS="--disallow-exit=1"
10
11=== removed file 'debian/pulseaudio.init'
12--- debian/pulseaudio.init 2010-03-10 18:53:51 +0000
13+++ debian/pulseaudio.init 1970-01-01 00:00:00 +0000
14@@ -1,83 +0,0 @@
15-#!/bin/sh -e
16-### BEGIN INIT INFO
17-# Provides: pulseaudio esound
18-# Required-Start: $remote_fs $syslog
19-# Required-Stop: $remote_fs $syslog
20-# Should-Start: udev NetworkManager
21-# Should-Stop: udev NetworkManager
22-# Default-Start: 2 3 4 5
23-# Default-Stop: 1
24-# Short-Description: Start the PulseAudio sound server
25-# Description: System mode startup script for
26-# the PulseAudio sound server.
27-### END INIT INFO
28-
29-DAEMON=/usr/bin/pulseaudio
30-PIDDIR=/var/run/pulse
31-PIDFILE=$PIDDIR/pid
32-DAEMONUSER=pulse
33-PATH=/sbin:/bin:/usr/sbin:/usr/bin
34-
35-test -x $DAEMON || exit 0
36-
37-. /lib/lsb/init-functions
38-
39-PULSEAUDIO_SYSTEM_START=0
40-DISALLOW_MODULE_LOADING=1
41-test -f /etc/default/pulseaudio && . /etc/default/pulseaudio
42-if [ "$PULSEAUDIO_SYSTEM_START" != "1" ]; then
43- log_warning_msg "PulseAudio configured for per-user sessions"
44- exit 0
45-fi
46-
47-pulseaudio_start () {
48- log_daemon_msg "Starting system PulseAudio Daemon"
49- if [ ! -d $PIDDIR ]; then
50- mkdir -p $PIDDIR
51- chown $DAEMONUSER:$DAEMONUSER $PIDDIR
52- fi
53- start-stop-daemon -x $DAEMON -p $PIDFILE --start -- --system --daemonize --high-priority --log-target=syslog --disallow-module-loading=$DISALLOW_MODULE_LOADING
54- status=$?
55- if [ -e /var/run/pulse/.esd_auth ]; then
56- chown pulse:pulse-access /var/run/pulse/.esd_auth
57- chmod 640 /var/run/pulse/.esd_auth
58- fi
59- if [ -e /var/run/pulse/.pulse-cookie ]; then
60- chown pulse:pulse-access /var/run/pulse/.pulse-cookie
61- chmod 640 /var/run/pulse/.pulse-cookie
62- fi
63- log_end_msg ${status}
64-}
65-
66-pulseaudio_stop () {
67- log_daemon_msg "Stopping system PulseAudio Daemon"
68- start-stop-daemon -p $PIDFILE --stop --retry 5 || echo -n "...which is not running"
69- log_end_msg $?
70-}
71-
72-case "$1" in
73- start|stop)
74- pulseaudio_${1}
75- ;;
76- restart|reload|force-reload)
77- if [ -s $PIDFILE ] && kill -0 $(cat $PIDFILE) >/dev/null 2>&1; then
78- pulseaudio_stop
79- pulseaudio_start
80- fi
81- ;;
82- force-stop)
83- pulseaudio_stop
84- killall pulseaudio || true
85- sleep 2
86- killall -9 pulseaudio || true
87- ;;
88- status)
89- status_of_proc -p $PIDFILE "$DAEMON" "system-wide PulseAudio" && exit 0 || exit $?
90- ;;
91- *)
92- echo "Usage: /etc/init.d/pulseaudio {start|stop|force-stop|restart|reload|force-reload|status}"
93- exit 1
94- ;;
95-esac
96-
97-exit 0
98
99=== modified file 'debian/pulseaudio.install'
100--- debian/pulseaudio.install 2011-05-27 14:05:01 +0000
101+++ debian/pulseaudio.install 2011-07-08 07:51:29 +0000
102@@ -1,3 +1,4 @@
103+etc/init/pulseaudio.conf
104 etc/pulse/default.pa
105 etc/pulse/system.pa
106 etc/pulse/daemon.conf
107
108=== added file 'debian/pulseaudio.upstart'
109--- debian/pulseaudio.upstart 1970-01-01 00:00:00 +0000
110+++ debian/pulseaudio.upstart 2011-07-08 07:51:29 +0000
111@@ -0,0 +1,38 @@
112+# System PulseAudio service
113+
114+description "System PulseAudio sound server"
115+author "Pali Rohár <pali.rohar@gmail.com>"
116+
117+start on (started udev and runlevel [2345])
118+stop on runlevel [016]
119+
120+respawn
121+
122+env PULSEAUDIO_SYSTEM_START=0
123+env DISALLOW_MODULE_LOADING=1
124+env PULSEAUDIO_ARGS=
125+
126+script
127+ if [ -f /etc/default/pulseaudio ]; then
128+ . /etc/default/pulseaudio
129+ fi
130+ if [ "$PULSEAUDIO_SYSTEM_START" != "1" ]; then
131+ exit 0
132+ fi
133+ if [ ! -d /var/run/pulse ]; then
134+ mkdir -p /var/run/pulse
135+ chown pulse:pulse /var/run/pulse
136+ fi
137+ exec /usr/bin/pulseaudio --system --high-priority --log-target=syslog --disallow-module-loading=$DISALLOW_MODULE_LOADING $PULSEAUDIO_ARGS
138+end script
139+
140+post-start script
141+ if [ -e /var/run/pulse/.esd_auth ]; then
142+ chown pulse:pulse-access /var/run/pulse/.esd_auth
143+ chmod 640 /var/run/pulse/.esd_auth
144+ fi
145+ if [ -e /var/run/pulse/.pulse-cookie ]; then
146+ chown pulse:pulse-access /var/run/pulse/.pulse-cookie
147+ chmod 640 /var/run/pulse/.pulse-cookie
148+ fi
149+end script
150
151=== modified file 'debian/rules'
152--- debian/rules 2011-06-24 10:18:17 +0000
153+++ debian/rules 2011-07-08 07:51:29 +0000
154@@ -20,6 +20,8 @@
155 cp -a $(CURDIR)/debian/overrides $(CURDIR)/debian/tmp/usr/share/lintian
156 mkdir -p $(CURDIR)/debian/tmp/usr/share/alsa
157 cp -a $(CURDIR)/debian/*.conf $(CURDIR)/debian/tmp/usr/share/alsa
158+ mkdir -p $(CURDIR)/debian/tmp/etc/init
159+ cp -a $(CURDIR)/debian/pulseaudio.upstart $(CURDIR)/debian/tmp/etc/init/pulseaudio.conf
160 install -D -m755 $(CURDIR)/debian/01PulseAudio $(CURDIR)/debian/tmp/usr/lib/pm-utils/sleep.d/01PulseAudio
161 install -d $(CURDIR)/debian/tmp/usr/share/apport/package-hooks
162 cp $(CURDIR)/debian/apport-hook.py $(CURDIR)/debian/tmp/usr/share/apport/package-hooks/source_pulseaudio.py

Subscribers

People subscribed via source and target branches

to all changes: