users for snapclient and snapserver daemon

This commit is contained in:
badaix 2017-02-07 20:11:49 +01:00
parent 88cf84aa50
commit 0f2359c971
11 changed files with 64 additions and 22 deletions

View file

@ -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)