From cde91a86bef33e20c39ff7fd2e9c1326fd9d550b Mon Sep 17 00:00:00 2001 From: Matthias Strubel Date: Tue, 27 Sep 2016 21:49:02 +0200 Subject: [PATCH] IRC Server: Fixing startup and quoting some vars If the python IRC server is running as a daemon, it is needed, that the setuid command is used. --- CHANGELOG | 1 + piratebox/piratebox/conf/piratebox.conf | 6 ++++++ piratebox/piratebox/init.d/piratebox | 6 +++--- piratebox/piratebox/init.d/piratebox_alt | 6 +++--- 4 files changed, 13 insertions(+), 6 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 74908ef..36bbfa5 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -2,6 +2,7 @@ CHANGELOG === 1.1.1 === * [Fix] Translation en,fr LibraryBox -> PirateBox +* [Fix] IRC startup command failed. * [Removed] exchange_www.sh === 1.1.0 === diff --git a/piratebox/piratebox/conf/piratebox.conf b/piratebox/piratebox/conf/piratebox.conf index 87ac41c..aa61cc4 100644 --- a/piratebox/piratebox/conf/piratebox.conf +++ b/piratebox/piratebox/conf/piratebox.conf @@ -186,6 +186,12 @@ LIGHTTPD_GROUP=nogroup #Switch to yes if you want to enable the IRC-Server ENABLE_IRC_SERVER="no" +IRC_USER="$LIGHTTPD_USER" + +## If you want to save rooms and so on, create the folder +# /opt/piratebox/share/IRC_STATE and make sure it is writeable +# for IRC_USER (nobody per default) +#IRC_STATE_DIR="$SHARE_FOLDER/IRC_STATE" #------------------------ Hook in user-config . $PIRATEBOX_FOLDER/conf/hook_custom.conf diff --git a/piratebox/piratebox/init.d/piratebox b/piratebox/piratebox/init.d/piratebox index 1a6a217..e28e890 100755 --- a/piratebox/piratebox/init.d/piratebox +++ b/piratebox/piratebox/init.d/piratebox @@ -200,10 +200,10 @@ case "$1" in . $CONF_IRC - IRC_PARMS="--daemon --motd $IRC_MOTD " + IRC_PARMS="--setuid $IRC_USER --daemon --motd '$IRC_MOTD' " - if [ ! -z $STATEDIR ] ; then - IRC_PARMS=" $IRCPARMS --statedir $STATEDIR " + if [ ! -z "$IRC_STATEDIR" ] ; then + IRC_PARMS=" $IRCPARMS --statedir '$IRC_STATEDIR' " fi log_daemon_msg "Starting Miniircd..." diff --git a/piratebox/piratebox/init.d/piratebox_alt b/piratebox/piratebox/init.d/piratebox_alt index 520ff28..46883ca 100755 --- a/piratebox/piratebox/init.d/piratebox_alt +++ b/piratebox/piratebox/init.d/piratebox_alt @@ -192,10 +192,10 @@ case "$1" in #Start IRC Server if [ "$ENABLE_IRC_SERVER" = "yes" ] ; then . $CONF_IRC - IRC_PARMS="--daemon --motd $IRC_MOTD " + IRC_PARMS="--setuid $IRC_USER --daemon --motd '$IRC_MOTD' " - if [ ! -z $STATEDIR ] ; then - IRC_PARMS=" $IRCPARMS --statedir $STATEDIR " + if [ ! -z "$IRC_STATEDIR" ] ; then + IRC_PARMS=" $IRCPARMS --statedir '$IRC_STATEDIR' " fi echo "Starting Miniircd..." start-stop-daemon $DROOPY_USER -m -S -p $PIDFILE_IRC -x $PIRATEBOX/bin/miniircd.py -- $IRC_PARMS