delay in shutdown.sh

Tell us to improve our work

delay in shutdown.sh

Postby Rodney.McKay » Thu Jan 23, 2020 1:39 am

After a few weeks with Raspberry Pi, Carberry, and a 4x50W amplifier installed in my car, I'm very happy with my purchase but I've decided that I don't want it to shutdown so soon when the engine turns off. Frequently when I use my car, it's to make multiple short stops and I would prefer to pause the playing song when I park then resume when I return, without waiting for the unit to power on again.
I've tried changing "shutdown -h now" to "shutdown -h 123" in shutdown.sh, but it still powers off within about a minute after power to the ignition wire on the Carberry harness goes off - about the same time as it took with "now" for poweroff to complete. What am I missing?
Rodney.McKay
 
Posts: 1
Joined: Thu Jan 23, 2020 1:20 am

Re: delay in shutdown.sh

Postby Flynn » Sun Feb 02, 2020 11:02 pm

Hi Rodney,

shutdown is a Linux command, from the man page you have the following details :

The time string may either be in the format "hh:mm" for hour/minutes
specifying the time to execute the shutdown at, specified in 24h clock format.
Alternatively it may be in the syntax "+m" referring to the specified number
of minutes m from now. "now" is an alias for "+0", i.e. for triggering an
immediate shutdown. If no time argument is specified, "+1" is implied.


So, if you want to power it off after 5 minutes, use :

Code: Select all
shutdown -h +5


Regards
Flynn
 
Posts: 2
Joined: Mon Oct 28, 2019 6:26 pm


Return to Suggestions

Who is online

Users browsing this forum: No registered users and 0 guests