0

I tried to run the node application in production environment with nohup. below is my script file, service file and error report

hemant@zero-ui:/etc/systemd/system$ cat /home/hemant/zeroui.sh 
#!/bin/bash
sudo -i
cd zero-ui
nohup yarn dev &
cd

hemant@zero-ui:/etc/systemd/system$ cat zeroui.service
[service]
Type=forking
ExecStart=/home/hemant/zeroui.sh
RemainAfterExit=yes

hemant@zero-ui:/etc/systemd/system$ sudo systemctl start zeroui
Failed to start zeroui.service: Unit zeroui.service has a bad unit file setting.
See system logs and 'systemctl status zeroui.service' for details.

hemant@zero-ui:/etc/systemd/system$ systemctl status zeroui.service 
● zeroui.service
     Loaded: bad-setting (Reason: Unit zeroui.service has a bad unit file setting.)
     Active: inactive (dead)

May 09 06:43:31 zero-ui systemd[1]: /etc/systemd/system/zeroui.service:1: Unknown section 'service'. Ignoring.
Hemant
  • 1
  • 1
  • 3

1 Answers1

1

The error message tells you what the problem is:

May 09 06:43:31 zero-ui systemd[1]: /etc/systemd/system/zeroui.service:1: Unknown section 'service'. Ignoring.

You have [service] in your service file instead of [Service] (case-sensitive)

Brendan
  • 908
  • 2
  • 15
  • 30