source: packages/sound/pulseaudio/files/pulseaudio.init @ 29077

Last change on this file since 29077 was 29077, checked in by nico, 5 years ago

packages/pulseaudio: run as a pulse/pulse user/group, enable deprecated oss output, use new service functions

File size: 658 bytes
Line 
1#!/bin/sh /etc/rc.common
2# Copyright (C) 2011 OpenWrt.org
3
4START=65
5
6SERVICE_USE_PID=1
7SERVICE_PID_FILE=/var/run/pulse/pid
8
9start() {
10        user_exists pulse 51 || user_add pulse 51
11        group_exists pulse 51 || group_add pulse 51
12        [ -d /var/run/pulse ] || {
13                mkdir -m 0755 -p /var/run/pulse
14                chmod 0750 /var/run/pulse
15                chown pulse:pulse /var/run/pulse
16        }
17        [ -d /var/lib/pulse ] || {
18                mkdir -m 0755 -p /var/lib/pulse
19                chmod 0750 /var/lib/pulse
20                chown pulse:pulse /var/lib/pulse
21        }
22        service_start /usr/bin/pulseaudio --daemonize --system --disallow-exit --disallow-module-loading --disable-shm --exit-idle-time=-1
23}
24
25stop() {
26        service_stop /usr/bin/pulseaudio
27}
Note: See TracBrowser for help on using the repository browser.