tools.freebsd
2023-09-18
Child:1dff2f4f424b
tools.freebsd/appdaemon.sh
..init
1 #!/bin/sh
2 #
3 # $devel.a0fs.net: appdaemon - 0.5 awgur$
4 # $FreeBSD: head/www/uwsgi/files/uwsgi.in 340872 2014-01-24 00:14:07Z mat $
5 #
6 # PROVIDE: appdaemon
7 # REQUIRE: DAEMON
8 # KEYWORD: shutdown
9 #
10 # Add the following lines to /etc/rc.conf to enable appdaemon:
11 #
12 # appdaemon_enable (bool): Set it to "YES" to enable appdaemon
13 # Default is "NO".
14 # appdaemon_piddir (path): Directory with pid files of apps
15 # Default "/var/run/appdaemon"
16 # appdaemon_pidfile (path): Set the path to the supervisor pid file
17 # Default is /var/run/appdaemon/${appName}.pid.
18 # appdaemon_app_pidfile (path): Set the path to the app pid file
19 # Default is /var/run/appdaemon/${appName}.app.pid.
20 # appdaemon_user (str): Set the UID of the process to run with
21 # Default is nobody.
22 # appdaemon_app (path): Application binnary.
23 # Default is ""
24 # appdaemon_chdir (path): Work directory of application
25 # Default is "/tmp"
26 # appdaemon_app_flags (str): Flags needed by binary
27 # Default is ""
28 # appdaemon_self (str): Binary of daemon program
29 # Default is "/usr/sbin/daemon"
30 # appdaemon_syslog_ident (srt): Log all output to syslog with this identity.
31 # Default is ""
32 # appdaemon_flags (str): Flags of daemon(8) command
33 # Default is "-fr"
34 #
35 # If you would like to have multiple instances running, you can
36 # define multiple profiles:
37 #
38 # appdaemon_profiles (str): Set the list of profiles
39 # Default is "".
40 #
41 # For each profile you can then define different options (except for
42 # appdaemon_enable) using the syntax appdaemon_<profile>_<option>
44 . /etc/rc.subr
79 }
83 }
96 }
100 fi
117 eval appdaemon_app_pidfile=\${appdaemon_${_profile}_app_pidfile:-"${appdaemon_piddir}/${_profile}.app.pid"}
124 eval appdaemon_syslog_ident=\"\${appdaemon_${_profile}_syslog_ident:-"${appdaemon_syslog_ident}"}\"
134 fi
147 }
160 }
177 }
180 command_args="-r ${appdaemon_flags} -P ${appdaemon_pidfile} -p ${appdaemon_app_pidfile} -u ${appdaemon_user} ${appdaemon_app} ${appdaemon_app_flags}"
184 fi