the systemd service as shown below fails to run with the error show
below - we cannot figure out why. Can someone explain what is wrong
with the setup and/or show a setup that works ?
any help greatly appreciated
as info: we can run "node server.js" from the command line as below:
cd /home/webpage/web
node server.js
==> Express server listening on port 8000
our setup
ls -l /home/webpage/web/
-rw-r--r-- 1 1001 1001 7461 Apr 9 06:51 server.js
ls -l /etc/systemd/system
-rw-r--r-- 1 root root 352 Apr 11 07:23 webpage.service
sudo vim /etc/systemd/system/webpage.service
[Unit]
Description=systemd for webpage
After=network.target
[Service]
ExecStart=/usr/local/bin/node /home/webpage/web/server.js
Restart=always
RestartSec=10
StandardOutput=syslog
StandardError=syslog
User=nginx
Group=nginx
Environment=NODE_ENV=production PORT=8000
WorkingDirectory=/home/webpage/web
[Install]
WantedBy=multi-user.target
$ sudo service webpage restart
Failed to restart webpage.service: Unit webpage.service failed to
load: Invalid argument. See system logs and 'systemctl status
webpage.service' for details.
sudo vim /var/log/syslog
jessie kernel: iptables denied: IN=eth0 OUT=
MAC=fe:fd:45:a4:cf:af:84:78:ac:5a:0b:41:08:00 SRC=93.174.93.94
DST=69.164.207.175 LEN=40 TOS=0x00 PREC=0x00 TTL=245 ID=27620 PROTO=TCP
SPT=43887 DPT=5901 WINDOW=1024 RES=0x00 SYN URGP=0
any ideas what is wrong ?