I am trying to set the service using the following file
[Unit]
Description=NodeBB
Documentation=https://docs.nodebb.org
After=system.slice multi-user.target postgresql.service
[Service]
Type=forking
User=nodebb
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=nodebb
Environment=NODE_ENV=production
WorkingDirectory=/var/www/html/nodebb
PIDFile=/var/www/html/nodebb/pidfile
ExecStart=/usr/bin/env node loader.js
Restart=always
[Install]
WantedBy=multi-user.target
Nodebb starts alright but I keep seeing this error in the service status.
nodebb.service: Can't open PID file /var/www/html/nodebb/pidfile (yet?) after start: Operation not permitted
The permissions of the pidfile are as follows.
-rw-r--r-- 1 nodebb nodebb 5 Sep 11 13:12 /var/www/html/nodebb/pidfile
I am trying to run on Ubuntu 22.04 server. Can you guide me on how to go about fixing this?