FreeBSD Bugzilla – Attachment 251582 Details for
Bug 279803
www/tt-rss: Simplify ttrssd rc script
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Simplify ttrssd rc script
0001-Add-UPDATING-and-stop-if-daemon-doesn-t-have-a-child.patch (text/plain), 2.78 KB, created by
Derek Schrock
on 2024-06-19 20:01:52 UTC
(
hide
)
Description:
Simplify ttrssd rc script
Filename:
MIME Type:
Creator:
Derek Schrock
Created:
2024-06-19 20:01:52 UTC
Size:
2.78 KB
patch
obsolete
>From cedbea81f0754d74eab2d11eea0fa99c17568a6b Mon Sep 17 00:00:00 2001 >From: Derek Schrock <dereks@lifeofadishwasher.com> >Date: Wed, 19 Jun 2024 15:00:15 -0400 >Subject: [PATCH] Add UPDATING and stop if daemon doesn't have a child > >- Add UPDATING because of rc var removal ttrssd_local_db >- Add a stop to INT or TERM the parent daemon. > - If the child doesn't exist send INT to daemon. > - If the child exists TERM will propagate to the child. > - Testing has shown the parentless child will go away. >--- > UPDATING | 8 ++++++++ > www/tt-rss/files/ttrssd.in | 39 ++++++++++++++++++++++++++++++++++++-- > 2 files changed, 45 insertions(+), 2 deletions(-) > >diff --git a/UPDATING b/UPDATING >index e5c1d67e5b..51d214671b 100644 >--- a/UPDATING >+++ b/UPDATING >@@ -5,6 +5,14 @@ they are unavoidable. > You should get into the habit of checking this file for changes each time > you update your ports collection, before attempting any port upgrades. > >+20240617: >+ AFFECTS: www/tt-rss >+ AUTHOR: dereks@lifeofadishwasher.com >+ >+ The ttrssd_local_db rc var has been removed in favor of using daemon's >+ restart option -r to retry the ttrssd php scripts if database is not up >+ before ttrssd starts. >+ > 20240615: > AFFECTS: mail/cyrus-imapd25 > AUTHOR: ume@FreeBSD.org >diff --git a/www/tt-rss/files/ttrssd.in b/www/tt-rss/files/ttrssd.in >index b8712ee08e..7934b98a4a 100644 >--- a/www/tt-rss/files/ttrssd.in >+++ b/www/tt-rss/files/ttrssd.in >@@ -22,14 +22,49 @@ load_rc_config "${name}" > long_name="Tiny Tiny RSS updating feeds daemon." > required_files="%%WWWDIR%%/config.php" > pidfile="/var/run/${name}.pid" >+cpidfile="/var/run/${name}_child.pid" >+phpcli="%%LOCALBASE%%/bin/php" > > initdb_php="%%WWWDIR%%/update.php" > phpupd="%%WWWDIR%%/update_daemon2.php" > ttrssd_log="/var/log/${name}.log" > > command="/usr/sbin/daemon" >-command_args="-rR 10 -H -P $pidfile -u %%WWWOWN%% \ >+command_args="-rR 10 -H -u %%WWWOWN%% \ >+ -P $pidfile -p $cpidfile \ > -o $ttrssd_log sh -c \ >- '$initdb_php --update-schema=force-yes; $phpupd'" >+ '$initdb_php --update-schema=force-yes; \ >+ $phpupd;'" >+ >+stop_cmd="${name}_stop" >+ >+# daemon doesn't process signals if it lacks a child process. >+# See https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=277959 >+ttrssd_stop() { >+ local pid_daemon >+ local pid_child >+ local signal="TERM" >+ >+ pid_daemon=$(check_pidfile ${pidfile} ${command}) >+ pid_child=$(check_pidfile ${cpidfile} ${phpcli}) >+ >+ if [ -n "$pid_daemon" ]; then >+ echo "Stopping ${name}." >+ >+ if [ -z "${pid_child}" ]; then >+ signal="INT" >+ fi >+ >+ kill -"$signal" "${pid_daemon}" >+ >+ wait_for_pids "${pid_daemon}" "${pid_child}" >+ else >+ if [ -n "$pid_child" ]; then >+ echo "${name} not running? (check ${cpidfile})." >+ else >+ echo "${name} not running? (check ${pidfile})." >+ fi >+ fi >+} > > run_rc_command "$1" >-- >2.45.2 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
dereks
:
maintainer-approval+
Actions:
View
|
Diff
Attachments on
bug 279803
:
251515
|
251582
|
251586