Skip to content
This repository has been archived by the owner on Sep 29, 2024. It is now read-only.

Commit

Permalink
Run systemd-socket-proxyd as a D-Bus proxy
Browse files Browse the repository at this point in the history
  • Loading branch information
amezin committed Aug 16, 2023
1 parent 8590d90 commit 096bd5a
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 3 deletions.
4 changes: 4 additions & 0 deletions archlinux.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ RUN systemctl enable xvfb@:99.service && \
useradd -m -U -G users,adm gnomeshell && \
mkdir -p /var/lib/systemd/linger && \
touch /var/lib/systemd/linger/gnomeshell && \
su -l gnomeshell -c ' \
mkdir -p $HOME/.config/systemd/user/sockets.target.wants/ && \
ln -s /etc/xdg/systemd/user/[email protected] $HOME/.config/systemd/user/sockets.target.wants/[email protected] \
' && \
systemd-machine-id-setup

# dbus port
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-Bus Bus Configuration 1.0//EN"
"http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
<busconfig>
<listen>tcp:host=0.0.0.0,port=1234</listen>
<listen>systemd:</listen>
<apparmor mode="disabled"/>
<auth>ANONYMOUS</auth>
Expand Down
10 changes: 10 additions & 0 deletions common/etc/systemd/user/[email protected]
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[Unit]
Description=D-Bus TCP proxy on port %I
Requires=dbus.socket
After=dbus.socket
Requires=dbus-proxy@%i.socket
After=dbus-proxy@%i.socket

[Service]
Type=notify
ExecStart=/lib/systemd/systemd-socket-proxyd %t/bus
8 changes: 8 additions & 0 deletions common/etc/systemd/user/[email protected]
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[Unit]
Description=D-Bus TCP proxy on port %I

[Socket]
ListenStream=%I

[Install]
WantedBy=sockets.target
6 changes: 5 additions & 1 deletion debian.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@ RUN systemctl enable xvfb@:99.service && \
systemctl mask systemd-oomd low-memory-monitor rtkit-daemon udisks2 && \
useradd -m -U -G users,adm gnomeshell && \
mkdir -p /var/lib/systemd/linger && \
touch /var/lib/systemd/linger/gnomeshell
touch /var/lib/systemd/linger/gnomeshell && \
su -l gnomeshell -c ' \
mkdir -p $HOME/.config/systemd/user/sockets.target.wants/ && \
ln -s /etc/xdg/systemd/user/[email protected] $HOME/.config/systemd/user/sockets.target.wants/[email protected] \
'

# dbus port
EXPOSE 1234
Expand Down
6 changes: 5 additions & 1 deletion fedora.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@ RUN systemctl enable xvfb@:99.service && \
systemctl --global mask org.gnome.SettingsDaemon.Subscription && \
adduser -m -U -G users,adm gnomeshell && \
mkdir -p /var/lib/systemd/linger && \
touch /var/lib/systemd/linger/gnomeshell
touch /var/lib/systemd/linger/gnomeshell && \
su -l gnomeshell -c ' \
mkdir -p $HOME/.config/systemd/user/sockets.target.wants/ && \
ln -s /etc/xdg/systemd/user/[email protected] $HOME/.config/systemd/user/sockets.target.wants/[email protected] \
'

# dbus port
EXPOSE 1234
Expand Down

0 comments on commit 096bd5a

Please sign in to comment.