Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Ubuntu init script changes for unique groups and home dirs #296

Closed
wants to merge 1 commit into from

3 participants

@billmoritz

In my installation, the SickBeard user has a different group name than
the user name. Also my Sickbeard user has a home directory that is not
in /home.

@billmoritz billmoritz Group and home directory aware init script for Ubuntu
In my installation, the SickBeard user has a different group name than
the user name.  Also my Sickbeard user has a home directory that is not
in /home.
06e211f
@thezoggy

this can be closed out, this was resolved in the ubuntu init rewrite a year ago. users define their overrides in the etc/defaults

@midgetspy midgetspy closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Feb 10, 2012
  1. @billmoritz

    Group and home directory aware init script for Ubuntu

    billmoritz authored
    In my installation, the SickBeard user has a different group name than
    the user name.  Also my Sickbeard user has a home directory that is not
    in /home.
This page is out of date. Refresh to see the latest.
Showing with 4 additions and 3 deletions.
  1. +4 −3 init.ubuntu
View
7 init.ubuntu
@@ -31,9 +31,10 @@ DESC=SickBeard
# user
RUN_AS=SICKBEARD_USER
+RUN_AS_GROUP=SICKBEARD_GROUP
# data directory
-DATA_DIR=/home/${RUN_AS}/.sickbeard
+DATA_DIR=`awk -F: -v v=${RUN_AS} '{if ($1==v) print $6}' /etc/passwd`/.sickbeard
# startup args
DAEMON_OPTS=" SickBeard.py -q --daemon --nolaunch --pidfile=${PID_FILE} --datadir=${DATA_DIR}"
@@ -46,14 +47,14 @@ set -e
if [ ! -d $DATA_DIR ]; then
mkdir -p $DATA_DIR
- chown $RUN_AS $DATA_DIR
+ chown $RUN_AS:$RUN_AS_GROUP $DATA_DIR
fi
case "$1" in
start)
echo "Starting $DESC"
rm -rf $PID_PATH || return 1
- install -d --mode=0755 -o $RUN_AS -g $RUN_AS $PID_PATH || return 1
+ install -d --mode=0755 -o $RUN_AS -g $RUN_AS_GROUP $PID_PATH || return 1
start-stop-daemon -d $APP_PATH -c $RUN_AS --start --pidfile $PID_FILE --exec $DAEMON -- $DAEMON_OPTS
;;
stop)
Something went wrong with that request. Please try again.