mirror of
https://github.com/badaix/snapcast.git
synced 2025-08-04 09:08:47 +02:00
fix pid file location
This commit is contained in:
parent
833a1957fc
commit
cc69707fe1
3 changed files with 8 additions and 2 deletions
|
@ -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));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue