Created
January 17, 2023 19:43
-
-
Save theratman/a33936cbd509edbdc02890ea9dc7443c to your computer and use it in GitHub Desktop.
Converting Observium xinetd service to systemd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cat << EOF > /etc/systemd/system/observium_agent\@.service | |
[Unit] | |
Description=Observium Agent Service | |
After=network.target observium_agent.socket | |
Requires=observium_agent.socket | |
[Service] | |
Type=simple | |
User=root | |
# Note the - to make systemd ignore the exit code | |
ExecStart=-/usr/bin/observium_agent | |
# This is the part that makes it work like inetd | |
StandardOutput=socket | |
[Install] | |
WantedBy=multi-user.target | |
EOF | |
cat << EOF > /etc/systemd/system/observium_agent.socket | |
[Install] | |
WantedBy = sockets.target | |
[Unit] | |
Description=Observium Agent Socket | |
PartOf=observium_agent.service | |
[Socket] | |
ListenStream=36602 | |
Accept=yes | |
[Install] | |
WantedBy=sockets.target | |
EOF | |
systemctl daemon-reload | |
systemctl enable observium_agent.socket | |
systemctl start observium_agent.socket |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Tested on Rocky Linux 9.1