~ubuntu-branches/ubuntu/oneiric/oss4/oneiric-proposed

« back to all changes in this revision

Viewing changes to setup/Linux/oss/etc/S89oss

  • Committer: Bazaar Package Importer
  • Author(s): Stefano Rivera
  • Date: 2011-06-16 20:37:48 UTC
  • mfrom: (5.1.3 sid)
  • Revision ID: james.westby@ubuntu.com-20110616203748-jbrxik6ql33z54co
Tags: 4.2-build2004-1ubuntu1
* Merge from Debian unstable.
  - Supports our current kernel (LP: #746048)
  Remaining changes:
  - debian/oss4-dkms.dkms.in: s/source/build/ in Kernel headers paths.
* ld-as-needed.patch: Re-order CC arguments to enable building with ld
  --as-needed (LP: #770972)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/bash
 
2
#
 
3
#       /etc/rc.d/init.d/oss
 
4
#
 
5
# Starts the OSS sound driver
 
6
#
 
7
# chkconfig: 2345 80 20
 
8
# description: Open Sound System for Linux (OSS/Linux) is a \
 
9
# commercial quality sound driver distributed by 4Front Technologies \
 
10
# (http://www.opensound.com).
 
11
 
 
12
### BEGIN INIT INFO
 
13
# Provides: oss
 
14
# Required-Start: $local_fs $remote_fs 
 
15
# Should-Start: 
 
16
# Required-Stop:
 
17
# Default-Start: 2 3 4 5
 
18
# Default-Stop: 0 1 6
 
19
# Short-Description: Start OSS
 
20
### END INIT INFO
 
21
 
 
22
# Source function library.
 
23
if test -f /lib/lsb/init-functions
 
24
then
 
25
. /lib/lsb/init-functions
 
26
fi
 
27
 
 
28
if test -f /etc/rc.d/init.d/functions
 
29
then
 
30
. /etc/rc.d/init.d/functions
 
31
fi
 
32
 
 
33
# Add oss configuration.
 
34
. /etc/oss.conf
 
35
 
 
36
RETVAL=0
 
37
 
 
38
#
 
39
#       See how we were called.
 
40
#
 
41
case "$1" in
 
42
  start)
 
43
        # Check if OSS is already running
 
44
        echo -n 'Starting Open Sound System: '
 
45
        if ! test -f /usr/sbin/soundon
 
46
        then
 
47
                exit 0
 
48
        fi
 
49
 
 
50
        if test -f $OSSLIBDIR/starting
 
51
        then
 
52
                ls -l $OSSLIBDIR/starting
 
53
                echo Previous start of OSS crashed the system
 
54
                echo Please resolve the situation and remove file
 
55
                echo \"$OSSLIBDIR/starting\". Then start OSS by
 
56
                echo running soundon
 
57
                exit 0
 
58
        fi
 
59
 
 
60
        if ! /usr/sbin/soundon
 
61
        then
 
62
          echo Starting OSS failed
 
63
        fi
 
64
        rm -f $OSSLIBDIR/starting
 
65
        ;;
 
66
  stop)
 
67
        echo -n 'Stopping Open Sound System: '
 
68
 
 
69
        /usr/sbin/savemixer
 
70
        exit 0
 
71
        ;;
 
72
  restart)
 
73
        $0 stop
 
74
        /usr/sbin/soundoff
 
75
        $0 start
 
76
        ;;
 
77
  *)
 
78
        echo "Usage: $0 {start|stop|restart}"
 
79
        exit 1
 
80
esac