blob: 0589c765ac7981ac76da1f049657ad65681301bd [file] [log] [blame]
Andrew Geissler7e0e3c02022-02-25 20:34:39 +00001#!/bin/sh
2#
3### BEGIN INIT INFO
4# Provides: seatd
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
11killproc() {
12 pid=`/bin/pidof $1`
13 [ "$pid" != "" ] && kill $pid
14}
15
16case "$1" in
17 start)
18 seatd -g video -n 1 > /tmp/seatd-start-notify &
19 [ -s /tmp/seatd-start-notify ] && exit 0
20 sleep 0.1
21 [ -s /tmp/seatd-start-notify ] && exit 0
22 sleep 0.5
23 [ -s /tmp/seatd-start-notify ] && exit 0
24 sleep 5
25 [ -s /tmp/seatd-start-notify ] && exit 0
26 exit 1
27 ;;
28
29 stop)
30 echo "Stopping seatd"
31 killproc seatd
32 ;;
33
34 restart)
35 $0 stop
36 sleep 1
37 $0 start
38 ;;
39
40 *)
41 echo "usage: $0 { start | stop | restart }"
42 ;;
43esac
44
45exit 0