Page MenuHomeFreeBSD

D45618.id139914.diff
No OneTemporary

D45618.id139914.diff

diff --git a/www/tt-rss/Makefile b/www/tt-rss/Makefile
--- a/www/tt-rss/Makefile
+++ b/www/tt-rss/Makefile
@@ -16,7 +16,7 @@
USES= gettext-tools php:cli,web,flavors shebangfix
USE_GITLAB= yes
-GL_SITE= https://gitlab.tt-rss.org
+GL_SITE= https://gitlab.tt-rss.org/tt-rss/tt-rss
GL_TAGNAME= d832907125a7711397da8ade5cfb51082d802542
# phe json/openssl extension is required but it's statically linked in default php
USE_PHP= ctype dom exif fileinfo filter iconv intl mbstring pcntl pdo \
@@ -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/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,86 +18,18 @@
# 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"
-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
-
-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?"
-
-ttrssd_start() {
- if ! [ -x $phpcli ]; then
- echo "$phpcli not found"
- exit 1
- fi
-
- if [ -f $pidfile ]; then
- echo "$name already running?"
- exit 2
- fi
-
- 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"
-}
-
-ttrssd_stop() {
- if ! [ -f $pidfile ]; then
- echo "$name not running?"
- exit 1
- fi
-
- echo "Stopping $long_name"
- pkill -CHLD -F "$pidfile"
- pkill -F "$pidfile"
- pwait "$(cat $ppidfile)"
-}
-
-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
- fi
-}
+command="/usr/sbin/daemon"
+command_args="-rR 10 -H -P $pidfile -u %%WWWOWN%% \
+ -o $ttrssd_log sh -c \
+ '$initdb_php --update-schema=force-yes; $phpupd'"
run_rc_command "$1"
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

Mime Type
text/plain
Expires
Mon, May 18, 8:47 AM (4 h, 26 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
33240542
Default Alt Text
D45618.id139914.diff (4 KB)

Event Timeline