Go to advanced search

by Raspy_D
Fri Jul 31, 2020 2:59 pm
Forum: Python
Topic: python with environment variable running at boot
Replies: 5
Views: 413

Re: python with environment variable running at boot

Can I ask you last support? I need the same before shutdown/reboot. I'm trying with something like this, but without success [Unit] Description=Running before shutdown. Requires=network.target Before=shutdown.target reboot.target [Service] Type=oneshot RemainAfterExit=true ExecStop=/usr/bin/python /...
by Raspy_D
Fri Jul 31, 2020 1:06 pm
Forum: Python
Topic: python with environment variable running at boot
Replies: 5
Views: 413

Re: python with environment variable running at boot

I solve the problem using User=pi in [Service] section
;-) thanks for support
by Raspy_D
Fri Jul 31, 2020 12:56 pm
Forum: Python
Topic: python with environment variable running at boot
Replies: 5
Views: 413

Re: python with environment variable running at boot

Hi. I made a test with partially good result.
Now the main program works perfectly, but it has a subrocess that requires some modules.
Now the error I got is

type 'exceptions.ImportError'
No module named xlrd

I use it for reading excel files
by Raspy_D
Fri Jul 31, 2020 7:07 am
Forum: Python
Topic: python with environment variable running at boot
Replies: 5
Views: 413

Re: python with environment variable running at boot

Thanks a lot ghp. I'll try as soon as I can.
I tryed making it start with several methods (crontab, normal end as root, systemd, etc)
the WorkingDirectory should be the one where my python script is, correct?
by Raspy_D
Thu Jul 30, 2020 10:05 pm
Forum: Python
Topic: python with environment variable running at boot
Replies: 5
Views: 413

python with environment variable running at boot

Hi to all, I know that the web is full of guides on how to start a python script at the boot, but I'm here to ask your help since I've unsuccessfully tried everything I could, everything I've found. The script by command line works great without any error/exception. After lots of trying I've underst...
by Raspy_D
Tue Jul 02, 2019 1:05 am
Forum: Italiano
Topic: Arrestare script al reboot / suthdown
Replies: 1
Views: 1179

Arrestare script al reboot / suthdown

Salve a tutti, forse il problema che sto ponendo è banale, ma ho speso davvero tanto tempo in lungo e largo senza trovare una soluzione. Ho uno script sempre attivo sul raspberry 3 con installato stretch. In pratica questo script ha all'interno un ciclo while che verifica che in un file di appoggio ...

Go to advanced search