mirror of
https://github.com/badaix/snapcast.git
synced 2025-08-03 00:29:35 +02:00
users for snapclient and snapserver daemon
This commit is contained in:
parent
88cf84aa50
commit
0f2359c971
11 changed files with 64 additions and 22 deletions
|
@ -101,7 +101,7 @@ else
|
|||
install:
|
||||
$(MAKE) adduser
|
||||
$(MAKE) installfiles
|
||||
install -g audio -o snapcast -d /var/run/$(BIN)
|
||||
install -g audio -o snapclient -d /var/run/$(BIN)
|
||||
|
||||
@if [[ `systemctl` =~ -\.mount ]]; then \
|
||||
$(MAKE) installsystemd; \
|
||||
|
@ -135,8 +135,8 @@ installsysv:
|
|||
/etc/init.d/$(BIN) start; \
|
||||
|
||||
adduser:
|
||||
@if ! getent passwd snapcast >/dev/null; then \
|
||||
adduser --quiet --ingroup audio --system --no-create-home --home /var/lib/snapcast snapcast; \
|
||||
@if ! getent passwd snapclient >/dev/null; then \
|
||||
adduser --quiet --ingroup audio --system --no-create-home --home /var/lib/snapclient snapclient; \
|
||||
fi; \
|
||||
|
||||
ifeq ($(TARGET), MACOS)
|
||||
|
@ -184,5 +184,5 @@ uninstallsystemd:
|
|||
systemctl daemon-reload; \
|
||||
|
||||
deluser:
|
||||
@deluser --quiet --system snapcast > /dev/null || true
|
||||
@deluser --quiet --system snapclient > /dev/null || true
|
||||
|
||||
|
|
|
@ -48,7 +48,7 @@ do_start()
|
|||
PIDDIR=$(dirname "$PIDFILE")
|
||||
if [ ! -d "$PIDDIR" ]; then
|
||||
mkdir -m 0755 $PIDDIR
|
||||
chown snapcast:audio $PIDDIR
|
||||
chown snapclient:audio $PIDDIR
|
||||
fi
|
||||
|
||||
# Return
|
||||
|
|
|
@ -7,9 +7,9 @@ ACTION="$1"
|
|||
VERSION="$2"
|
||||
|
||||
if [ "$ACTION" = "configure" ]; then
|
||||
# add the snapcast user
|
||||
if ! getent passwd snapcast >/dev/null; then
|
||||
adduser --quiet --ingroup audio --system --no-create-home snapcast
|
||||
# add the snapclient user
|
||||
if ! getent passwd snapclient >/dev/null; then
|
||||
adduser --quiet --ingroup audio --system --no-create-home snapclient
|
||||
fi
|
||||
fi
|
||||
|
||||
|
|
|
@ -3,15 +3,15 @@
|
|||
set -e
|
||||
|
||||
if [ "$1" = "purge" ]; then
|
||||
# clean up all statoverrides that belonged to snapcast, so the
|
||||
# snapcast system user can be removed cleanly
|
||||
for i in $(dpkg-statoverride --list | awk '/^snapcast / {print $4}'); do
|
||||
# clean up all statoverrides that belonged to snapclient, so the
|
||||
# snapclient system user can be removed cleanly
|
||||
for i in $(dpkg-statoverride --list | awk '/^snapclient / {print $4}'); do
|
||||
if dpkg-statoverride --list --quiet "$i" >/dev/null; then
|
||||
dpkg-statoverride --force --quiet --remove "$i"
|
||||
fi
|
||||
done
|
||||
|
||||
deluser --quiet --system snapcast > /dev/null || true
|
||||
deluser --quiet --system snapclient > /dev/null || true
|
||||
fi
|
||||
|
||||
#DEBHELPER#
|
||||
|
|
|
@ -160,7 +160,10 @@ int main (int argc, char **argv)
|
|||
if (daemonOption.isSet())
|
||||
{
|
||||
#ifdef HAS_DAEMON
|
||||
daemonize("snapcast", "audio", "/var/run/snapclient/pid." + cpt::to_string(instance));
|
||||
string pidFile = "/var/run/snapclient/pid";
|
||||
if (instance != 1)
|
||||
pidFile += "." + cpt::to_string(instance);
|
||||
daemonize("snapclient", "audio", pidFile);
|
||||
if (processPriority < -20)
|
||||
processPriority = -20;
|
||||
else if (processPriority > 19)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue