BusConfigParser *parser,
const DBusString *address,
dbus_bool_t systemd_activation,
+ dbus_bool_t write_pidfile,
DBusError *error)
{
DBusString log_prefix;
retval = FALSE;
auth_mechanisms = NULL;
+ pidfile = NULL;
_dbus_init_system_log ();
* avoid that. But we want to check for the pid file
* before overwriting any existing sockets, etc.
*/
- pidfile = bus_config_parser_get_pidfile (parser);
+
+ if (write_pidfile)
+ pidfile = bus_config_parser_get_pidfile (parser);
+
if (pidfile != NULL)
{
DBusString u;
DBusPipe *print_pid_pipe,
const DBusString *address,
dbus_bool_t systemd_activation,
+ dbus_bool_t write_pidfile,
DBusError *error)
{
BusContext *context;
goto failed;
}
- if (!process_config_first_time_only (context, parser, address, systemd_activation, error))
+ if (!process_config_first_time_only (context, parser, address, systemd_activation, write_pidfile, error))
{
_DBUS_ASSERT_ERROR_IS_SET (error);
goto failed;
DBusPipe *print_pid_pipe,
const DBusString *address,
dbus_bool_t systemd_activation,
+ dbus_bool_t write_pidfile,
DBusError *error);
dbus_bool_t bus_context_reload_config (BusContext *context,
DBusError *error);
After=syslog.target
[Service]
-ExecStartPre=-/bin/rm -f @DBUS_SYSTEM_PID_FILE@
-ExecStart=@EXPANDED_BINDIR@/dbus-daemon --system --address=systemd: --nofork --systemd-activation
+ExecStart=@EXPANDED_BINDIR@/dbus-daemon --system --address=systemd: --nofork --nopidfile --systemd-activation
ExecReload=@EXPANDED_BINDIR@/dbus-send --print-reply --system --type=method_call --dest=org.freedesktop.DBus / org.freedesktop.DBus.ReloadConfig
OOMScoreAdjust=-900
static void
usage (void)
{
- fprintf (stderr, DBUS_DAEMON_NAME " [--version] [--session] [--system] [--config-file=FILE] [--print-address[=DESCRIPTOR]] [--print-pid[=DESCRIPTOR]] [--fork] [--nofork] [--introspect] [--address=ADDRESS] [--systemd-activation]\n");
+ fprintf (stderr, DBUS_DAEMON_NAME " [--version] [--session] [--system] [--config-file=FILE] [--print-address[=DESCRIPTOR]] [--print-pid[=DESCRIPTOR]] [--fork] [--nofork] [--introspect] [--address=ADDRESS] [--systemd-activation] [--nopidfile]\n");
exit (1);
}
dbus_bool_t print_pid;
int force_fork;
dbus_bool_t systemd_activation;
+ dbus_bool_t write_pidfile;
if (!_dbus_string_init (&config_file))
return 1;
print_pid = FALSE;
force_fork = FORK_FOLLOW_CONFIG_FILE;
systemd_activation = FALSE;
+ write_pidfile = TRUE;
prev_arg = NULL;
i = 1;
force_fork = FORK_NEVER;
else if (strcmp (arg, "--fork") == 0)
force_fork = FORK_ALWAYS;
+ else if (strcmp (arg, "--nopidfile") == 0)
+ write_pidfile = FALSE;
else if (strcmp (arg, "--systemd-activation") == 0)
systemd_activation = TRUE;
else if (strcmp (arg, "--system") == 0)
&print_addr_pipe, &print_pid_pipe,
_dbus_string_get_length(&address) > 0 ? &address : NULL,
systemd_activation,
+ write_pidfile,
&error);
_dbus_string_free (&config_file);
if (context == NULL)
}
dbus_error_init (&error);
- context = bus_context_new (&config_file, FALSE, NULL, NULL, NULL, FALSE, &error);
+ context = bus_context_new (&config_file, FALSE, NULL, NULL, NULL, FALSE, FALSE, &error);
if (context == NULL)
{
_DBUS_ASSERT_ERROR_IS_SET (&error);
.I "\-\-systemd\-activation"
Enable systemd\-style service activation. Only useful in conjunction
with the systemd system and session manager on Linux.
+.TP
+.I "\-\-nopidfile"
+Don't write a PID file even if one is configured in the configuration
+files.
.SH CONFIGURATION FILE