Skip to content

Added first draft for a systemd-unitfile in the contrib#246

Open
Tqnsls wants to merge 1 commit intoJnyJny:mainfrom
Tqnsls:patch-1
Open

Added first draft for a systemd-unitfile in the contrib#246
Tqnsls wants to merge 1 commit intoJnyJny:mainfrom
Tqnsls:patch-1

Conversation

@Tqnsls
Copy link
Copy Markdown

@Tqnsls Tqnsls commented Mar 30, 2023

I know, this file is not perfect, but it works.
I think the problem with the busyserve command is that it sends no "Success"-signal back to the main process, thats why I added the screen-command. I did this with many proprietary gameservers hosted on linux and thats fine, at least for me. Update / Improve if you wish.

The ExecStartPost can be customized to anyone's wishes of course, I added the retry and connect-timeout parameters because the Port is not available immediately at the time of EcexStartPost execution.
Also the ExecStartPost starts the busylight with slow rainbow effects which I liked!
I did not want to add a bash script (which sleeps a short time and then curls the server), but that were possible, too.

This file can be copied to /usr/lib/systemd/system/ or /etc/systemd/system/.

This PR also kind of resolveds #84

I know, this file is not perfect, but it works.
I think the problem with the busyserve command is that it sends no "Success"-signal back to the main process, thats why I added the screen-command. I did this with many proprietary gameservers hosted on linux and thats fine, at least for me. Update / Improve if you wish.

The ExecStartPost can be customized to anyone's wishes of course, I added the retry and connect-timeout parameters because the Port is not available immediately at the time of EcexStartPost execution. I did not want to add a bash script (which sleeps a short time and then curls the server), but that were possible, too.
Comment on lines +5 to +8
ExecStart=screen -m -d -S systemD_busylight /usr/local/bin/busyserve -D
ExecStartPost=/bin/curl --retry-connrefused --retry 5 --connect-timeout 5 -s "http://localhost:8000/lights/rainbow?speed=slow"
KillMode=control-group
Type=forking
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

What problem were you having? Just a simple ExecStart seems to be working fine for me.

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.

3 participants