Skip to content

Fix systemd unit namespace issue (fixes: #53, #58, #68, #100)#101

Open
leegarrett wants to merge 1 commit into
skeeto:masterfrom
leegarrett:master
Open

Fix systemd unit namespace issue (fixes: #53, #58, #68, #100)#101
leegarrett wants to merge 1 commit into
skeeto:masterfrom
leegarrett:master

Conversation

@leegarrett

Copy link
Copy Markdown

Fix systemd unit namespace issue (fixes: #53, #58, #68, #100)

Without this change, the systemd unit would fail like this:

# systemctl start endlessh
# journalctl -u endlessh -b
Feb 14 11:08:58 batou systemd[1]: Started endlessh.service - Endlessh SSH Tarpit.
Feb 14 11:08:58 batou systemd[1]: endlessh.service: Main process exited, code=exited, status=226/NAMESPACE
Feb 14 11:08:58 batou systemd[1]: endlessh.service: Failed with result 'exit-code'.
Feb 14 11:09:28 batou systemd[1]: endlessh.service: Scheduled restart job, restart counter is at 1.
Feb 14 11:09:28 batou systemd[1]: Stopped endlessh.service - Endlessh SSH Tarpit.
Feb 14 11:09:28 batou systemd[1]: Started endlessh.service - Endlessh SSH Tarpit.
Feb 14 11:09:28 batou systemd[1]: endlessh.service: Main process exited, code=exited, status=226/NAMESPACE
Feb 14 11:09:28 batou systemd[1]: endlessh.service: Failed with result 'exit-code'.
Feb 14 11:09:58 batou systemd[1]: endlessh.service: Scheduled restart job, restart counter is at 2.
Feb 14 11:09:58 batou systemd[1]: Stopped endlessh.service - Endlessh SSH Tarpit.
Feb 14 11:09:58 batou systemd[1]: Started endlessh.service - Endlessh SSH Tarpit.
Feb 14 11:09:58 batou systemd[1]: endlessh.service: Main process exited, code=exited, status=226/NAMESPACE
Feb 14 11:09:58 batou systemd[1]: endlessh.service: Failed with result 'exit-code'.
Feb 14 11:10:28 batou systemd[1]: endlessh.service: Scheduled restart job, restart counter is at 3.
Feb 14 11:10:28 batou systemd[1]: Stopped endlessh.service - Endlessh SSH Tarpit.
Feb 14 11:10:28 batou systemd[1]: Started endlessh.service - Endlessh SSH Tarpit.
Feb 14 11:10:29 batou systemd[1]: endlessh.service: Main process exited, code=exited, status=226/NAMESPACE
Feb 14 11:10:29 batou systemd[1]: endlessh.service: Failed with result 'exit-code'.
Feb 14 11:10:59 batou systemd[1]: endlessh.service: Scheduled restart job, restart counter is at 4.
Feb 14 11:10:59 batou systemd[1]: Stopped endlessh.service - Endlessh SSH Tarpit.
Feb 14 11:10:59 batou systemd[1]: endlessh.service: Start request repeated too quickly.
Feb 14 11:10:59 batou systemd[1]: endlessh.service: Failed with result 'exit-code'.
Feb 14 11:10:59 batou systemd[1]: Failed to start endlessh.service - Endlessh SSH Tarpit.

With this change, starting endlessh.service succeeds:

# systemctl start endlessh
# journalctl -u endlessh -b
[...]
Feb 14 11:15:08 batou systemd[1]: Started endlessh.service - Endlessh SSH Tarpit.

This change was tested on Debian trixie, up-to-date as of 2025-02-14.

, skeeto#100)

Without this change, the systemd unit would fail like this:
# systemctl start endlessh
# journalctl -u endlessh -b
Feb 14 11:08:58 batou systemd[1]: Started endlessh.service - Endlessh SSH Tarpit.
Feb 14 11:08:58 batou systemd[1]: endlessh.service: Main process exited, code=exited, status=226/NAMESPACE
Feb 14 11:08:58 batou systemd[1]: endlessh.service: Failed with result 'exit-code'.
Feb 14 11:09:28 batou systemd[1]: endlessh.service: Scheduled restart job, restart counter is at 1.
Feb 14 11:09:28 batou systemd[1]: Stopped endlessh.service - Endlessh SSH Tarpit.
Feb 14 11:09:28 batou systemd[1]: Started endlessh.service - Endlessh SSH Tarpit.
Feb 14 11:09:28 batou systemd[1]: endlessh.service: Main process exited, code=exited, status=226/NAMESPACE
Feb 14 11:09:28 batou systemd[1]: endlessh.service: Failed with result 'exit-code'.
Feb 14 11:09:58 batou systemd[1]: endlessh.service: Scheduled restart job, restart counter is at 2.
Feb 14 11:09:58 batou systemd[1]: Stopped endlessh.service - Endlessh SSH Tarpit.
Feb 14 11:09:58 batou systemd[1]: Started endlessh.service - Endlessh SSH Tarpit.
Feb 14 11:09:58 batou systemd[1]: endlessh.service: Main process exited, code=exited, status=226/NAMESPACE
Feb 14 11:09:58 batou systemd[1]: endlessh.service: Failed with result 'exit-code'.
Feb 14 11:10:28 batou systemd[1]: endlessh.service: Scheduled restart job, restart counter is at 3.
Feb 14 11:10:28 batou systemd[1]: Stopped endlessh.service - Endlessh SSH Tarpit.
Feb 14 11:10:28 batou systemd[1]: Started endlessh.service - Endlessh SSH Tarpit.
Feb 14 11:10:29 batou systemd[1]: endlessh.service: Main process exited, code=exited, status=226/NAMESPACE
Feb 14 11:10:29 batou systemd[1]: endlessh.service: Failed with result 'exit-code'.
Feb 14 11:10:59 batou systemd[1]: endlessh.service: Scheduled restart job, restart counter is at 4.
Feb 14 11:10:59 batou systemd[1]: Stopped endlessh.service - Endlessh SSH Tarpit.
Feb 14 11:10:59 batou systemd[1]: endlessh.service: Start request repeated too quickly.
Feb 14 11:10:59 batou systemd[1]: endlessh.service: Failed with result 'exit-code'.
Feb 14 11:10:59 batou systemd[1]: Failed to start endlessh.service - Endlessh SSH Tarpit.

With this change, starting endlessh.service succeeds:
# systemctl start endlessh
# journalctl -u endlessh -b
[...]
Feb 14 11:15:08 batou systemd[1]: Started endlessh.service - Endlessh SSH Tarpit.

This change was tested on Debian trixie, up-to-date as of 2025-02-14.

@ThomasLamprecht ThomasLamprecht left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW: I tested this on a current Arch Linux system and the change was all that's needed to be able to successfully start the systemd service.

@jlquinn

jlquinn commented May 1, 2025

Copy link
Copy Markdown

This change solves the startup issue on Ubuntu 24.04.

@leegarrett

Copy link
Copy Markdown
Author

@skeeto Unless you have reservations, can we get this merged?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

InaccessiblePaths=/run /var makes systemd service not start on Raspberry pi

3 participants