# # Service file # To make todo_app as a service # # # Step 1: Copy this service file into system # $ sudo cp todo_app.service /etc/systemd/system # # Step 2: Make a log directory # $ sudo mkdir /var/log/todo_app # # Step 3: Start the service # $ sudo systemctl start todo_app # # Step 4: Check the status of the service # $ sudo systemctl status todo_app # # Step 5: Check the net status # $ sudo netstat -ntlp [Unit] Description=Todo App Module ConditionPathExists=/home/mohan/projects/todo_app After=network.target StartLimitIntervalSec=0 [Service] Type=simple Restart=always RestartSec=1 User=mohan WorkingDirectory=/home/mohan/projects/todo_app ExecStart=/home/mohan/projects/todo_app/todo_app # make sure log directory exists and owned by syslog PermissionsStartOnly=true ExecStartPre=/bin/mkdir -p /var/log/todo_app ExecStartPre=/bin/chown syslog:adm /var/log/todo_app ExecStartPre=/bin/chmod 755 /var/log/todo_app StandardOutput=syslog StandardError=syslog SyslogIdentifier=todo_app [Install] WantedBy=multi-user.target