xref: /OK3568_Linux_fs/buildroot/package/weston/S49weston (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1#!/bin/sh -e
2### BEGIN INIT INFO
3# Provides:          weston
4# Required-Start:    mountvirtfs
5# Required-Stop:
6# Should-Start:
7# Should-Stop:
8# Default-Start:     2 3 4 5
9# Default-Stop:      0 1 6
10# Short-Description: Linux weston daemon
11### END INIT INFO
12
13PATH="/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin"
14
15# Load default env variables from profiles(e.g. /etc/profile.d/weston.sh)
16. /etc/profile
17
18start_weston()
19{
20	/usr/bin/weston&
21}
22
23stop_weston()
24{
25	killall weston
26}
27
28case "$1" in
29	start)
30		echo -n "starting weston... "
31		start_weston
32		echo "done."
33		;;
34	stop)
35		echo -n "stoping weston... "
36		stop_weston || true
37		echo "done."
38		;;
39	restart|reload)
40		echo -n "stoping weston... "
41		stop_weston && sleep .3
42		echo "done."
43
44		echo -n "starting weston... "
45		start_weston
46		echo "done."
47		;;
48	*)
49		echo "Usage: $0 {start|stop|restart}"
50		exit 1
51esac
52
53exit 0
54