summaryrefslogtreecommitdiff
path: root/bus/bus.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2012-02-02 02:25:11 +0100
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2012-02-10 10:07:24 +0000
commita8423067ceac1af6176e14fbc334fe5b82431e3d (patch)
tree8dc820e73a095d0b41965c83e1f8bb3ff993359d /bus/bus.c
parentdd4038156dd7946118f58b763985cdd4c5726bea (diff)
downloaddbus-a8423067ceac1af6176e14fbc334fe5b82431e3d.tar.gz
bus: introduce --nopidfile switch to disable writing of PID files
When used with init systems such as systemd (where PID files are redundant) this allows us to disable PID files even if a path is configured for them in the normal bus configuration files. Make use of this new switch in the systemd unit file. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=45520 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Diffstat (limited to 'bus/bus.c')
-rw-r--r--bus/bus.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/bus/bus.c b/bus/bus.c
index c7308b79..ae2a61a6 100644
--- a/bus/bus.c
+++ b/bus/bus.c
@@ -270,6 +270,7 @@ process_config_first_time_only (BusContext *context,
BusConfigParser *parser,
const DBusString *address,
dbus_bool_t systemd_activation,
+ dbus_bool_t write_pidfile,
DBusError *error)
{
DBusString log_prefix;
@@ -285,6 +286,7 @@ process_config_first_time_only (BusContext *context,
retval = FALSE;
auth_mechanisms = NULL;
+ pidfile = NULL;
_dbus_init_system_log ();
@@ -295,7 +297,10 @@ process_config_first_time_only (BusContext *context,
* 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;
@@ -698,6 +703,7 @@ bus_context_new (const DBusString *config_file,
DBusPipe *print_pid_pipe,
const DBusString *address,
dbus_bool_t systemd_activation,
+ dbus_bool_t write_pidfile,
DBusError *error)
{
BusContext *context;
@@ -751,7 +757,7 @@ bus_context_new (const DBusString *config_file,
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;