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