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
=== modified file 'debian/pulseaudio.default'
--- debian/pulseaudio.default 2011-05-27 14:05:01 +0000
+++ debian/pulseaudio.default 2011-07-08 07:51:29 +0000
@@ -20,3 +20,5 @@
20# 0 = no, 1 = yes20# 0 = no, 1 = yes
21DISALLOW_MODULE_LOADING=121DISALLOW_MODULE_LOADING=1
2222
23# Additional pulseaudio command line arguments
24# PULSEAUDIO_ARGS="--disallow-exit=1"
2325
=== removed file 'debian/pulseaudio.init'
--- debian/pulseaudio.init 2010-03-10 18:53:51 +0000
+++ debian/pulseaudio.init 1970-01-01 00:00:00 +0000
@@ -1,83 +0,0 @@
1#!/bin/sh -e
2### BEGIN INIT INFO
3# Provides: pulseaudio esound
4# Required-Start: $remote_fs $syslog
5# Required-Stop: $remote_fs $syslog
6# Should-Start: udev NetworkManager
7# Should-Stop: udev NetworkManager
8# Default-Start: 2 3 4 5
9# Default-Stop: 1
10# Short-Description: Start the PulseAudio sound server
11# Description: System mode startup script for
12# the PulseAudio sound server.
13### END INIT INFO
14
15DAEMON=/usr/bin/pulseaudio
16PIDDIR=/var/run/pulse
17PIDFILE=$PIDDIR/pid
18DAEMONUSER=pulse
19PATH=/sbin:/bin:/usr/sbin:/usr/bin
20
21test -x $DAEMON || exit 0
22
23. /lib/lsb/init-functions
24
25PULSEAUDIO_SYSTEM_START=0
26DISALLOW_MODULE_LOADING=1
27test -f /etc/default/pulseaudio && . /etc/default/pulseaudio
28if [ "$PULSEAUDIO_SYSTEM_START" != "1" ]; then
29 log_warning_msg "PulseAudio configured for per-user sessions"
30 exit 0
31fi
32
33pulseaudio_start () {
34 log_daemon_msg "Starting system PulseAudio Daemon"
35 if [ ! -d $PIDDIR ]; then
36 mkdir -p $PIDDIR
37 chown $DAEMONUSER:$DAEMONUSER $PIDDIR
38 fi
39 start-stop-daemon -x $DAEMON -p $PIDFILE --start -- --system --daemonize --high-priority --log-target=syslog --disallow-module-loading=$DISALLOW_MODULE_LOADING
40 status=$?
41 if [ -e /var/run/pulse/.esd_auth ]; then
42 chown pulse:pulse-access /var/run/pulse/.esd_auth
43 chmod 640 /var/run/pulse/.esd_auth
44 fi
45 if [ -e /var/run/pulse/.pulse-cookie ]; then
46 chown pulse:pulse-access /var/run/pulse/.pulse-cookie
47 chmod 640 /var/run/pulse/.pulse-cookie
48 fi
49 log_end_msg ${status}
50}
51
52pulseaudio_stop () {
53 log_daemon_msg "Stopping system PulseAudio Daemon"
54 start-stop-daemon -p $PIDFILE --stop --retry 5 || echo -n "...which is not running"
55 log_end_msg $?
56}
57
58case "$1" in
59 start|stop)
60 pulseaudio_${1}
61 ;;
62 restart|reload|force-reload)
63 if [ -s $PIDFILE ] && kill -0 $(cat $PIDFILE) >/dev/null 2>&1; then
64 pulseaudio_stop
65 pulseaudio_start
66 fi
67 ;;
68 force-stop)
69 pulseaudio_stop
70 killall pulseaudio || true
71 sleep 2
72 killall -9 pulseaudio || true
73 ;;
74 status)
75 status_of_proc -p $PIDFILE "$DAEMON" "system-wide PulseAudio" && exit 0 || exit $?
76 ;;
77 *)
78 echo "Usage: /etc/init.d/pulseaudio {start|stop|force-stop|restart|reload|force-reload|status}"
79 exit 1
80 ;;
81esac
82
83exit 0
840
=== modified file 'debian/pulseaudio.install'
--- debian/pulseaudio.install 2011-05-27 14:05:01 +0000
+++ debian/pulseaudio.install 2011-07-08 07:51:29 +0000
@@ -1,3 +1,4 @@
1etc/init/pulseaudio.conf
1etc/pulse/default.pa2etc/pulse/default.pa
2etc/pulse/system.pa3etc/pulse/system.pa
3etc/pulse/daemon.conf4etc/pulse/daemon.conf
45
=== added file 'debian/pulseaudio.upstart'
--- debian/pulseaudio.upstart 1970-01-01 00:00:00 +0000
+++ debian/pulseaudio.upstart 2011-07-08 07:51:29 +0000
@@ -0,0 +1,38 @@
1# System PulseAudio service
2
3description "System PulseAudio sound server"
4author "Pali Rohár <pali.rohar@gmail.com>"
5
6start on (started udev and runlevel [2345])
7stop on runlevel [016]
8
9respawn
10
11env PULSEAUDIO_SYSTEM_START=0
12env DISALLOW_MODULE_LOADING=1
13env PULSEAUDIO_ARGS=
14
15script
16 if [ -f /etc/default/pulseaudio ]; then
17 . /etc/default/pulseaudio
18 fi
19 if [ "$PULSEAUDIO_SYSTEM_START" != "1" ]; then
20 exit 0
21 fi
22 if [ ! -d /var/run/pulse ]; then
23 mkdir -p /var/run/pulse
24 chown pulse:pulse /var/run/pulse
25 fi
26 exec /usr/bin/pulseaudio --system --high-priority --log-target=syslog --disallow-module-loading=$DISALLOW_MODULE_LOADING $PULSEAUDIO_ARGS
27end script
28
29post-start script
30 if [ -e /var/run/pulse/.esd_auth ]; then
31 chown pulse:pulse-access /var/run/pulse/.esd_auth
32 chmod 640 /var/run/pulse/.esd_auth
33 fi
34 if [ -e /var/run/pulse/.pulse-cookie ]; then
35 chown pulse:pulse-access /var/run/pulse/.pulse-cookie
36 chmod 640 /var/run/pulse/.pulse-cookie
37 fi
38end script
039
=== modified file 'debian/rules'
--- debian/rules 2011-06-24 10:18:17 +0000
+++ debian/rules 2011-07-08 07:51:29 +0000
@@ -20,6 +20,8 @@
20 cp -a $(CURDIR)/debian/overrides $(CURDIR)/debian/tmp/usr/share/lintian20 cp -a $(CURDIR)/debian/overrides $(CURDIR)/debian/tmp/usr/share/lintian
21 mkdir -p $(CURDIR)/debian/tmp/usr/share/alsa21 mkdir -p $(CURDIR)/debian/tmp/usr/share/alsa
22 cp -a $(CURDIR)/debian/*.conf $(CURDIR)/debian/tmp/usr/share/alsa22 cp -a $(CURDIR)/debian/*.conf $(CURDIR)/debian/tmp/usr/share/alsa
23 mkdir -p $(CURDIR)/debian/tmp/etc/init
24 cp -a $(CURDIR)/debian/pulseaudio.upstart $(CURDIR)/debian/tmp/etc/init/pulseaudio.conf
23 install -D -m755 $(CURDIR)/debian/01PulseAudio $(CURDIR)/debian/tmp/usr/lib/pm-utils/sleep.d/01PulseAudio25 install -D -m755 $(CURDIR)/debian/01PulseAudio $(CURDIR)/debian/tmp/usr/lib/pm-utils/sleep.d/01PulseAudio
24 install -d $(CURDIR)/debian/tmp/usr/share/apport/package-hooks26 install -d $(CURDIR)/debian/tmp/usr/share/apport/package-hooks
25 cp $(CURDIR)/debian/apport-hook.py $(CURDIR)/debian/tmp/usr/share/apport/package-hooks/source_pulseaudio.py27 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: