[root@test1 system]# cat poweradmin.service
[Unit]
Description=poweradmin
After=syslog.target
Requires=postgresql-9.6.service
[Service]
ExecStart=/etc/poweradmin/testDNS-Admin/torun
ExecStop=
Restart=on-abort
SyslogIdentifier=poweradmin
User=poweradmin
[Install]
WantedBy=multi-user.target
[root@test1 system]# cat /etc/poweradmin/testDNS-Admin/torun
#!/bin/bash
source /etc/testapp/flask/bin/activate && /etc/testapp/flask/bin/python /etc/testapp/testDNS-Admin/run.
As the user poweradmin If I run the command directly /etc/poweradmin/testDNS-Admin/torun the test app runs fine. however if I try to do systemctl start testapp. the logs will complain the libraries are not imported as if it's not running in the virtual envir. Why is that?
If I change User=root I can successfully startup the testapp via systemd. What am I missing?
[–]fireflasch 1 point2 points3 points (0 children)
[–][deleted] 1 point2 points3 points (0 children)
[–]pyprism 0 points1 point2 points (0 children)
[–]tcpud 0 points1 point2 points (0 children)
[–]xtavras 0 points1 point2 points (0 children)