mirror of
https://github.com/badaix/snapcast.git
synced 2025-08-03 08:39:49 +02:00
Remove underscore from usernames
Cleanup init scripts, use $USERNAME and $HOMDIR variables
This commit is contained in:
parent
5a68f95828
commit
09bd4c3bf7
8 changed files with 19 additions and 17 deletions
7
debian/snapclient.init
vendored
7
debian/snapclient.init
vendored
|
@ -16,6 +16,7 @@
|
|||
PATH=/sbin:/usr/sbin:/bin:/usr/bin
|
||||
DESC="Snapcast client"
|
||||
NAME=snapclient
|
||||
USERNAME=snapclient
|
||||
DAEMON=/usr/bin/$NAME
|
||||
PIDFILE=/var/run/$NAME/pid
|
||||
SCRIPTNAME=/etc/init.d/$NAME
|
||||
|
@ -47,15 +48,15 @@ do_start()
|
|||
PIDDIR=$(dirname "$PIDFILE")
|
||||
if [ ! -d "$PIDDIR" ]; then
|
||||
mkdir -m 0755 $PIDDIR
|
||||
chown _snapclient:_snapclient $PIDDIR
|
||||
chown $USERNAME:$USERNAME $PIDDIR
|
||||
fi
|
||||
|
||||
# Return
|
||||
# 0 if daemon has been started
|
||||
# 1 if daemon was already running
|
||||
# 2 if daemon could not be started
|
||||
start-stop-daemon --start --quiet --pidfile "$PIDFILE" --chuid "_snapclient:_snapclient" --exec "$DAEMON" --test > /dev/null || return 1
|
||||
start-stop-daemon --start --quiet --pidfile "$PIDFILE" --chuid "_snapclient:_snapclient" --exec "$DAEMON" -- $SNAPCLIENT_OPTS > /dev/null || return 2
|
||||
start-stop-daemon --start --quiet --pidfile "$PIDFILE" --chuid "$USERNAME:$USERNAME" --exec "$DAEMON" --test > /dev/null || return 1
|
||||
start-stop-daemon --start --quiet --pidfile "$PIDFILE" --chuid "$USERNAME:$USERNAME" --exec "$DAEMON" -- $SNAPCLIENT_OPTS > /dev/null || return 2
|
||||
# Add code here, if necessary, that waits for the process to be ready
|
||||
# to handle requests from services started subsequently which depend
|
||||
# on this one. As a last resort, sleep for some time.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue