tools.freebsd
2026-03-09
Parent:1dff2f4f424b
tools.freebsd/appdaemon.sh
* Устранение ошибок показа статуса при отказе запускаемого приложения
1 #!/bin/sh
2 # devel.a0fs.net -- appdaemon -- v1.r202603.1 #
3 # $FreeBSD: head/www/uwsgi/files/uwsgi.in 340872 2014-01-24 00:14:07Z mat $
4 #
5 # PROVIDE: appdaemon
6 # REQUIRE: DAEMON
7 # KEYWORD: shutdown
8 #
9 # Add the following lines to /etc/rc.conf to enable appdaemon:
10 #
11 # appdaemon_enable (bool): Set it to "YES" to enable appdaemon
12 # Default is "NO".
13 # appdaemon_piddir (path): Directory with pid files of apps
14 # Default "/var/run/appdaemon"
15 # appdaemon_pidfile (path): Set the path to the supervisor pid file
16 # Default is /var/run/appdaemon/${appName}.pid.
17 # appdaemon_app_pidfile (path): Set the path to the app pid file
18 # Default is /var/run/appdaemon/${appName}.app.pid.
19 # appdaemon_user (str): Set the UID of the process to run with
20 # Default is nobody.
21 # appdaemon_app (path): Application binnary.
22 # Default is ""
23 # appdaemon_chdir (path): Work directory of application
24 # Default is "/tmp"
25 # appdaemon_app_flags (str): Flags needed by binary
26 # Default is ""
27 # appdaemon_self (str): Binary of daemon program
28 # Default is "/usr/sbin/daemon"
29 # appdaemon_syslog_ident (srt): Log all output to syslog with this identity.
30 # Default is ""
31 # appdaemon_flags (str): Flags of daemon(8) command
32 # Default is "-fr"
33 #
34 # If you would like to have multiple instances running, you can
35 # define multiple profiles:
36 #
37 # appdaemon_profiles (str): Set the list of profiles
38 # Default is "".
39 #
40 # For each profile you can then define different options (except for
41 # appdaemon_enable) using the syntax appdaemon_<profile>_<option>
43 . /etc/rc.subr
78 }
82 }
95 }
99 fi
116 eval appdaemon_app_pidfile=\${appdaemon_${_profile}_app_pidfile:-"${appdaemon_piddir}/${_profile}.app.pid"}
123 eval appdaemon_syslog_ident=\"\${appdaemon_${_profile}_syslog_ident:-"${appdaemon_syslog_ident}"}\"
133 fi
146 }
159 }
176 }
179 command_args="-r ${appdaemon_flags} -P ${appdaemon_pidfile} -p ${appdaemon_app_pidfile} -u ${appdaemon_user} ${appdaemon_app} ${appdaemon_app_flags}"
183 fi