Replies: 1 comment
-
Just as an update this needs to be changed on the worker and scheduler systemd files as well. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I was following the installation guide setting up the systemd files and I ran into some some issues with environment variables. Adding additional environment variables to
~/.bashrc
using theexport
didn't load these in at runtime. This caused the service not to start because the database password was an empty string. This is because even though we hadUser=nautobot
in the service definition, the service is ran as the root user.One solution was to manually input these in
nautobot_config.py
, however I'm not a fan of storing passwords in config files like this.I know this topic is a big discussion itself :)
I worked around this by adding a dedicated .env file. This allows the nautobot user and the service to have access to the same environment variables.
switch to nautobot user
add NAUTOBOT_ROOT to env file
change permissions so only nautobot can access it
add at the bottom of ~/.bashrc
add any other env variables to this file specified in nautobot_config.py
log out of the nautobot user and edit the systemd service
edit the service - Replace Environment with EnvironmentFile
reload the systemd daemon
switch to nautobot user and test that the environment variables are working
Beta Was this translation helpful? Give feedback.
All reactions