2

Ubuntu 18.04

foundry-error.service

[Unit]
Description= /home/man/errorpage/error_pages.js - User errorpage.
Documentation=https://blah.com
After=network.target

[Service]
Environment=NODE_PORT=%i

Type=simple
User=man
ExecStart=/usr/bin/node /home/man/errorpage/error_pages.js
Restart=on-failure

[Install]
WantedBy=multi-user.target

I try to pass the port to the start up.

systemctl start foundry-error@8000
systemctl start foundry-error@8000.service
systemctl start foundry-error.service@8000

All of these iterations come back with "Unit ... not found." So I am not sure how to pass the port # in as I need to pass in 3 different ports. I have done this from root, and from sudo man. All to the same issue.

Kevin Bowen
  • 19,395
  • 55
  • 76
  • 81
Daxcor
  • 43
  • 3
  • 1
    Does this answer your question? [How do I pass flags when starting a systemd service?](https://askubuntu.com/questions/1077778/how-do-i-pass-flags-when-starting-a-systemd-service) – guntbert Feb 02 '20 at 22:14

1 Answers1

1

The service file should be named foundry-error@.service. Yours is missing the at sign. Also, make sure it is in the correct directory (usually /etc/systemd/system/).

The first two ways of invoking the service are correct. The last one is invalid.

JayEye
  • 1,023
  • 8
  • 20