0

I have written a python script that displays the image from the URL.

def image_func(link_image):
    img_cmd = "feh -F %s" %(link_image)
    os.system(img_cmd)
    os.system("pkill feh")

If I run the python program directly using

python main.py

it runs without any issue.

But if I run from the .service file .. it throws this error.

feh error you have no home cannot read themes

I am running this from the root terminal rather than the user terminal.

.service file

[Unit]
Description=My device boot script service
After=multi-user.target

[Service]
Type=idle
user=fa
Environment=DISPLAY=:0
Restart=always
ExecStart=/root/MediaPlayer/venv/Include/start.sh > /dev/null

[Install]
WantedBy=multi-user.target
  • Does the "fa" user have access to /root/...? – dsstorefile1 Aug 29 '18 at 8:27
  • yes.. it does have access – ron123456 Aug 29 '18 at 9:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.