systemctl start myapp.service
Hello Community!
I have a Problem with starting my application via systemctl command. The application run under a non root user and If i start the app with the Systemctl command, neccessary Environment variables doesn't apply. I have set the User in the /etc/systemd/System/myapp.service file Code:
[Service] /home/myuser/.bash_profile are working. How can I configure systemd, that only for myapp.service additional Environment Settings should be applied? Thanks Richi |
I imagine this is for the same reasons you have when doing things through cron or older init scripts. To whit: The user environment is NOT invoked by background processes as it is by login shells.
Read this blog I wrote that talks about other things you'd need to include for a script running in cron or init. You likely need them for systemd as well. https://www.linuxquestions.org/quest...-script-36931/ I found another link that talks about setting environment variables in systemd unit files: https://coreos.com/os/docs/latest/us...emd-units.html Using the principles from the first link and the method in the second link you should be able to determine what you need to add to your unit file. |
|
Quote:
That helps! Thank you |
All times are GMT -5. The time now is 11:03 PM. |