diff options
author | Guillermo RodrÃguez <guille.rodriguez@gmail.com> | 2020-01-07 16:28:40 +0100 |
---|---|---|
committer | Michael Olbrich <m.olbrich@pengutronix.de> | 2020-01-23 17:08:35 +0100 |
commit | 01b9406d85062549ac66769546683f9630456bab (patch) | |
tree | 94c0e8ac4d2e870b312af8fabce6d97a62e3ea23 /projectroot | |
parent | bf31d35580c21a21d37196aa667e93d29c8c140a (diff) | |
download | ptxdist-01b9406d85062549ac66769546683f9630456bab.tar.gz ptxdist-01b9406d85062549ac66769546683f9630456bab.tar.xz |
weston: Add init script
Signed-off-by: Guillermo Rodriguez <guille.rodriguez@gmail.com>
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
Diffstat (limited to 'projectroot')
-rw-r--r-- | projectroot/etc/init.d/weston-init | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/projectroot/etc/init.d/weston-init b/projectroot/etc/init.d/weston-init new file mode 100644 index 000000000..fa6b96b07 --- /dev/null +++ b/projectroot/etc/init.d/weston-init @@ -0,0 +1,29 @@ +#!/bin/sh + +start() { + OPENVT_ARGS="-c 1 -s" + WESTON_ARGS="--log=/var/log/weston.log" + + test -f /etc/default/weston-init && . /etc/default/weston-init + + if [ -z "$XDG_RUNTIME_DIR" ]; then + export XDG_RUNTIME_DIR=/run/xdg + mkdir -p "$XDG_RUNTIME_DIR" + chmod 0700 "$XDG_RUNTIME_DIR" + fi + + echo "Starting Weston" + exec openvt $OPENVT_ARGS -- weston $WESTON_ARGS +} + +stop() { + echo "Stopping Weston" + killall -q weston +} + +case $1 in + start|stop) $1 ;; + restart) stop ; sleep 1 ; start ;; + + *) echo "Usage: $0 {start|stop|restart}"; exit 1 ;; +esac |