Help figure out why systemd is not running the binary file. The environment variable .env is not getting loaded in the binary file
Did you tell systemd to use the .env
file?
[service]
EnvironmentFile=/path/to/.env
Should usually work.
Here is how I did it on Debian:
First i created a service:
/etc/systemd/system/site.service
[Unit]
Description=gowebdev
[Service]
Type=simple
User=root
Restart=always
RestartSec=5s
WorkingDirectory=/var/www/gowebdev
ExecStart=/var/www/gowebdev/main
[Install]
WantedBy=multi-user.target
You have to reload systemd
systemctl daemon-reload
and restart the service
service go4webdev restart (replace with your own "service name")
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.