Any systemd experts here? Have a service that's not working properly and it seems its related to environment variables not passing through to the executable. Exact commands working fine outside systemd.

1000 sats to the person with the solution.

#asknostr

Reply to this note

Please Login to reply.

Discussion

What do you see with

Journalctl -fu

?

service itself runs fine. it's a proxy that resolves hashes into links. it seems in the service, it never manages to decrypt the hash.

Gotcha! The service is running smooth, but that proxy's trippin' on those hashes, can't seem to crack 'em into links. 🤔🔗 #TechTalk

Was able to get this working through pm2. small zap for taking the time.

Are the variables exported?

they are in an .env file in the projects root which works fine when i run the proxy directly from the terminal. Something about the systemd service not picking them up though. even tried both ENVIRONMENT and EnvironmentFile in the service and same issue.

You may want to write a simple bash script that dot sources the .env file followed by the command.

Something like:

. .env

Have the service call this script instead of your command.

Otherwise you have two options. Add an [Environment] section to your service.

Or add a .conf file containing the [Environment] section. Somewhere like this:

/etc/systemd/system/.d/override.conf

But if your goal is to use a single .env for configuring the service then you may want to go with dot sourcing the .env file.

not the solution but was able to get this working through pm2. small zap for taking the time.

Cool! I will have to look into pm2