]> mop.ddnsfree.com - git repositories - brisk.git/commitdiff
the init script could not start the daemon
authorMatteo Nastasi <nastasi@alternativeoutput.it>
Sun, 13 Sep 2026 10:39:48 +0000 (12:39 +0200)
committerMatteo Nastasi <nastasi@alternativeoutput.it>
Sun, 13 Sep 2026 10:39:48 +0000 (12:39 +0200)
"su - www-data" answers "This account is currently not available": the system
user that runs the daemon has /usr/sbin/nologin as its shell, and that is the
case for www-data on debian. The init script used it in both start branches,
start and devstart, so the service did not start at all.

"-s /bin/bash" is passed to the two su. It is the bare minimum: giving the
system user a real shell would be the wrong fix.

Checked in the debian 13 container: installed with "INSTALL.sh system",
enabled with systemctl (systemd accepts LSB scripts through
systemd-sysv-install), and after a restart of the container the daemon, nginx
and postgresql come back up by themselves, with the site answering on 80 and
443.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014M1jiEq9cHdE5SE5j6vFuE

bin/brisk-init.sh

index f816cb4abdfccca6ffc8dad70c4924425137f1cb..e95805793d523029198a843f701d5b0fae8fbfdf 100755 (executable)
@@ -13,6 +13,10 @@ PPATH="xx/home/nastasi/brisk-priv"
 # screen suffix
 SSUFF="xxbrisk"
 BUSER="xxwww-data"
+# NOTE: the two "su" below pass "-s /bin/bash". The system user that runs the
+# daemon usually has /usr/sbin/nologin as its shell (that is the case for
+# www-data on debian), and without this "su - www-data" answers "This account
+# is currently not available" and the daemon does not start.
 # seconds to wait exit of the process
 WAITLOOP_MAX=5
 
@@ -48,11 +52,11 @@ case "$1" in
         ;;
 
     devstart)
-        su - ${BUSER} -c 'cd '"$BPATH"'/spush ; ./brisk-spush.php'
+        su -s /bin/bash - ${BUSER} -c 'cd '"$BPATH"'/spush ; ./brisk-spush.php'
         ;;
 
     start)
-        su - ${BUSER} -c 'cd '"$BPATH"'/spush ; screen -d -m -S '"${SSUFF}"' bash -c '"'"'while [ 1 ]; do cd . ; ./brisk-spush.php \| grep "IN LOOP" ; if [ $? -eq 0 ]; then break ; fi ; done'"'"
+        su -s /bin/bash - ${BUSER} -c 'cd '"$BPATH"'/spush ; screen -d -m -S '"${SSUFF}"' bash -c '"'"'while [ 1 ]; do cd . ; ./brisk-spush.php \| grep "IN LOOP" ; if [ $? -eq 0 ]; then break ; fi ; done'"'"
         ;;
     restart)
         $0 stop