1 # --- T2-COPYRIGHT-NOTE-BEGIN ---
2 # T2 SDE: package/*/runit/rocknet_runit.sh
3 # Copyright (C) 2004 - 2022 The T2 SDE Project
5 # This Copyright note is generated by scripts/Create-CopyPatch,
6 # more information can be found in the files COPYING and README.
8 # This program is free software; you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License version 2.
10 # --- T2-COPYRIGHT-NOTE-END ---
11 export CANUSESERVICE
=1
14 local service_name
=$1 runstring
="$2" finishstring
="$3"
16 mkdir
-p $rocknet_tmp_base/$service_name/log
19 cat <<-EOT > $rocknet_tmp_base/$service_name/run
27 cat <<-EOT > $rocknet_tmp_base/$service_name/log/run
31 if [ ! -d /var/log/$service_name ]; then
32 mkdir -p /var/log/$service_name
33 chown log /var/log/$service_name
35 exec chpst -ulog svlogd -tt /var/log/$service_name
39 if [ "$finishstring" ]; then
40 cat <<-EOT > $rocknet_tmp_base/$service_name/finish
46 chmod +x
$rocknet_tmp_base/$service_name/finish
49 chmod +x
$rocknet_tmp_base/$service_name/{,log
/}run
50 ln -nfs $rocknet_tmp_base/$service_name/ /service
/$service_name
54 local service_name
=$1 x
=
57 if [ -d /service
/$service_name/$x/supervise
]; then
58 runsvctrl d
/service
/$service_name/$x
59 svwaitdown
/service
/$service_name/$x
63 rm -f /service
/$service_name
64 rm -rf $rocknet_tmp_base/$service_name/