Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F142690898
D45618.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
6 KB
Referenced Files
None
Subscribers
None
D45618.diff
View Options
diff --git a/UPDATING b/UPDATING
--- a/UPDATING
+++ b/UPDATING
@@ -5,6 +5,14 @@
You should get into the habit of checking this file for changes each time
you update your ports collection, before attempting any port upgrades.
+20240907:
+ 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.
+
20240829:
AFFECTS: devel/binutils
AUTHOR: cy@FreeBSD.org
diff --git a/www/tt-rss/Makefile b/www/tt-rss/Makefile
--- a/www/tt-rss/Makefile
+++ b/www/tt-rss/Makefile
@@ -1,6 +1,6 @@
PORTNAME= tt-rss
PORTVERSION= g20240421
-PORTREVISION= 2
+PORTREVISION= 3
PORTEPOCH= 2
CATEGORIES= www
PKGNAMESUFFIX= ${PHP_PKGNAMESUFFIX}
@@ -37,7 +37,7 @@
# pgsql: php-pgsql php-pdo_pgsql
#
# from Mk/Uses/php.mk create sub vars for mysqli/pdo_mysql pgsql/pdo_pgsql values
-SUB_FILES= config.php httpd-tt-rss.conf pkg-message ttrss_db_check.php
+SUB_FILES= config.php httpd-tt-rss.conf pkg-message
SUB_LIST= MYSQL_DEPS="${mysqli_DEPENDS:T} ${pdo_mysql_DEPENDS:T}" \
PGSQL_DEPS="${pgsql_DEPENDS:T} ${pdo_pgsql_DEPENDS:T}" \
WWWOWN=${WWWOWN}
@@ -68,8 +68,6 @@
${RM} ${STAGEDIR}${WWWDIR}/config.php-dist
${INSTALL_DATA} ${WRKDIR}/config.php \
${STAGEDIR}${WWWDIR}/config.php.sample
- ${INSTALL_DATA} ${WRKDIR}/ttrss_db_check.php \
- ${STAGEDIR}${WWWDIR}/ttrss_db_check.php
${INSTALL_DATA} ${FILESDIR}/newsyslog.sample \
${STAGEDIR}${EXAMPLESDIR}
diff --git a/www/tt-rss/distinfo b/www/tt-rss/distinfo
--- a/www/tt-rss/distinfo
+++ b/www/tt-rss/distinfo
@@ -1,3 +1,3 @@
-TIMESTAMP = 1713836306
+TIMESTAMP = 1721519279
SHA256 (tt-rss-tt-rss-d832907125a7711397da8ade5cfb51082d802542_GL0.tar.gz) = 21754aa85eaa4a5de1aba6e076f26ca3c356a4d6e70ae7e1d9e6ea6d12de1d65
SIZE (tt-rss-tt-rss-d832907125a7711397da8ade5cfb51082d802542_GL0.tar.gz) = 8995458
diff --git a/www/tt-rss/files/ttrss_db_check.php.in b/www/tt-rss/files/ttrss_db_check.php.in
deleted file mode 100644
--- a/www/tt-rss/files/ttrss_db_check.php.in
+++ /dev/null
@@ -1,8 +0,0 @@
-<?php
-chdir("%%WWWDIR%%");
-
-require_once "%%WWWDIR%%/classes/Config.php";
-require_once "%%WWWDIR%%/include/autoload.php";
-
-print(strtolower(Config::get(Config::DB_TYPE)));
-?>
diff --git a/www/tt-rss/files/ttrssd.in b/www/tt-rss/files/ttrssd.in
--- a/www/tt-rss/files/ttrssd.in
+++ b/www/tt-rss/files/ttrssd.in
@@ -1,16 +1,12 @@
#! /bin/sh
# PROVIDE: ttrssd
-# REQUIRE: LOGIN mysql postgresql
+# REQUIRE: LOGIN
# KEYWORD: shutdown
# Add the following lines to /etc/rc.conf to enable `ttrssd':
#
# ttrssd_enable="YES"
-#
-# ttrssd_local_db (bool): Set to "YES" by default.
-# Set it to "NO" if the database is on another
-# server.
. /etc/rc.subr
@@ -22,85 +18,52 @@
# read settings, set default values
load_rc_config "${name}"
: ${ttrssd_enable="NO"}
-: ${ttrssd_local_db:="YES"}
-initdb_php="%%WWWDIR%%/update.php"
-dbcheck_php="%%WWWDIR%%/ttrss_db_check.php"
+long_name="Tiny Tiny RSS updating feeds daemon."
required_files="%%WWWDIR%%/config.php"
pidfile="/var/run/${name}.pid"
-ppidfile="/var/run/${name}_parent.pid"
+cpidfile="/var/run/${name}_child.pid"
phpcli="%%LOCALBASE%%/bin/php"
-command_interpreter=$phpcli
-long_name="Tiny Tiny RSS updating feeds daemon."
+
+initdb_php="%%WWWDIR%%/update.php"
phpupd="%%WWWDIR%%/update_daemon2.php"
ttrssd_log="/var/log/${name}.log"
-ttrssd_user="%%WWWOWN%%"
-start_precmd=${name}_prestart
-start_cmd=${name}_start
-stop_cmd=${name}_stop
+command="/usr/sbin/daemon"
+command_args="-rR 10 -H -u %%WWWOWN%% \
+ -P $pidfile -p $cpidfile \
+ -o $ttrssd_log sh -c \
+ '$initdb_php --update-schema=force-yes; \
+ $phpupd;'"
-MYSQL_CHECK_CMD="%%LOCALBASE%%/bin/mysqladmin -u mysqld ping"
-MYSQL_CHECK_MSG="${name}: mysqladmin command failed; mysql not ready?"
-PGSQL_CHECK_CMD="%%LOCALBASE%%/bin/pg_isready"
-PGSQL_CHECK_MSG="${name}: postgresql status failed; postgresql not ready?"
+stop_cmd="${name}_stop"
-ttrssd_start() {
- if ! [ -x $phpcli ]; then
- echo "$phpcli not found"
- exit 1
- fi
+# 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"
- if [ -f $pidfile ]; then
- echo "$name already running?"
- exit 2
- fi
+ pid_daemon=$(check_pidfile ${pidfile} ${command})
+ pid_child=$(check_pidfile ${cpidfile} ${phpcli})
- echo "Starting $long_name"
- daemon -H -P "$ppidfile" -p "$pidfile" \
- -u "$ttrssd_user" -o "$ttrssd_log" \
- sh -c "${initdb_php} --update-schema=force-yes; $phpupd"
-}
+ if [ -n "$pid_daemon" ]; then
+ echo "Stopping ${name}."
-ttrssd_stop() {
- if ! [ -f $pidfile ]; then
- echo "$name not running?"
- exit 1
- fi
+ if [ -z "${pid_child}" ]; then
+ signal="INT"
+ fi
- echo "Stopping $long_name"
- pkill -CHLD -F "$pidfile"
- pkill -F "$pidfile"
- pwait "$(cat $ppidfile)"
-}
+ kill -"$signal" "${pid_daemon}"
-ttrssd_prestart() {
- if checkyesno ttrssd_local_db; then
- # Wait for the local database to be started
-
- database="$("$phpcli" -f "$dbcheck_php")"
-
- case "$database" in
- "mysql")
- CHECK_CMD="$MYSQL_CHECK_CMD"
- CHECK_MSG="$MYSQL_CHECK_MSG"
- ;;
- "pgsql")
- CHECK_CMD="$PGSQL_CHECK_CMD"
- CHECK_MSG="$PGSQL_CHECK_MSG"
- ;;
- *)
- err 1 "Unknown database configured: $database"
- ;;
- esac
-
- for n in $(seq 1 10); do
- if $CHECK_CMD > /dev/null 2>&1; then
- return
- fi
- sleep 1
- done
- err 1 $CHECK_MSG
+ 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
}
diff --git a/www/tt-rss/pkg-plist b/www/tt-rss/pkg-plist
--- a/www/tt-rss/pkg-plist
+++ b/www/tt-rss/pkg-plist
@@ -2373,7 +2373,6 @@
%%WWWDIR%%/themes/night_base.less
%%WWWDIR%%/themes/night_blue.css
%%WWWDIR%%/themes/night_blue.less
-%%WWWDIR%%/ttrss_db_check.php
%%WWWDIR%%/utils/phpstan-watcher.sh
%%WWWDIR%%/utils/phpunit-integration.sh
%%WWWDIR%%/utils/phpunit.sh
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Jan 23, 7:09 AM (13 h, 20 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
27879713
Default Alt Text
D45618.diff (6 KB)
Attached To
Mode
D45618: www/tt-rss: Simplify ttrssd rc script
Attached
Detach File
Event Timeline
Log In to Comment