08-28-2020, 07:55 AM
######################################### Linux #############################################
Create an user for the desired service
Ensure the created user has full access to the binary you want to set up: wget https://raw.github.com/frdmn/service-dae...ter/debian -O /etc/init.d/example
sudo vi /etc/init.d/example
chmod +x /etc/init.d/example
update-rc.d example defaults
service example start
Example of the service file:
vim /etc/systemd/system/example.service
:'
[Unit]
Description=example
After=network.target nss-lookup.target mariadb.service
[Service]
Type=notify
WorkingDirectory=/opt/example
User=example
SyslogIdentifier=example
ExecStart=/opt/example/bin/example
TimeoutStartSec=3600
LimitNOFILE=49152
[Install]
WantedBy=multi-user.target