Hi,
Is there any way of powering down a bubba by software at a fixed time each day? My initial thought was to put "shutdown -P now" in root's crontab, but that seems to put the machine into single user mode rather than powering off (i.e. I can still ping it!). Using "shutdown -h now" powers off the disk, but leaves the led blinking, and the network card active.
Thanks!
Colin
New user's registration have been closed due to high spamming and low trafic on this forum. Please contact forum admins directly if you need an account. Thanks !
How to power down via software?
That does the same as "shutdown -h": powers down the disk, but leaves the LED blinking and the main power on. I was hoping for something that would turn the machine off totally, like holding down the power button.Cheeseboy wrote:I have never tried it in a cron-job, but why not just use "poweroff" instead of shutdown?
Cheers,
Colin
Following up on this, the web admin script in /usr/lib/web-admin/backend.pl has code to do a shutdown. The relevant part, as a shell script, is as follows:
Running this as a script from root's crontab seems to do a timed shutdown, although it's not exactly elegant.
Code: Select all
#!/bin/sh
MAGIC=/sys/devices/platform/buttons/bubbabuttons0/magic
if [ -e $MAGIC ]; then
echo 19088743 >> $MAGIC
/sbin/reboot
else
/sbin/poweroff
fi
Hi,
I can give some background on how things work.
If you do a shutdown -h or a poweroff Linux inside bubba will try to do a complete shutdown and turn of power. The problem here is that there really is no way to cut power from software on bubba. So Linux will end up in an endless sleep in the end. And this is why leds and such is still enabled.
What happens when you press the powerbutton is that the driver in charge of this writes a "magic" value, 19088743 as csp noted ,in a ram located inside the CPU itself. And then issues a reboot insted.
What happens then is that the bootloader catches this on reboot. And instead of doing a reboot it shuts down the disk and waits for a new buttonpress to restart the system.
/Tor
I can give some background on how things work.
If you do a shutdown -h or a poweroff Linux inside bubba will try to do a complete shutdown and turn of power. The problem here is that there really is no way to cut power from software on bubba. So Linux will end up in an endless sleep in the end. And this is why leds and such is still enabled.
What happens when you press the powerbutton is that the driver in charge of this writes a "magic" value, 19088743 as csp noted ,in a ram located inside the CPU itself. And then issues a reboot insted.
What happens then is that the bootloader catches this on reboot. And instead of doing a reboot it shuts down the disk and waits for a new buttonpress to restart the system.
/Tor
Co-founder OpenProducts and Ex Excito Developer