User avatar
jadro
Posts: 409
Joined: Sun Oct 02, 2016 1:20 pm
Location: Croatia

Regular restart vs power on after electricity drop down

Sat Jun 22, 2019 7:08 am

Hi,

maybe is just coincidence, but couple of times...
When reboot my Raspberry pi after update and so, just regular (Raspbian Jessie) it reboot with my start script (autostart).
But when electricity goes down and came back, autostart does not start anytime.
Is there another Raspberry start mechanism on reboot or start no regulary?

Thanx,
Jadro
Oracle backend database developer
SmartHome IoT & Microprocessor enthusiast and hobbyist

Heater
Posts: 13100
Joined: Tue Jul 17, 2012 3:02 pm

Re: Regular restart vs power on after electricity drop down

Sat Jun 22, 2019 7:41 am

Why are you using Raspbian Jessie when it has been superseded by Raspbian Stretch for nearly two years?

The preferred way to start non-GUI programs is to use systemd. You only have to create a little simple systemd service file to do that.
For example like this: https://www.raspberrypi.org/forums/view ... 61#p921354

I can't see how system start up knows whether it is restarting from a power failure or warm reboot.

pcmanbob
Posts: 6651
Joined: Fri May 31, 2013 9:28 pm
Location: Mansfield UK

Re: Regular restart vs power on after electricity drop down

Sat Jun 22, 2019 10:22 am

Does what ever your auto start script is doing rely on networking ?

because after a power fail your networking may take longer to establish because your router will be rebooting too, so your auto start script will fail becuae it can't connect.
Last edited by pcmanbob on Sat Jun 22, 2019 7:44 pm, edited 1 time in total.
We want information… information… information........................no information no help
The use of crystal balls & mind reading are not supported

User avatar
jadro
Posts: 409
Joined: Sun Oct 02, 2016 1:20 pm
Location: Croatia

Re: Regular restart vs power on after electricity drop down

Sat Jun 22, 2019 7:40 pm

Heater wrote:
Sat Jun 22, 2019 7:41 am
Why are you using Raspbian Jessie when it has been superseded by Raspbian Stretch for nearly two years?

The preferred way to start non-GUI programs is to use systemd. You only have to create a little simple systemd service file to do that.
For example like this: https://www.raspberrypi.org/forums/view ... 61#p921354

I can't see how system start up knows whether it is restarting from a power failure or warm reboot.
Heater, I think is some fear about what can go wrong upgrading to Stretch because of programs have on raspberry and may be incompatible with Stretch. Long ago I start with upgrade but when settings about networking starts to ask me question like do you want blah blah, I did not understaind all question and I did not continue...
Oracle backend database developer
SmartHome IoT & Microprocessor enthusiast and hobbyist

User avatar
jadro
Posts: 409
Joined: Sun Oct 02, 2016 1:20 pm
Location: Croatia

Re: Regular restart vs power on after electricity drop down

Sat Jun 22, 2019 7:43 pm

pcmanbob wrote:
Sat Jun 22, 2019 10:22 am
Does what ever your auto start script is doing relay on networking ?

because after a power fail your networking may take longer to establish because your router will be rebooting too, so your auto start script will fail becuae it can't connect.
I think I do not have code that needs to do anything on network... maybe some imported modules from python... i dont know
Oracle backend database developer
SmartHome IoT & Microprocessor enthusiast and hobbyist

Heater
Posts: 13100
Joined: Tue Jul 17, 2012 3:02 pm

Re: Regular restart vs power on after electricity drop down

Sat Jun 22, 2019 9:09 pm

jadro,

I understand the fear of an operating system upgrade. People running important software will do a lot of testing of their applications on a new OS release before putting it into production.

Thing is, you will have to face moving to a new Raspbian release eventually.

Perhaps the best thing to do is get a new SD card, put the latest Raspbian release on it, get that up and running, then put your software on it and see if there are any problems.

If things are not working you can always go back to the old working version in your original SD card whilst you figure out what is wrong. It helps to have more than one Pi for this.

kaksi
Posts: 92
Joined: Tue Mar 10, 2015 6:19 am

Re: Regular restart vs power on after electricity drop down

Mon Jun 24, 2019 10:15 am

Heater wrote:
Sat Jun 22, 2019 9:09 pm
People running important software will do a lot of testing of their applications on a new OS release before putting it into production.
The trouble is that they do not rewrite and test my applications. I got more or less my camera working when the the PI3 came out - the conversion was a nightmare (because of permissions).

BTW, for how long is Python 2.7 deprecated?

Heater
Posts: 13100
Joined: Tue Jul 17, 2012 3:02 pm

Re: Regular restart vs power on after electricity drop down

Mon Jun 24, 2019 3:41 pm

I don't consider some changes in permissions as a breaking problem. Assuming they got tightened up for good reason not slacked off.

A bit annoying perhaps but trivial to attend to.

But that is the thing, if you really want to be sure your stuff will work on an OS change you have to check for all these little annoyances.

fruitoftheloom
Posts: 20484
Joined: Tue Mar 25, 2014 12:40 pm
Location: Delightful Dorset

Re: Regular restart vs power on after electricity drop down

Mon Jun 24, 2019 3:45 pm

jadro wrote:
Sat Jun 22, 2019 7:08 am
Hi,

maybe is just coincidence, but couple of times...
When reboot my Raspberry pi after update and so, just regular (Raspbian Jessie) it reboot with my start script (autostart).
But when electricity goes down and came back, autostart does not start anytime.
Is there another Raspberry start mechanism on reboot or start no regulary?

Thanx,
Jadro

Both Jessie and Stretch now replaced by Buster, time for a fresh install ??

https://www.raspberrypi.org/downloads/raspbian/
Retired disgracefully.....

User avatar
jadro
Posts: 409
Joined: Sun Oct 02, 2016 1:20 pm
Location: Croatia

Re: Regular restart vs power on after electricity drop down

Mon Jun 24, 2019 7:22 pm

Today i start to upgrade jessie to stretch. About one hour has upgraded but at least it was done. After reboot my new OS was unable to operate normaly. My mqtt server fails, mysql fails, my python installations like beautifulsoap fails, many things fails, then i restore my backup and i am back to jessie. Maybe more luck another time..
Oracle backend database developer
SmartHome IoT & Microprocessor enthusiast and hobbyist

User avatar
HawaiianPi
Posts: 4534
Joined: Mon Apr 08, 2013 4:53 am
Location: Aloha, Oregon USA

Re: Regular restart vs power on after electricity drop down

Mon Jun 24, 2019 8:24 pm

jadro wrote:
Mon Jun 24, 2019 7:22 pm
Today i start to upgrade jessie to stretch. About one hour has upgraded but at least it was done. After reboot my new OS was unable to operate
Upgrading from previous releases is not supported or recommended, and now you know why. Hopefully you made a backup.

Best bet is to copy any configuration files, scripts and data you need and start over with a fresh install.
My mind is like a browser. 27 tabs are open, 9 aren't responding,
lots of pop-ups...and where is that annoying music coming from?

User avatar
jadro
Posts: 409
Joined: Sun Oct 02, 2016 1:20 pm
Location: Croatia

Re: Regular restart vs power on after electricity drop down

Mon Jun 24, 2019 8:30 pm

HawaiianPi wrote:
Mon Jun 24, 2019 8:24 pm
jadro wrote:
Mon Jun 24, 2019 7:22 pm
Today i start to upgrade jessie to stretch. About one hour has upgraded but at least it was done. After reboot my new OS was unable to operate
Upgrading from previous releases is not supported or recommended, and now you know why. Hopefully you made a backup.

Best bet is to copy any configuration files, scripts and data you need and start over with a fresh install.
o yes, this will be my next step, someday, with fresh install.
Oracle backend database developer
SmartHome IoT & Microprocessor enthusiast and hobbyist

Return to “General discussion”