PHP 8.5.2
Preview: S01dbus Size: 3.08 KB
//etc/rc4.d/S01dbus

#!/bin/sh
### BEGIN INIT INFO
# Provides:          dbus
# Required-Start:    $remote_fs $syslog
# Required-Stop:     $remote_fs $syslog
# Default-Start:     2 3 4 5
# Default-Stop:
# Short-Description: D-Bus systemwide message bus
# Description:       D-Bus is a simple interprocess messaging system, used
#                    for sending messages between applications.
### END INIT INFO
# -*- coding: utf-8 -*-
# Debian init.d script for D-BUS
# Copyright © 2003 Colin Walters <walters@debian.org>
# Copyright © 2005 Sjoerd Simons <sjoerd@debian.org>

set -e

DAEMON=/usr/bin/dbus-daemon
UUIDGEN=/usr/bin/dbus-uuidgen
UUIDGEN_OPTS=--ensure
NAME=dbus
DAEMONUSER=messagebus
PIDDIR=/var/run/dbus
PIDFILE=$PIDDIR/pid
DESC="system message bus"

test -x $DAEMON || exit 0

. /lib/lsb/init-functions

# Source defaults file; edit that file to configure this script.
PARAMS=""
if [ -e /etc/default/dbus ]; then
  . /etc/default/dbus
fi

create_machineid() {
  # Create machine-id file
  if [ -x $UUIDGEN ]; then
    $UUIDGEN $UUIDGEN_OPTS
  fi
}

start_it_up()
{
  if [ ! -d $PIDDIR ]; then
    mkdir -p $PIDDIR
    chown $DAEMONUSER $PIDDIR
    chgrp $DAEMONUSER $PIDDIR
  fi

  if ! mountpoint -q /proc/ ; then
    log_failure_msg "Can't start $DESC - /proc is not mounted"
    return
  fi

  if [ -e $PIDFILE ]; then
    if $0 status > /dev/null ; then
      log_success_msg "$DESC already started; not starting."
      return
    else
      log_success_msg "Removing stale PID file $PIDFILE."
      rm -f $PIDFILE
    fi
  fi

  create_machineid

  # Force libnss-systemd to avoid trying to communicate via D-Bus, which
  # is never going to work well from within dbus-daemon. systemd
  # special-cases this internally, but we might need to do the same when
  # booting with sysvinit if libnss-systemd is still installed.
  # (Workaround for #940971)
  export SYSTEMD_NSS_BYPASS_BUS=1

  log_daemon_msg "Starting $DESC" "$NAME"
  start-stop-daemon --start --quiet --pidfile $PIDFILE \
    --exec $DAEMON -- --system $PARAMS
  log_end_msg $?
}

shut_it_down()
{
  log_daemon_msg "Stopping $DESC" "$NAME"
  start-stop-daemon --stop --retry 5 --quiet --oknodo --pidfile $PIDFILE \
    --user $DAEMONUSER
  # We no longer include these arguments so that start-stop-daemon
  # can do its job even given that we may have been upgraded.
  # We rely on the pidfile being sanely managed
  # --exec $DAEMON -- --system $PARAMS
  log_end_msg $?
  rm -f $PIDFILE
}

reload_it()
{
  create_machineid
  log_action_begin_msg "Reloading $DESC config"
  dbus-send --print-reply --system --type=method_call \
            --dest=org.freedesktop.DBus \
            / org.freedesktop.DBus.ReloadConfig > /dev/null
  # hopefully this is enough time for dbus to reload it's config file.
  log_action_end_msg $?
}

case "$1" in
  start)
    start_it_up
  ;;
  stop)
    shut_it_down
  ;;
  reload|force-reload)
    reload_it
  ;;
  restart)
    shut_it_down
    start_it_up
  ;;
  status)
    status_of_proc -p $PIDFILE $DAEMON $NAME && exit 0 || exit $?
    ;;
  *)
    echo "Usage: /etc/init.d/$NAME {start|stop|reload|restart|force-reload|status}" >&2
    exit 2
  ;;
esac

Directory Contents

Dirs: 0 × Files: 33

Name Size Perms Modified Actions
2.22 KB lrwxr-xr-x 2025-07-08 14:50:50
Edit Download
1.85 KB lrwxr-xr-x 2023-11-14 20:02:33
Edit Download
1.21 KB lrwxr-xr-x 2024-02-26 12:58:31
Edit Download
3.03 KB lrwxr-xr-x 2024-02-27 02:22:50
Edit Download
3.08 KB lrwxr-xr-x 2023-12-05 15:36:45
Edit Download
2.15 KB lrwxr-xr-x 2016-10-23 23:10:58
Edit Download
6.85 KB lrwxr-xr-x 2024-06-10 21:27:45
Edit Download
985 B lrwxr-xr-x 2025-03-17 11:36:12
Edit Download
3.40 KB lrwxr-xr-x 2024-04-01 06:55:32
Edit Download
6.27 KB lrwxr-xr-x 2025-12-04 10:46:13
Edit Download
4.47 KB lrwxr-xr-x 2025-04-28 07:08:08
Edit Download
1.80 KB lrwxr-xr-x 2025-09-05 13:01:22
Edit Download
4.19 KB lrwxr-xr-x 2025-07-22 07:08:08
Edit Download
4.19 KB lrwxr-xr-x 2025-07-22 07:08:08
Edit Download
4.19 KB lrwxr-xr-x 2025-07-22 07:08:08
Edit Download
4.19 KB lrwxr-xr-x 2025-07-22 07:08:08
Edit Download
4.19 KB lrwxr-xr-x 2025-07-22 07:08:08
Edit Download
4.19 KB lrwxr-xr-x 2025-12-30 07:08:08
Edit Download
4.19 KB lrwxr-xr-x 2025-12-30 07:08:08
Edit Download
4.19 KB lrwxr-xr-x 2026-01-22 07:08:08
Edit Download
4.19 KB lrwxr-xr-x 2026-01-22 07:08:08
Edit Download
4.19 KB lrwxr-xr-x 2026-01-22 07:08:08
Edit Download
1.35 KB lrwxr-xr-x 2024-03-21 13:42:02
Edit Download
3.02 KB lrwxr-xr-x 2024-03-05 15:20:59
Edit Download
5.20 KB lrwxr-xr-x 2024-05-09 07:08:08
Edit Download
3.04 KB lrwxr-xr-x 2025-07-30 19:03:47
Edit Download
1.57 KB lrwxr-xr-x 2024-01-09 13:42:30
Edit Download
4.31 KB lrwxr-xr-x 2024-04-12 17:09:41
Edit Download
3.96 KB lrwxr-xr-x 2025-07-21 15:58:50
Edit Download
1.54 KB lrwxr-xr-x 2024-01-09 20:31:44
Edit Download
1.36 KB lrwxr-xr-x 2024-02-12 17:50:35
Edit Download
1.28 KB lrwxr-xr-x 2024-04-09 14:02:37
Edit Download
4.46 KB lrwxr-xr-x 2023-11-25 12:25:37
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).