# copy this file into /etc/systemd/system
# mkdir comment_app_backend in /var/log
# then, start the service using command below
# $ systemctl start comment_app_backend
# to stop use it as
# $ systemctl stop comment_app_backend
[Unit]
Description=Comment App Backend Module
ConditionPathExists=/home/mohan/projects/comment_app_backend
After=network.target
StartLimitIntervalSec=0
[Service]
Type=simple
Restart=always
RestartSec=1
User=mohan
WorkingDirectory=/home/mohan/projects/comment_app_backend
ExecStart=/home/mohan/projects/comment_app_backend/comment_app_backend
# make sure log directory exists and owned by syslog
PermissionsStartOnly=true
ExecStartPre=/bin/mkdir -p /var/log/comment_app_backend
ExecStartPre=/bin/chown syslog:adm /var/log/comment_app_backend
ExecStartPre=/bin/chmod 755 /var/log/comment_app_backend
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=comment_app_backend
[Install]
WantedBy=multi-user.target