Before boot, I look at the /tmp/mycroft/ directory and see it is owned by pi:
$ ls -ld /tmp/mycroft
drwxr-xr-x 3 pi pi 4096 Jun 5 13:44 /tmp/mycroft
I reboot the system:
$ reboot
...
The Raspi goes down and comes back up and mycroft should be running, but it is not. I login and see that the ownership of /tmp/mycroft/ has been changed to root:
If you disable your Mycroft systemd service - set the owner as pi and reboot, does it change back to root?
i.e. is this being caused by that systemd service or is the directory being modified during boot by the system before Mycroft even launches?
Finally. Changing to Type=forking and adding an ExecPreStart line (and yes, the extra ā+ā is needed - itās like sudo) enable mycroft to run at boot time. Hereās the complete systemd file:
The distro is Raspberry Pi OS (aka Raspbian). I want the box to also be a general purpose computer as RasPis have just about enough horsepower these days ā¦
Strange that the error was there with āType=simpleā as systemd doesnāt write PID files with that type ?!?!? Anyhow, sometimes you just take the solution, even if you donāt understand why.
The proper fix for your ExecPreStart solution would be;
As root create a file /etc/tmpfiles.d/mycroft.conf with the below content;
d /tmp/mycroft 755 mycroft mycroft
At boot systemd as root user will takecare of creatin the mycroft folder there with the right permissions
@mshelby - thanks for the reply - Iāve had the startup script working for a while. I no longer have that line as /tmp/mycroft is owned by pi and it does not change. Hereās what I have now for reference:
[Unit]
Description=Mycroft AI
After=pulseaudio.service
[Service]
User=pi
WorkingDirectory=/home/pi/
ExecStart=/home/pi/mycroft-core/bin/mycroft-start all
ExecStop=/home/pi/mycroft-core/bin/mycroft-stop
Type=forking
Restart=no
Environment="XDG_RUNTIME_DIR=/run/user/500"
[Install]
WantedBy=multi-user.target