diff --git a/qbittorrent/qbittorrent.init b/qbittorrent/qbittorrent.init index 74f215e..f01f660 100644 --- a/qbittorrent/qbittorrent.init +++ b/qbittorrent/qbittorrent.init @@ -13,7 +13,8 @@ # Added log support and cleanup by DementedZA #Edit the user that qbittorrent-nox will run as. -USER="qbtuser" +USER="nobody" +GROUP="users" # No need to edit these. Logging is sent to /var/log/qbittorrent-nox.log by default. PATH="/sbin:/usr/sbin:/bin:/usr/bin" @@ -24,8 +25,8 @@ PIDFILE="/var/run/$NAME.pid" QBTLOG="/var/log/$NAME.log" DAEMON="/usr/bin/qbittorrent-nox" -DAEMON_ARGS="" -DAEMONSTRING="$DAEMON >> $QBTLOG 2>&1" +DAEMON_ARGS="--profile=/config" +DAEMONSTRING="$DAEMON $DAEMON_ARGS >> $QBTLOG 2>&1" export DBUS_SESSION_BUS_ADDRESS="" @@ -69,9 +70,9 @@ do_start() # 1 if daemon was already running # 2 if daemon could not be started - start-stop-daemon --start --chuid $USER --test --quiet --make-pidfile --pidfile $PIDFILE --background --exec /bin/bash -- -c "$DAEMONSTRING" || return 1 + start-stop-daemon --start --chuid $USER:$GROUP --test --quiet --make-pidfile --pidfile $PIDFILE --background --exec /bin/bash -- -c "$DAEMONSTRING" || return 1 - start-stop-daemon --start --chuid $USER --make-pidfile --pidfile $PIDFILE --background --exec /bin/bash -- -c "$DAEMONSTRING" || return 2 + start-stop-daemon --start --chuid $USER:$GROUP --make-pidfile --pidfile $PIDFILE --background --exec /bin/bash -- -c "$DAEMONSTRING" || return 2 sleep 1 }