Skip to content

linux binary systemctl service #693

Answered by 91320113
91320113 asked this question in Q&A
Discussion options

You must be logged in to vote

/etc/systemd/system/ddns-updater.service:

[Unit]
Description=DDNS Updater
After=network.target network-online.target
Requires=network-online.target
StartLimitBurst=5
StartLimitIntervalSec=10

[Service]
Type=simple
Restart=on-failure
RestartSec=1
ExecStart= /usr/bin/ddns-updater/init.sh
AmbientCapabilities=CAP_NET_ADMIN CAP_NET_BIND_SERVICE

[Install]
WantedBy=multi-user.target

/usr/bin/ddns-updater/init.sh:

#!/bin/bash
cd /usr/bin/ddns-updater && ./ddns-updater --period=20s --update-cooldown-period=1m
exit 1

This works and restarts if kill -9 the process, ugly solution but working for now.

Thank you

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@91320113
Comment options

Comment options

You must be logged in to vote
1 reply
@qdm12
Comment options

Answer selected by 91320113
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants