I have been playing around with it for a little while but am pretty stuck with creating a service to run a script. The script I am trying to run is as follows.
#!/bin/sh
while true
do
sudo bbb-record --rebuildall
sleep 300
done
I tried creating a daemon for this to run like:
[Unit]
Description=bbb-rebuild
[Service]
ExecStart=/home/sysadmin/rebuild
Restart=always
[Install]
WantedBy=multi-user.target
exit=0
I get the error message
==== AUTHENTICATION COMPLETE ===
Failed to start rebuild.service: Unit rebuild.service is not loaded properly: Invalid argument.
See system logs and 'systemctl status rebuild.service' for details.
after checking status
Apr 22 16:46:55 bbb2 systemd[1]: rebuild.service: Unit entered failed state.
Apr 22 16:46:55 bbb2 systemd[1]: rebuild.service: Failed with result 'exit-code'.
Apr 22 16:46:55 bbb2 systemd[1]: rebuild.service: Service hold-off time over, scheduling restart.
Apr 22 16:46:55 bbb2 systemd[1]: Stopped bbb-rebuild.
Apr 22 16:46:55 bbb2 systemd[1]: rebuild.service: Start request repeated too quickly.
Apr 22 16:46:55 bbb2 systemd[1]: Failed to start bbb-rebuild.
Apr 22 16:46:55 bbb2 systemd[1]: rebuild.service: Unit entered failed state.
Apr 22 16:46:55 bbb2 systemd[1]: rebuild.service: Failed with result 'start-limit-hit'.
Apr 22 16:47:22 bbb2 systemd[1]: [/etc/systemd/system/rebuild.service:12] Missing '='.
sudo
in the script? – user535733 Apr 22 '20 at 18:47[/etc/systemd/system/rebuild.service:12] Missing '='.
suggests a hidden characters or wrong encoding present in the file. I would suggest runningdos2unix
on the file. See this answer for information. – Raffa Apr 22 '20 at 19:39