Now, I would like to run automatically the RA_LCD_Buttons.py script at boot. I read that you failed, so I also try.
Following several post in that topic, and also the systemd documentation, I created a new service:
/usr/lib/systemd/system/ra-lcd-buttons.service
- Code: Select all
[Unit]
Description=RA_LCD_Buttons service
After=system-modules-load.services
[Service]
Type=simple
ExecStart=/usr/bin/python2 /root/RA_LCD_Buttons.py >/dev/null 2>&1
[Install]
WantedBy=multi-user.target
then I enable the service by
- Code: Select all
systemctl enable ra-lcd-buttons.service
If I launch it manually, it works perfectly
- Code: Select all
systemctl start ra-lcd-buttons.service
but after reboot the script is not launched. It failed. When I check the status I have
- Code: Select all
systemctl status ra-lcd-buttons.service
* ra-lcd-buttons.service - RA_LCD_Buttons service
Loaded: loaded (/usr/lib/systemd/system/ra-lcd-buttons.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Thu 1970-01-01 01:00:10 CET; 45 years 11 months ago
Main PID: 180 (code=exited, status=1/FAILURE)
If I check with
- Code: Select all
systemctl list-unit-files
it appears correctly in the list with the satus enabled.
I guess there is a dependancy error and that the Python script is starting too early, i.e. before MPD. I tried several solution:
1/ After=mpd.service
2/ Type=idle
3/ ExecStart in /etc/, in /root/, Python file, Bash file...
but without any succes.
What's going wrong?
I would appreciate any help. Thank you.
Matock