Ernst
Posts: 693
Joined: Sat Feb 04, 2017 9:39 am
Location: Germany

Re: Stretch reboot and shutdown command syntax has changed!

Sun Oct 21, 2018 8:16 am

rpdom wrote:
Sun Oct 21, 2018 8:05 am
Ernst wrote:
Sun Oct 21, 2018 6:49 am
Can you please post an extract of from the shutdown man in Wheezy ?
The manpage is the same in Wheezy as it is in Jessie (I have systems running both for testing purposes).

Code: Select all

       -t sec Tell init(8) to wait sec seconds between sending processes the warning and the kill
              signal, before changing to another runlevel.
That is not the point, I think it is time to give up with this lot because I am wasting my time.
My first computer was an ICT1500, my first "personal" computer was the Science of Cambridge Mk14, followed by a TRS-80 Model I later

User avatar
rpdom
Posts: 12855
Joined: Sun May 06, 2012 5:17 am
Location: Ankh-Morpork

Re: PiZeroW - Reboot and shutdown no longer work

Sun Oct 21, 2018 8:50 am

Ernst wrote:
Sun Oct 21, 2018 8:16 am
That is not the point, I think it is time to give up with this lot because I am wasting my time.
:shock:
I posted what you asked for. How is that wasting your time?

Ernst
Posts: 693
Joined: Sat Feb 04, 2017 9:39 am
Location: Germany

Re: PiZeroW - Reboot and shutdown no longer work

Sun Oct 21, 2018 9:32 am

rpdom wrote:
Sun Oct 21, 2018 8:50 am
Ernst wrote:
Sun Oct 21, 2018 8:16 am
That is not the point, I think it is time to give up with this lot because I am wasting my time.
:shock:
I posted what you asked for. How is that wasting your time?
I did not ask you, I asked pcmanbob.

The point is not the extract from the man pages, the point is Wheezy.

NewtownGal hijacked a thread and complains that shutdown command on a Pi Zero has been changed between Wheezy and Stretch, now a shutdown "delay" with 10 seconds using -t is not available because command has been changed. The user states "I ** need ** a shutdown that starts in 10 seconds". Historic man page extract (I do not have HW for Wheezy) shows that -t refers to init and runlevel sending warning and kill signal. This does not apply to systemd as implemented in Stretch so that -t is obsolete. pcmanbob wrote "I stated the change form time in seconds to time in minutes actually took place in Jessie which is why I posted the extract from the shutdown man in Jessie and is actually the same in stretch because it has not changed since Jessie" (*), ignoring that the original complaint involves a change from Wheezy to Stretch while Jessie is never mentioned. (that is why I asked for Wheezy!). You supplied the extract from Wheezy which shows that the NewtownGal is correct that the command has been changed.

At this point a number of questions for NewtonGal come up:
- Why is a 10 second delay after entering shutdown required ? Can it be that this is not needed with systemd ?
- Why is -t as shutdown option needed ? could this be hard coded in some application ?
- What happened here: "My point is that the shutdown command stopped working, on a Pi Zero no less, which is the crux of this posting.", did shutdown fail or was it because of -t causing the command to be rejected?

NetownGal asks: "Is there a listing of all such changes so I don't have to discover them ???" seems to indicate that reading of release notes is a lost art.

(*) This is not correct, -t and time have different purposes, -t was removed.
My first computer was an ICT1500, my first "personal" computer was the Science of Cambridge Mk14, followed by a TRS-80 Model I later

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

Re: PiZeroW - Reboot and shutdown no longer work

Sun Oct 21, 2018 10:07 am

Ok I get your point -t was removed and replaced with just the option to use "now" a time "12:33" or a number of minutes.

So as far a NewtonGal is concerned it just changed from seconds to minutes.

The only point I was trying to make was that it had changed when the version went from wheezy to jessie back in 2013/2014 so it not like its something new, there were a lot of changes over the life of the jessie version and then changes again when stretch came out.

may be if you update to the new OS regularly you don't notice the changes so much , but going from wheezy to stretch would be a big culture shock.

Sorry for any miss understanding.

edit.
NewtonGal Tested shutdown with +0.5 but its not accepted so full minutes only.
Remember we want information.......................no information no help
The use of crystal balls & mind reading is not supported

Ernst
Posts: 693
Joined: Sat Feb 04, 2017 9:39 am
Location: Germany

Re: PiZeroW - Reboot and shutdown no longer work

Sun Oct 21, 2018 12:27 pm

pcmanbob wrote:
Sun Oct 21, 2018 10:07 am
NewtonGal Tested shutdown with +0.5 but its not accepted so full minutes only.
The real question is why "-t 10" seconds is needed, depending on that answer we could give more meaningful support because (under Wheezy) "-t 60" is not the same as "+1" although the end result is similar.
My first computer was an ICT1500, my first "personal" computer was the Science of Cambridge Mk14, followed by a TRS-80 Model I later

NewtownGal
Posts: 34
Joined: Fri Jul 01, 2016 1:26 pm

Re: Stretch reboot and shutdown command syntax has changed!

Sun Oct 21, 2018 5:51 pm

People have asked why I need to issue a shutdown command as some number of seconds. I tell you in the next paragraph, but I still don't understand why the ability to do so was removed. This breaks transitions from one version of the OS to another and is EXACTLY why I have continued to use an older version, Wheezy, and skipped Jessie.

I have an Internet-of-Things device. It runs unattended outdoors. Its power source can become disconnected or discharged, so it needs to cleanly shut down when it loses power. It has an un-interruptible power supply that can supply power for just X seconds, long enough for it to cleanly shut down if it does so quickly. Some of its tasks are subject to external conditions, such as slow and intermittent wireless networks, and may be slow to stop. Under Wheezy, when a power loss is detected, I trigger a shutdown in 10 seconds, and then immediately try to stop a number of functions hoping to stop them within 10 seconds. Since shutdown has been triggered, the machine will soon do its best to cleanly shutdown, even if some of the tasks I'm trying to stop don't. AND, if there's a delay or glitch in the code when I try to stop the various tasks, the shutdown will still proceed, not be suspended indefinitely.

Assuming I don't just stay with Wheezy, my work-around for the loss of the seconds parameter in shutdown is: when a power loss is detected, to start a task in the background that will sleep 10 seconds then do a shutdown now. Once it's launched into the background, I can try to stop the problematic tasks I mentioned above. I must put it into the background because I have more things to do once I trigger it.

Ernst
Posts: 693
Joined: Sat Feb 04, 2017 9:39 am
Location: Germany

Re: Stretch reboot and shutdown command syntax has changed!

Sun Oct 21, 2018 9:14 pm

You will have to stay with Wheezy because your use of the -t 10 option, which has a very particular function because of initd, has become obsolete with systemd in Stretch.
My first computer was an ICT1500, my first "personal" computer was the Science of Cambridge Mk14, followed by a TRS-80 Model I later

ejolson
Posts: 2001
Joined: Tue Mar 18, 2014 11:47 am

Re: Stretch reboot and shutdown command syntax has changed!

Sun Oct 21, 2018 9:59 pm

Ernst wrote:
Sun Oct 21, 2018 9:14 pm
You will have to stay with Wheezy because your use of the -t 10 option, which has a very particular function because of initd, has become obsolete with systemd in Stretch.
The reason Linus stopped accepting patches from certain systemd developers was because they made changes to the Linux kernel that broke other people's code and then refused to fix things. Neither Linus nor others can moderate what happens to systemd and at this point Raspbian is using it due to an intentionally tangled set of software dependencies. The practical solution is what you have suggested:

# (sleep 10; shutdown now) &

I've commented how unnecessary compatibility-breaking software changes render tutorials and educational materials useless. In my opinion, such changes are starting to become obstacles for the effective use of Linux and the Raspberry Pi in education.

Return to “General discussion”