Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

systemd scripts for xlxd #185

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions scripts/scripts.readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@
*copy ambed.service to /etc/systemd/system/
*copy watchdog to /ambed/
*************************************************
* If you want to use systemd for xlxd:
* copy xlxd.service to /etc/systemd/system
* copy xlxd.default to /etc/default/xlxd
* edit /etc/default/xlxd to suit the local install
* systemctl daemon-reload
*************************************************
* xlxd executable must be in /xlxd/ folder
* ambed executable must be in /ambed/ folder
*************************************************
Expand Down
10 changes: 10 additions & 0 deletions scripts/xlxd.default
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# This is used by xlxd.service. Note this is shellcode sourced by xlxd.service

Choose a reason for hiding this comment

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

Suggested change
# This is used by xlxd.service. Note this is shellcode sourced by xlxd.service
# This is a systemd environment file loaded by xlxd.service


# Enter XLX name/number here
REFLECTOR="XLXnnn"

# Enter IP for binding here
BIND_IP="0.0.0.0"

# Change this is ambed is running on a different host
AMBED_IP="127.0.0.1"
16 changes: 16 additions & 0 deletions scripts/xlxd.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[Unit]
Description=XLXD Multiprotocol Reflector
After=network.target ambed.service

[Service]
Type=forking

Choose a reason for hiding this comment

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

for running in systemd, it would make more sense to compile it to not use the deamon mode and say simple. Then you can even use stdout / stderr for logging if you want.

User=root
Group=root
EnvironmentFile=/etc/default/xlxd
ExecStart=/xlxd/xlxd ${REFLECTOR} ${BIND_IP} ${AMBED_IP}
ExecStartPost=/bin/sh -c 'umask 022; pgrep xlxd > /var/log/xlxd.pid'
Restart=on-abnormal
PIDFile=/var/log/xlxd.pid

Choose a reason for hiding this comment

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

this is a bad place for a pid file - should belong somewhere under /var/run/xlxd.pid

Actually it would make sense if the service would be able to write that file by itself.

It would be even better if the service would be of type notify because then it can tell systemd when it is actually ready, but then you need to link against libsystemd. See sd_notify.


[Install]
WantedBy=multi-user.target