-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathrun-dbus.sh
32 lines (22 loc) · 899 Bytes
/
run-dbus.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/sh
set -eux
echo "Creating system users"
# Create system users with system accounts and no home directories, using nologin shell
useradd --system --no-create-home --shell /usr/sbin/nologin systemd-resolve || true
useradd --system --no-create-home --shell /usr/sbin/nologin systemd-network || true
echo "Creating directories"
# Create the /run/dbus directory if it doesn't exist, set permissions, and ownership
mkdir -p /run/dbus
chmod 755 /run/dbus
chown root:root /run/dbus
echo "Starting dbus"
# Start the dbus daemon in the foreground
# dbus-daemon --system --nofork --nopidfile &
# Check the status of the dbus service
service dbus start
service dbus status || true
echo "Starting avahi-daemon"
# Start the avahi-daemon in the background without dropping root privileges
avahi-daemon --daemonize --no-drop-root
# Keep the script running to avoid container exit
tail -f /dev/null