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