Changeset View
Changeset View
Standalone View
Standalone View
www/tt-rss/files/ttrssd.in
| Show All 11 Lines | |||||
| name="ttrssd" | name="ttrssd" | ||||
| rcvar=ttrssd_enable | rcvar=ttrssd_enable | ||||
| : ${ttrssd_svcj_options:="net_basic"} | : ${ttrssd_svcj_options:="net_basic"} | ||||
| # read settings, set default values | # read settings, set default values | ||||
| load_rc_config "${name}" | load_rc_config "${name}" | ||||
| : ${ttrssd_enable="NO"} | : ${ttrssd_enable=NO} | ||||
| : ${ttrssd_user="$name"} | |||||
| : ${ttrssd_group="$name"} | |||||
| long_name="Tiny Tiny RSS updating feeds daemon." | long_name="Tiny Tiny RSS updating feeds daemon." | ||||
| required_files="%%WWWDIR%%/config.php" | required_files="%%WWWDIR%%/config.php" | ||||
| pidfile="/var/run/${name}.pid" | pidfile="/var/run/${name}/${name}.pid" | ||||
| cpidfile="/var/run/${name}_child.pid" | cpidfile="/var/run/${name}/${name}_child.pid" | ||||
| phpcli="%%LOCALBASE%%/bin/php" | phpcli="%%LOCALBASE%%/bin/php" | ||||
| initdb_php="%%WWWDIR%%/update.php" | initdb_php="%%WWWDIR%%/update.php" | ||||
| phpupd="%%WWWDIR%%/update_daemon2.php" | phpupd="%%WWWDIR%%/update_daemon2.php" | ||||
| ttrssd_log="/var/log/${name}.log" | ttrssd_log="/var/log/${name}/${name}.log" | ||||
| ttrssd_cmd="%%WWWDIR%%/start.sh" | |||||
| ttrssd_umask="0003" | |||||
| command="/usr/sbin/daemon" | command="/usr/sbin/daemon" | ||||
| command_args="-rR 10 -H -u %%WWWOWN%% \ | command_args="-rR 10 -H -P $pidfile -p $cpidfile \ | ||||
| -P $pidfile -p $cpidfile \ | -o $ttrssd_log $ttrssd_cmd" | ||||
| -o $ttrssd_log sh -c \ | |||||
| '$initdb_php --update-schema=force-yes; \ | start_precmd="${name}_start_precmd" | ||||
| $phpupd;'" | |||||
| ttrssd_start_precmd() | |||||
| { | |||||
| # daemon defaults to 0600 when using -o | |||||
| if [ -f "$ttrssd_log" ]; then | |||||
| if ! chown "$ttrssd_user" "$ttrssd_log"; then | |||||
| echo "Setting ${ttrssd_log} owner failed" | |||||
| exit 1 | |||||
| fi | |||||
| fi | |||||
| } | |||||
| run_rc_command "$1" | run_rc_command "$1" | ||||