mirror of
https://github.com/badaix/snapcast.git
synced 2025-08-06 10:09:33 +02:00
fix pid file location
This commit is contained in:
parent
833a1957fc
commit
cc69707fe1
3 changed files with 8 additions and 2 deletions
|
@ -7,7 +7,7 @@ Requires=network-online.target
|
|||
EnvironmentFile=-/etc/default/snapclient
|
||||
Type=forking
|
||||
ExecStart=/usr/bin/snapclient -d --user snapclient:audio $SNAPCLIENT_OPTS
|
||||
PIDFile=/var/run/snapclient.pid
|
||||
PIDFile=/var/run/snapclient/pid
|
||||
Restart=always
|
||||
|
||||
[Install]
|
||||
|
|
|
@ -80,6 +80,12 @@ void daemonize(const std::string& user, const std::string& group, const std::str
|
|||
#endif
|
||||
}
|
||||
|
||||
if (chown(pidfile.c_str(), user_uid, user_gid) == -1)
|
||||
{
|
||||
/// Couldn't open lock file
|
||||
throw SnapException("Could not chown PID lock file \"" + pidfile + "\"");
|
||||
}
|
||||
|
||||
/// set gid
|
||||
if (user_gid != (gid_t)-1 && user_gid != getgid() && setgid(user_gid) == -1)
|
||||
throw SnapException("Failed to set group " + cpt::to_string((int)user_gid));
|
||||
|
|
|
@ -7,7 +7,7 @@ Requires=network-online.target
|
|||
EnvironmentFile=-/etc/default/snapserver
|
||||
Type=forking
|
||||
ExecStart=/usr/bin/snapserver -d --user snapserver:snapserver $SNAPSERVER_OPTS
|
||||
PIDFile=/var/run/snapserver.pid
|
||||
PIDFile=/var/run/snapserver/pid
|
||||
Restart=always
|
||||
|
||||
[Install]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue