-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy paththingsboard
More file actions
executable file
·62 lines (55 loc) · 1.27 KB
/
thingsboard
File metadata and controls
executable file
·62 lines (55 loc) · 1.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#!/bin/bash
### BEGIN INIT INFO
# Provides: thingsboard
# Required-Start: $remote_fs$syslog
# Required-Stop: $remote_fs$syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start/stop thingsboard server
# Description: Start/stop/restart the thingsboard server
### END INIT INFO
# Source function library.
. /lib/lsb/init-functions
NAME=thingsboard
DESC="thingsboard server"
PIDFILE=/var/run/thingsboard.pid
JARFILE=/usr/share/thingsboard/bin/thingsboard.jar
USER=thingsboard
start() {
echo -n "Starting $DESC: "
start-stop-daemon --start --quiet --pidfile $PIDFILE --chuid $USER --background --make-pidfile --exec $JARFILE
RETVAL=$?
echo "$NAME."
return $RETVAL
}
stop() {
echo -n "Stopping $DESC: "
start-stop-daemon --stop --quiet --pidfile $PIDFILE --retry=TERM/30/KILL/5
RETVAL=$?
echo "$NAME."
[ $RETVAL = 0 ] && rm -f$PIDFILE
return $RETVAL
}
restart() {
stop
start
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
restart
;;
status)
status_of_proc -p $PIDFILE java$DESC && exit 0 || exit $?
;;
*)
echo "Usage: $0 {start|stop|restart|status}"
exit 1
;;
esac
exit $?