Permalink
Browse files

add some example scripts for running rdm as a service using system v

or systemd.
  • Loading branch information...
Andersbakken committed Aug 19, 2017
1 parent d367652 commit b83c3aed9467c8213225ccbd9beb0ae678e9c3c5
Showing with 68 additions and 0 deletions.
  1. +49 −0 share/etc/init.d/rtags
  2. +11 −0 share/etc/services/system/rdm.service
  3. +8 −0 share/etc/services/system/rdm.socket
View
@@ -0,0 +1,49 @@
#!/bin/bash
#
# chkconfig: 35 90 12
# description: Foo server
#
# Get function from functions library
. /etc/init.d/functions
# Start the service FOO
start() {
initlog -c "echo -n Starting FOO server: "
/path/to/FOO &
### Create the lock file ###
touch /var/lock/subsys/FOO
success $"FOO server startup"
echo
}
# Restart the service FOO
stop() {
initlog -c "echo -n Stopping FOO server: "
killproc FOO
### Now, delete the lock file ###
rm -f /var/lock/subsys/FOO
echo
}
### main logic ###
case "$1" in
start)
start
;;
stop)
stop
;;
status)
status FOO
;;
restart|reload|condrestart)
stop
start
;;
*)
echo $"Usage: $0 {start|stop|restart|reload|status}"
exit 1
esac
exit 0
@@ -0,0 +1,11 @@
[Unit]
Description=RTags daemon
Requires=rdm.socket
[Service]
Type=simple
ExecStart=$RDM -v --inactivity-timeout 300 --log-flush
ExecStartPost=/bin/sh -c "echo +19 > /proc/$MAINPID/autogroup"
Nice=19
CPUSchedulingPolicy=idle
@@ -0,0 +1,8 @@
[Unit]
Description=RTags daemon socket
[Socket]
ListenStream=%t/rdm.socket
[Install]
WantedBy=default.target

0 comments on commit b83c3ae

Please sign in to comment.