I have created a systemd
service that has to run forever (because it does the main job on my embedded computer):
# /etc/systemd/system/samplerbox.service
########################################
[Unit]
Description=Starts SamplerBox
[Service]
Type=oneshot
ExecStart=/root/SamplerBox/samplerbox.sh
WorkingDirectory=/root/SamplerBox/
[Install]
WantedBy=multi-user.target
Here is what it actually does:
# /root/SamplerBox/samplerbox.sh
################################
#!/bin/sh
python /root/SamplerBox/samplerbox.py
I enabled this service with
systemctl enable /etc/systemd/system/samplerbox.service
It works, and it is started on boot.
However, since I enabled this service, when I do systemd-analyze
, I see:
Bootup is not yet finished. Please try again later.
Moreover, I get this information showing that the service is still seen as "activating" / starting :
# systemctl status samplerbox
â samplerbox.service - Starts SamplerBox
Loaded: loaded (/etc/systemd/system/samplerbox.service; enabled)
Active: activating (start) since Thu 1970-01-01 00:14:01 UTC; 11min ago
Main PID: 258 (samplerbox.sh)
CGroup: /system.slice/samplerbox.service
ââ258 /bin/sh /root/SamplerBox/samplerbox.sh
ââ260 python /root/SamplerBox/samplerbox.py
How to properly make a service run forever?