Skip to content

Instantly share code, notes, and snippets.

@penguinpowernz
Created April 17, 2021 13:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save penguinpowernz/eea6b7a47e350481ceab205a721c3da2 to your computer and use it in GitHub Desktop.
Save penguinpowernz/eea6b7a47e350481ceab205a721c3da2 to your computer and use it in GitHub Desktop.
Multi Tenant node-red

Multi Tenant node-red

Copy the files into the recommended places.

Then to run the service for a user that is installed on your system do:

systemctl start node-red@jim node-red@bob
systemctl enable node-red@jim node-red@bob

It will not work if the user is not present on the system, or the port does not exist in the default file.

bob_port=1881
jim_port=1882
prod_port=1883
[Unit]
Description=The NodeRed
After=syslog.target network.target
[Service]
Type=simple
User=%I
Group=%I
Nice=5
KillSignal=SIGINT
EnvironmentFile=/etc/default/node-red
ExecStart=/usr/bin/node-red -v -p ${%I_port}
Restart=on-failure
WorkingDirectory=/home/%I
StandardOutput=syslog
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment