docs / linux / create-systemctl-service-service

create systemctl service.service

linux updated 2026-08-08

nano /etc/systemd/system/radio-ipv6.service

Create /etc/systemd/system/radio-ipv6.service:

textcopy
[Unit]
Description=Radio IPv6 listener ramp
After=network-online.target
Wants=network-online.target

[Service]
Type=simple
User=root
WorkingDirectory=/root
ExecStart=/usr/bin/python3 /root/radio_ipv6.v2.py \
  --stream-url https://xxx/listen/radioromania/radio.mp3 \
  --hold-seconds 60000 \
  --ramp-step 20 \
  --start-listeners 10 \
  --target-listeners 1000 \
  --ramp-interval 30 \
  --total-runtime 180000
Restart=always
RestartSec=10
# Optional: survive OOM a bit longer / see why it dies
OOMScoreAdjust=-500
StandardOutput=append:/var/log/radio-ipv6.log
StandardError=append:/var/log/radio-ipv6.log

[Install]
WantedBy=multi-user.target

Enable and start:

bashcopy
systemctl daemon-reload
systemctl enable --now radio-ipv6.service
systemctl status radio-ipv6.service
journalctl -u radio-ipv6.service -f

If it dies again, check: