diff --git a/NEWS b/NEWS index 152357082a..34bc20f3f3 100644 --- a/NEWS +++ b/NEWS @@ -2,6 +2,7 @@ ver 0.23.4 (not yet released) * output - alsa: add option "thesycon_dsd_workaround" to work around device bug * fix crash or debug builds if startup fails +* ignore the "pid_file" setting if started as systemd service * Windows - enable the "openmpt" decoder plugin diff --git a/src/Main.cxx b/src/Main.cxx index 84e418aafc..77575a0080 100644 --- a/src/Main.cxx +++ b/src/Main.cxx @@ -145,9 +145,19 @@ static void glue_daemonize_init(const CommandLineOptions &options, const ConfigData &config) { + auto pid_file = config.GetPath(ConfigOption::PID_FILE); + +#ifdef __linux__ + if (options.systemd && pid_file != nullptr) { + pid_file = nullptr; + fprintf(stderr, + "Ignoring the 'pid_file' setting in systemd mode\n"); + } +#endif + daemonize_init(config.GetString(ConfigOption::USER), config.GetString(ConfigOption::GROUP), - config.GetPath(ConfigOption::PID_FILE)); + std::move(pid_file)); if (options.kill) daemonize_kill();