~upstart-devel/upstart/upstart-jobs

« back to all changes in this revision

Viewing changes to vivid/etc/init.d/xenomai

  • Committer: Dimitri John Ledkov
  • Date: 2014-11-19 12:58:41 UTC
  • Revision ID: dimitri.j.ledkov@intel.com-20141119125841-98dr37roy8dvcv3b
auto update

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh -e
 
2
### BEGIN INIT INFO
 
3
# Provides:          xenomai
 
4
# Required-Start:    mountkernfs
 
5
# Required-Stop:
 
6
# Default-Start:     2 3 4 5
 
7
# Default-Stop:      0 1 6
 
8
# Short-Description: Set xeno_nucleus group
 
9
### END INIT INFO
 
10
 
 
11
GROUP=xenomai
 
12
INITNAME=/etc/init.d/xenomai
 
13
FILENAME=/sys/module/xeno_nucleus/parameters/xenomai_gid
 
14
GID=$(getent group $GROUP | cut -d: -f3)
 
15
 
 
16
test -e $FILENAME || exit 0
 
17
test -n "$GID" || exit 0
 
18
 
 
19
case "$1" in
 
20
  start)
 
21
        echo "$GID" > $FILENAME
 
22
        ;;
 
23
  stop)
 
24
        echo "-1" > $FILENAME
 
25
        ;;
 
26
  restart|force-reload)
 
27
        $0 start
 
28
        ;;
 
29
  *)
 
30
        echo "Usage: $INITNAME {start|stop|restart|force-reload}"
 
31
        exit 1
 
32
        ;;
 
33
esac
 
34
 
 
35
exit 0
 
36