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