Service preset disabled

I wrote a service and placed it at /storage/.config/system.d/autocover.service . I then ran reload , enable , and start for it. However, after rebooting the system, the service remains in an inactive state. Checking its status shows that preset is disabled . Use systemctl start autocover.service,it can work properly.How can I configure it to start automatically at boot?

[Unit]
Description=AutoCover Service (Kodi启动后延迟1分钟运行)
After=network.target kodi.service
Requires=kodi.service
StartLimitIntervalSec=60s

[Service]
Type=simple
ExecStartPre=/bin/sleep 60
ExecStart=/opt/bin/python3 /storage/autocover/main.py
Restart=on-failure
RestartSec=10
WorkingDirectory=/storage/autocover
User=root

[Install]
WantedBy=multi-user.target

For a start result of

systemctl status autocover.service --no-pager
journalctl -l | grep autocover

Maybe change Description to plain ascii?

For sleep use real path /usr/bin/sleep.

Those are 2 commands not 1 !

systemctl status autocover.service --no-pager | paste
journalctl -l | grep autocover  | paste

and post both url. Why pasting image if you can copy/paste text …

And do you have file /storage/.config/system.d/multi-user.target/autocover.service ? It should be symbolic link to /storage/.config/system.d/autocover.service.

ls -l /storage/.config/system.d/multi-user.target/autocover.service

CoreELEC:~ # systemctl status autocover.service --no-pager | paste
https://paste.coreelec.org/PledgesMartinis
CoreELEC:~ # journalctl -l | grep autocover | paste
https://paste.coreelec.org/SemtexKeycard

CoreELEC:~ # ls -l /storage/.config/system.d/multi-user.target/autocover.service
ls: /storage/.config/system.d/multi-user.target/autocover.service: No such file or directory
systemctl enable autocover.service

and then reboot and do both paste again

Jun 18 19:24:11 CoreELEC systemd[1]: autocover.service: Found ordering cycle on kodi.service/start
Jun 18 19:24:11 CoreELEC systemd[1]: autocover.service: Found dependency on kodi-autostart.service/start
Jun 18 19:24:11 CoreELEC systemd[1]: autocover.service: Found dependency on graphical.target/start
Jun 18 19:24:11 CoreELEC systemd[1]: autocover.service: Found dependency on multi-user.target/start
Jun 18 19:24:11 CoreELEC systemd[1]: autocover.service: Found dependency on autocover.service/start
Jun 18 19:24:11 CoreELEC systemd[1]: autocover.service: Job kodi.service/start deleted to break ordering cycle starting with autocover.service/start

I think this matters.i tried another version service.system is broken,i will reinstall ce and have try.

I use autostart.sh to make it.

sleep 10
/opt/bin/python3 /storage/autocover/main.py &

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.