-the location of xxxx.service file

/etc/systemd/system/xxxx.service


-reload service(must be done after registration or file adjust)

 sudo systemctl daemon-reload


-check service registered properly

 sudo systemctl status xxxx.service -l


-start

sudo systemctl start lazarus-web



-working xxxx.service file

[Service]

Type=simple

#EnvironmentFile Don't need

#EnvironmentFile=/path/to/app/conf/application.conf

PIDFile=/path/to/app/RUNNING_PID

WorkingDirectory=/path/to/app

#the filename will be the bash script name

ExecStart=/bin/bash /path/to/app/bin/filename -Dhttp.port=80

Restart=on-failure

RestartSec=3

#User Don't need

#User=memememe

#Group Don't need

#Group=memememe


# See http://serverfault.com/a/695863

SuccessExitStatus=143


[Install]

WantedBy=multi-user.target

Posted by 타다키치
,