Last active
June 12, 2024 02:53
-
-
Save dillera/4bbd333d8cc96b90e6a3d63b729845ba to your computer and use it in GitHub Desktop.
BASH commands to save a systemd service file to start the udp_firewall.js script on boot.
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/udp-firewall.service | |
[Unit] | |
Description=UDP Firewall Service | |
After=network.target | |
[Service] | |
ExecStart=/usr/bin/node /usr/local/bin/udp_firewall.js | |
Restart=always | |
User=root | |
Group=root | |
Environment=PATH=/usr/bin:/usr/local/bin | |
Environment=NODE_ENV=production | |
[Install] | |
WantedBy=multi-user.target | |
EOF | |
........................ | |
sudo systemctl daemon-reload | |
sudo systemctl enable udp-firewall.service | |
sudo systemctl start udp-firewall.service | |
sudo systemctl start udp-firewall.service | |
sudo systemctl stop udp-firewall.service | |
disable: | |
sudo systemctl disable udp-firewall.service | |
sudo systemctl enable netfilter-persistent | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
in /var/log/syslog....
00:00 lovo1 systemd[1]: Started udp-firewall.service - UDP Firewall Service.
00:00 lovo1 node[36049]: UDP server listening on 0.0.0.0:6677