Autostart for Raspberry Pi Bookworm

Hi
I’ve updated my Pi4B recently to Bookworm, and running wayfire desktop. No issues running WD after a few tweaks. WD and OS runs on an SSD

However every few days my Pi locks up - essentially all i get is a blank screen and a flashing cursor. It also means I can’t get my clientraw (etc) files out to my webserver.

I now have watchdog running - hopefully that will perform a restart when needed, but I can’t figure out how to auto start consolewd on reboot.

If starting manually I run a shell script (a_start.sh) that basically calls ./consolewd. Also included in the shell script is a line to run a_webcam which is my webcam setup / download / send file to server script.

I’ve tried editing the wayfire.ini file which seems to be the easiest way to autorun, by adding the following:

[autostart]
consolewd=/home/andrew/consolewdfiles/a_start.sh

but had no luck with this version. A previous version dumped the clientraw.txt files in another folder, which I corrected using the consolewd.ini file, but the actual file sent ended up being the same file all the time (ie no update) - weird!

I’ve tried a couple of other solutions - .desktop files and cron entries (using @reboot) but had no luck.

Everything works fine if I start it manually until the pi freezes so I don’t think this is a WD issue.

I’d prefer not to roll back to the X desktop, and ideally I’d like to understand why the Pi is freezing (which may include a clean OS reinstall). In the meantime though does anyone have a tried and tested way of doing an autostart on restart for consoleWD on Bookworm?

Thanks in advance

I’ve not done it on Bookworm but I think you should be able to run consolewd as a service which can then be set to run at startup. This post gives details of how to do it - https://discourse2.weather-watch.com/t/running-consolewd-in-the-background-using-serviced/68541

Ahh - I did see that post, but didn’t read far enough into it to see it solved the autostart issue.

So reporting back, it does work on Bookworm. I got a bit lost with some of the sudo commands in the document, but gradually figured it out.

All that said, I don’t think the auto restart has ever been used in anger as I think I solved my problem. My webhost was continually blocking my IP address because I had an email account with the wrong password on it, triggering a firewall rule when requesting email, and that resulted in my IP address being blocked on their f/w. I installed AdGuard and blocked the suspect device from accessing the mail server, and that meant I no longer get blocked. by the hosts f/w

I use rsync to get my files to the server and I suspect that when the hosts f/w blocked my ip address, rsync didn’t know how to manage it and this eventually left the pi in an unresponsive state.

Anyway both problems solved and I now have consoleWD running as a service.

Thanks heaps!

1 Like