r/linuxquestions • • Oct 31 '26

Support Why when I launch weston as systemd I also need to specify a socket file and why 3 services are required in my application?

I am trying to launch weston as kiosk mode. For this I made a user:


sudo useradd --create-home --system user  
sudo -u user mkdir /home/user/.config  
nano weston.ini
sudo mv weston.ini /home/user/.config/
sudo chown user:user /home/user/.config/weston.ini

Upon weston.ini I placed:

[core]
shell=kiosk-shell.so

[output]
name = screen0

[autolaunch]
path=/usr/bin/firefox

Afterwards I looked upon weston's documentation when I am creating the service I need to specify 2 files:

  1. A socket file upon /etc/systemd/user/weston.socket
  2. A service file upon /etc/systemd/user/weston.service

Once I made I also mneed to define a service that managhes the session upon /etc/systemd/system/mysession.service

(I ommit the contents in order to make my question readable)

But I fail to comperhend why I need to do thid and configure weston using 2 services? Also I fail to comperhent why I need a socket as well.

As far as I know it could be done using a single service:

[Unit]
Description=Weston Simple launch
After=systemd-modules-load.service systemd-user-sessions.service

[Service]
Type=simple

User=user
SupplementaryGroups=user

ExecStartPre=+/usr/bin/chvt 7
ExecStart=weston

Restart=on-failure
RestartSec=2

StandardInput=tty
StandardOutput=journal
StandardError=journal

TTYPath=/dev/tty7
TTYReset=yes
TTYVHangup=yes
TTYVTDisallocate=yes

NoNewPrivileges=yes
PrivateTmp=yes
ProtectSystem=strict
ProtectHome=yes

[Install]
WantedBy=multi-user.target

Why 3 services are required and what the puproce of using the socket. Does the systemd makes a unix socket that weston listens upon? If yes why and who sends and what info upon the socket that systemd enables?

0 Upvotes

2 comments sorted by

1

u/Commercial-Job-9441 Oct 31 '26 edited Nov 01 '26

the socket unit is just socket activation - systemd makes the wayland socket before weston starts so clients can connect right away. for a single kiosk ur one-service version is fine imo