nano /etc/systemd/system/your_service_name.service
[Unit]
Description=Your Service Description
After=network.target

[Service]
Type=simple
WorkingDirectory=/path/to/your_script.sh
ExecStart=/path/to/your_script.sh
Restart=on-failure
User=username
Group=groupname
LimitNOFILE=infinity

[Install]
WantedBy=multi-user.target
systemctl daemon-reload
systemctl enable your_service_name
systemctl start your_service_name
systemctl status your_service_name

Leave a Reply

Your email address will not be published. Required fields are marked *