[Service]
Type = forking
PIDFile = /var/run/learninglocker.pid
ExecStart = /usr/bin/npm start
WorkingDirectory = /opt/learninglocker
User = root
Group = root
EnvironmentFile = /opt/learninglocker/environment
StandardOutput = syslog
StandardError = syslog
SyslogIdentifier = learninglocker
LimitCORE = infinity
LimitNOFILE = infinity
LimitNPROC = infinity
TimeoutStartSec = "2min 30s"
[Unit]
After = network.target
[Install]
WantedBy = multi-user.target
It is a node application.
When I run "npm start", it gets executed and runs four different processes. But, when I run "systemctl start learninglocker.service", it runs for few seconds [i.e active (running)] and fails and again the four processes are running behind.
My question is: Is it ok if I use Type = Simple or should I use "forking"?
If use Type "forking", service is getting "failed" with no error message.