Initial version of pulseaudio module.
This commit is contained in:
parent
b703dd7edc
commit
d0fb0fb0a8
5 changed files with 145 additions and 0 deletions
73
pulseaudio/files/pulseaudio.init
Executable file
73
pulseaudio/files/pulseaudio.init
Executable file
|
@ -0,0 +1,73 @@
|
|||
#!/bin/bash
|
||||
#
|
||||
# pulseaudio: Starts the pulseaudio system wide daemon.
|
||||
#
|
||||
# chkconfig: - 95 05
|
||||
# description: This is a daemon which handles passwd and group lookups \
|
||||
# for running programs and cache the results for the next \
|
||||
# query. You should start this daemon if you use \
|
||||
# slow naming services like NIS, NIS+, LDAP, or hesiod.
|
||||
# processname: /usr/bin/pulseaudio
|
||||
#
|
||||
|
||||
# Source function library.
|
||||
. /etc/init.d/functions
|
||||
|
||||
if [ -f /etc/sysconfig/pulseaudio ] ; then
|
||||
. /etc/sysconfig/pulseaudio
|
||||
fi
|
||||
|
||||
RETVAL=0
|
||||
prog=pulseaudio
|
||||
|
||||
start() {
|
||||
echo -n $"Starting $prog: "
|
||||
daemon pulseaudio --system --use-pid-file -n -F /etc/pulse/system.pa -D ${PULSEAUDIO_OPTIONS}
|
||||
RETVAL=$?
|
||||
echo
|
||||
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/pulseaudio
|
||||
return $RETVAL
|
||||
}
|
||||
|
||||
stop() {
|
||||
echo -n $"Stopping $prog: "
|
||||
killproc pulseaudio
|
||||
RETVAL=$?
|
||||
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/pulseaudio
|
||||
echo
|
||||
return $RETVAL
|
||||
}
|
||||
|
||||
restart() {
|
||||
stop
|
||||
start
|
||||
}
|
||||
|
||||
# See how we were called.
|
||||
case "$1" in
|
||||
start)
|
||||
start
|
||||
RETVAL=$?
|
||||
;;
|
||||
stop)
|
||||
stop
|
||||
RETVAL=$?
|
||||
;;
|
||||
status)
|
||||
status pulseaudio
|
||||
RETVAL=$?
|
||||
;;
|
||||
restart)
|
||||
restart
|
||||
RETVAL=$?
|
||||
;;
|
||||
try-restart | condrestart)
|
||||
[ -e /var/lock/subsys/pulseaudio ] && restart
|
||||
RETVAL=$?
|
||||
;;
|
||||
*)
|
||||
echo $"Usage: $0 {start|stop|status|restart|condrestart}"
|
||||
RETVAL=1
|
||||
;;
|
||||
esac
|
||||
exit $RETVAL
|
1
pulseaudio/files/pulseaudio.sysconfig.CentOS
Normal file
1
pulseaudio/files/pulseaudio.sysconfig.CentOS
Normal file
|
@ -0,0 +1 @@
|
|||
PULSEAUDIO_OPTIONS="--disable-shm"
|
1
pulseaudio/files/pulseaudio.sysconfig.Fedora
Normal file
1
pulseaudio/files/pulseaudio.sysconfig.Fedora
Normal file
|
@ -0,0 +1 @@
|
|||
PULSEAUDIO_OPTIONS="--disable-shm --disallow-module-loading --disallow-exit --exit-idle-time=-1"
|
7
pulseaudio/files/system.pa
Normal file
7
pulseaudio/files/system.pa
Normal file
|
@ -0,0 +1,7 @@
|
|||
|
||||
.include /etc/pulse/default.pa
|
||||
|
||||
load-module module-native-protocol-tcp
|
||||
load-module module-zeroconf-publish
|
||||
|
||||
load-module module-cli
|
63
pulseaudio/manifests/init.pp
Normal file
63
pulseaudio/manifests/init.pp
Normal file
|
@ -0,0 +1,63 @@
|
|||
|
||||
# Install common pulseaudio components
|
||||
#
|
||||
class pulseaudio::common {
|
||||
|
||||
package { [ "pulseaudio", "pulseaudio-module-zeroconf" ]:
|
||||
ensure => installed,
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
# Install system wide pulseaudio daemon.
|
||||
#
|
||||
# Before using, please see some warnings in:
|
||||
#
|
||||
# http://pulseaudio.org/wiki/WhatIsWrongWithSystemMode
|
||||
#
|
||||
class pulseaudio::server inherits pulseaudio::common {
|
||||
|
||||
file { "/etc/init.d/pulseaudio":
|
||||
ensure => present,
|
||||
source => "puppet:///pulseaudio/pulseaudio.init",
|
||||
mode => 0755,
|
||||
owner => root,
|
||||
group => root,
|
||||
}
|
||||
file { "/etc/sysconfig/pulseaudio":
|
||||
ensure => present,
|
||||
source => "puppet:///pulseaudio/pulseaudio.sysconfig.${operatingsystem}",
|
||||
mode => 0644,
|
||||
owner => root,
|
||||
group => root,
|
||||
before => File["/etc/init.d/pulseaudio"],
|
||||
notify => Service["pulseaudio"],
|
||||
}
|
||||
|
||||
file { "/etc/pulse/system.pa":
|
||||
ensure => present,
|
||||
source => [ "puppet:///files/pulseaudio/system.pa.${fqdn}",
|
||||
"puppet:///files/pulseaudio/system.pa", ],
|
||||
mode => 0644,
|
||||
owner => root,
|
||||
group => root,
|
||||
require => Package["pulseaudio"],
|
||||
notify => Service["pulseaudio"],
|
||||
}
|
||||
|
||||
service { "pulseaudio":
|
||||
ensure => running,
|
||||
enable => true,
|
||||
require => [ Package["pulseaudio"],
|
||||
File["/etc/init.d/pulseaudio"], ],
|
||||
}
|
||||
|
||||
user { "pulse":
|
||||
groups => [ "audio", ],
|
||||
home => "/var/run/pulse",
|
||||
require => Package["pulseaudio"],
|
||||
before => Service["pulseaudio"],
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Reference in a new issue