[SOLVED] "when System started" rules don't run on reboot

Running OpenHAB 2.3.0-1 on an RPi (OpenHABian).

I have a cron job set up to reboot the pi nightly; a few days ago, all instances of “when System started” rules stopped running after the nightly reboot.

If I just stop/start the OpenHAB service, the rules run correctly. But when the service is automatically started after a reboot, they don’t.

No errors are logged.

Any suggestions?

That is a strange problem! I don’t mean to focus on the not problem, may I ask though why reboot every night?

Even with a reboot though it should all work properly.

There’s a difference between system reboot and openHAB restart - there is other non-OH stuff going on, which may cause different timings and sequences during OH start up.

May I ask how you know the rules aren’t running? (as opposed to not having the effects you want).
I’m suggesting a simple logInfo() or such as the first line in a rule, to prove a point.

1 Like

May I ask how you know the rules aren’t running?

I start the rules with a log line.

There’s a difference between system reboot and openHAB restart - there
is other non-OH stuff going on, which may cause different timings and sequences
during OH start up.

Interesting point. As an experiment, maybe I’ll try replacing the full reboot with just restarting OpenHAB for now.

may I ask though why reboot every night?

I’m sure it’s overkill, but it’s to keep the system as clean as possible. I started doing it when I encountered the problem where rules would stop triggering after OpenHAB had been running for a few days (there are threads about it on this forum).

Well… So now “System started” rules don’t run at all, even when just restarting the OpenHAB service. It worked this morning, but no longer.

Running on sd card?

Strange behavior sometimes means it’s dying…

Happened to me.

Yes, it’s on an SD card. Did you see other symptoms of card failure? Is there a reliable way to test whether that’s the issue?

Thanks!

I DOnt know how to test. My problem started that the logging did not work. I didn’t suspect the sad card until a few days later. Basically the logging just quit, but I could manually crate files and such.

A few days later some automatic lights did not function properly. I did not change my rules so I had no clue what was happening. I rebooted and got tied up with work. The next day I could not ssh into my pi, that’s when I knew I had a failing card.

I am not saying it is definitely the problem, but it could be. I expressed my concern as I don’t want you to be surprised if it was. You could be prepared and have a secondary on hand.

In fact that might be the best way to see if it is the problem. Move to a new one if everything works you know. Make sure to use a new install of openHAB as files could get corrupt.

Solved. Looks like it’s the old “duplicate rule names” problem; I had multiple system started rules named “system startup”, so only the first one that happened to be called would run.

3 Likes

Okeydoke, not quite all instances not running then.

Same here.
But you can open your browser … press F12 … clear the log by pressing the trashcan.
then you click the play button of your rule.
You will see a line appearing in the log.
Right click --> copy cURL (POSIX) and enter that in crontab to run after reboot.
I set my rules to run once at 5 am sequentially.

Hope that helps

It appears your issue pertains to the new rule engine and not duplicate rule names as was reported by the OP two years ago. Thank you for your contribution, but please start a new topic. Most likely, you are experiencing this…

… or this…

Aaah.
thanks i will consider.