Closed eriksjolund closed 1 year ago
Thanks for the report! I'll take a look over the weekend.
This should be fixed. Could you please try the latest HEAD and report back?
On Wed, Jul 19, 2023, at 6:36 AM, Erik Sjölund wrote:
Short summary: There is some parsing bug somewhere in strv_split() or sd_listen_fds_with_names(). It only worked after doing workaround @.***
Reproducer:
On a Fedora CoreOS VM
- Create user test
sudo useradd test
- Start a login shell as user test
sudo machinectl shell test@
- Clone the lwan git repository to ~/lwan
- Build the image
podman build -t lwan ~/lwan
- Create directories
mkdir -p ~/.config/containers/systemd mkdir -p ~/.config/systemd/user
- Create the file ~/.config/systemd/user/my.socket with the contents
[Socket] ListenStream=8080
- Create the file ~/.config/containers/systemd/my.container with the contents `[Unit] After=my.socket Requires=my.socket
[Container] Network=none Image=localhost/lwan Volume=/home/test/lwan.conf:/lwan.conf:Z Volume=/home/test/web:/web:Z
The option
:Zis needed on SELinux systems. As *lwan* only needs to communicate over the socket-activated socket, it's possible to use
Network=none`
- Create the web directory and an example text file
mkdir ~/web echo hello > ~/web/file.txt
- Reload systemd configuration
systemctl --user daemon-reload
- Start the socket
systemctl --user start my.socket
- Enable systemd debug logging
pkill --signal SIGRTMIN+22 -u $USER systemd
- Download the example text file from the lwan web server
curl localhost:8080/file.txt
The command fails.- Check the logs
journalctl --user -xeu my.service
The log containsJul 19 07:17:49 localhost.localdomain systemd-my[22070]: Could not parse socket activation data from systemd: Invalid argument (error number 22) Jul 19 07:17:49 localhost.localdomain systemd-my[22070]: Could not create listen_fd
— Reply to this email directly, view it on GitHub https://github.com/lpereira/lwan/issues/357, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAADVGLBDR7WBGH5HRSNKILXQ557JANCNFSM6AAAAAA2PNZAIQ. You are receiving this because you are subscribed to this thread.Message ID: @.***>
Thanks, I tried the latest HEAD and it now works!
Short summary: There is some parsing bug somewhere in strv_split() or sd_listen_fds_with_names(). It only worked after doing a workaround https://github.com/eriksjolund/lwan/commit/408a6888cf8f8d62ad634d7108018a2e9168ff4e
Reproducer:
On a Fedora CoreOS VM
Create the file ~/lwan.conf with the contents
Create the file ~/.config/containers/systemd/my.container with the contents
The option
:Z
is needed on SELinux systems. As lwan only needs to communicate over the socket-activated socket, it's possible to useNetwork=none
The command fails.
The log contains