diff options
author | Havoc Pennington <hp@redhat.com> | 2003-04-06 23:15:41 +0000 |
---|---|---|
committer | Havoc Pennington <hp@redhat.com> | 2003-04-06 23:15:41 +0000 |
commit | 856361ff5b8ce701cdb447085931d3076ee52008 (patch) | |
tree | 05aa6d44983e8eff29bc45b9dc94ff8b7998fe3c /bus/messagebus.in | |
parent | c8991b0f95a3b53bc98de9e029780bbe0a0b3114 (diff) |
2003-04-06 Havoc Pennington <hp@pobox.com>
* dbus/dbus-sysdeps.c (_dbus_become_daemon): write the pidfile
here in the parent process, so we can return an error if it
fails. Also, move some of the code into the child so the parent
is less hosed if we fail midway through.
* bus/bus.c (bus_context_new): move pidfile detection further up
in the function, before we start overwriting sockets and such.
* bus/messagebus.in: adjust this a bit, not sure if it will work.
* configure.in: add --with-system-pid-file and --with-system-socket
2003-04-06 Colin Walters <walters@verbum.org>
* configure.in (DBUS_SYSTEM_PID_FILE): New variable.
* bus/system.conf.in: Declare a pidfile.
* bus/bus.c (bus_context_new): Test for an existing pid file, and
create one (if appropriate).
* bus/config-parser.c (enum ElementType) [ELEMENT_PIDFILE]: New.
(struct BusConfigParser) [pidfile]: New.
(element_type_to_name, merge_included, start_busconfig_child)
(bus_config_parser_end_element, bus_config_parser_content): Handle it.
(bus_config_parser_unref): Free it.
(bus_config_parser_get_pidfile): New function.
* bus/config-parser.h (_dbus_write_pid_file): Prototype.
* dbus/dbus-errors.h (DBUS_ERROR_PIDFILE_EXISTS): New error.
* dbus/dbus-sysdeps.c (_dbus_write_pid_file): New function.
* dbus/dbus-sysdeps.h: Prototype it.
Diffstat (limited to 'bus/messagebus.in')
-rwxr-xr-x | bus/messagebus.in | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/bus/messagebus.in b/bus/messagebus.in index 60c70777..45388a5e 100755 --- a/bus/messagebus.in +++ b/bus/messagebus.in @@ -7,7 +7,7 @@ # and other messages. See http://www.freedesktop.org/software/dbus/ # # processname: dbus-daemon-1 -# pidfile: @EXPANDED_LOCALSTATEDIR@/messagebus.pid +# pidfile: @DBUS_SYSTEM_PID_FILE@ # # Sanity checks. @@ -20,7 +20,7 @@ RETVAL=0 start() { echo -n $"Starting system message bus: " - daemon dbus-daemon-1 --system + daemon --check messagebus dbus-daemon-1 --system RETVAL=$? echo [ $RETVAL -eq 0 ] && touch @EXPANDED_LOCALSTATEDIR@/lock/subsys/messagebus @@ -28,7 +28,11 @@ start() { stop() { echo -n $"Stopping system message bus: " - killproc messagebus + + ## we don't want to kill all the per-user dbus-daemon-1, we want + ## to use the pid file *only*; because we use the fake nonexistent + ## program name "messagebus" that should be safe-ish + killproc messagebus -TERM RETVAL=$? echo if [ $RETVAL -eq 0 ]; then @@ -59,7 +63,7 @@ case "$1" in fi ;; reload) - killproc messagebus -HUP + echo "Message bus can't reload its configuration, you have to restart it" RETVAL=$? ;; *) |