I am following the instructions outlined here: https://github.com/MichMich/MagicMirror/wiki/Auto-Starting-MagicMirror
When I paste in the suggested code provided by PM2 an error is returned. I am a total Noob and not sure how to proceed. Here is the error:
pi@mm1:~/MagicMirror $ sudo env PATH=$PATH:/usr/bin /usr/lib/node_modules/pm2/bin/pm2 startup systemd -u pi --hp /home/pi
[PM2] Init System found: systemd
Platform systemd
Template
[Unit]
Description=PM2 process manager
Documentation=https://pm2.keymetrics.io/
After=network.target
[Service]
Type=forking
User=pi
LimitNOFILE=infinity
LimitNPROC=infinity
LimitCORE=infinity
Environment=PATH=/usr/bin:/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin
Environment=PM2_HOME=/home/pi/.pm2
PIDFile=/home/pi/.pm2/pm2.pid
ExecStart=/usr/lib/node_modules/pm2/bin/pm2 resurrect
ExecReload=/usr/lib/node_modules/pm2/bin/pm2 reload all
ExecStop=/usr/lib/node_modules/pm2/bin/pm2 kill
[Install]
WantedBy=multi-user.target
Target path
/etc/systemd/system/pm2-pi.service
Command list
[ 'systemctl enable pm2-pi',
'systemctl start pm2-pi',
'systemctl daemon-reload',
'systemctl status pm2-pi' ]
[PM2] Writing init configuration in /etc/systemd/system/pm2-pi.service
[PM2] Making script booting at startup...
>>> Executing systemctl enable pm2-pi
[DONE]
>>> Executing systemctl start pm2-pi
Job for pm2-pi.service failed because the control process exited with error code.
See "systemctl status pm2-pi.service" and "journalctl -xe" for details.
[ERROR] Exit code : 1
[PM2][ERROR] systemctl start pm2-pi failed, see error above.
Thanks in advance for any and all assistance.
Johnny