Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | # |
| 3 | ### BEGIN INIT INFO |
| 4 | # Provides: weston |
| 5 | # Required-Start: $local_fs $remote_fs |
| 6 | # Required-Stop: $local_fs $remote_fs |
| 7 | # Default-Start: 2 3 4 5 |
| 8 | # Default-Stop: 0 1 6 |
| 9 | ### END INIT INFO |
| 10 | |
| 11 | if test -e /etc/default/weston ; then |
| 12 | . /etc/default/weston |
| 13 | fi |
| 14 | |
| 15 | killproc() { |
| 16 | pid=`/bin/pidof $1` |
| 17 | [ "$pid" != "" ] && kill $pid |
| 18 | } |
| 19 | |
| 20 | read CMDLINE < /proc/cmdline |
| 21 | for x in $CMDLINE; do |
| 22 | case $x in |
| 23 | weston=false) |
| 24 | echo "Weston disabled" |
| 25 | exit 0; |
| 26 | ;; |
| 27 | esac |
| 28 | done |
| 29 | |
| 30 | case "$1" in |
| 31 | start) |
| 32 | . /etc/profile |
Andrew Geissler | 95ac1b8 | 2021-03-31 14:34:31 -0500 | [diff] [blame] | 33 | export HOME=ROOTHOME |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 34 | |
Andrew Geissler | 7e0e3c0 | 2022-02-25 20:34:39 +0000 | [diff] [blame] | 35 | WESTON_USER=weston weston-start $OPTARGS & |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 36 | ;; |
| 37 | |
| 38 | stop) |
| 39 | echo "Stopping Weston" |
| 40 | killproc weston |
| 41 | ;; |
| 42 | |
| 43 | restart) |
| 44 | $0 stop |
| 45 | sleep 1 |
| 46 | $0 start |
| 47 | ;; |
| 48 | |
| 49 | *) |
| 50 | echo "usage: $0 { start | stop | restart }" |
| 51 | ;; |
| 52 | esac |
| 53 | |
| 54 | exit 0 |