Ubuntu Forums ubuntu.com - launchpad.net - ubuntu help  

Go Back   Ubuntu Forums > The Ubuntu Forum Community > Forum Archive > Main Support Categories > x86 64-bit Users
Register Reset Password Forum Help Forum Council Search Today's Posts Mark Forums Read

Hello, Unregistered You are browsing a READ only archive of the main support categories pre 4/21/2008. You will not be able to post or reply any threads in this section.

x86 64-bit Users
For the discussion of Ubuntu on the AMD 64 platform.

 
Thread Tools Display Modes
Old November 28th, 2005   #1
mwnovak
5 Cups of Ubuntu
 
Join Date: May 2005
Beans: 32
Ubuntu PPC + UPS: how to auto-boot?

I run a server installation (no x/gui) of Ubuntu 5.10 on an Apple G4 Cube. It's a headless machine, and I use it as my personal web and file server.

I'd like to set up a UPS for the machine so it can shut down gracefully in the event of power failures. I've found several good tutorials regarding UPS's under x86 Linux. In particular, the following addresses apcupsd and Debian: http://update.itlab.musc.edu/node/126

Here's my question: how can I configure my Mac to start up automatically when power is restored after a power failure? All the x86-based tutorials indicate that BIOS settings control this behavior... is there an equivalent setting in the Apple openFirmware? some other way to do this?

Any help is greatly appreciated.

--MW
mwnovak is offline   Reply With Quote
Old November 28th, 2005   #2
ssam
Chocolate Ubuntu Mocha Blend
 
ssam's Avatar
 
Join Date: Dec 2004
Location: Manchester
Beans: 1,755
Ubuntu 8.10 Intrepid Ibex
Re: Ubuntu PPC + UPS: how to auto-boot?

there is a setting in the mac os x control panel to reboot after a power failier. if you still have mac os x installed you could try that. i assume it store that setting in PRAM. you may be able to change the setting from the open firmware.

that might be enough info to help you find an answer.

otherwise if you have some electronics knowledge and a spare apple keyboard with a power key then you could probably work something out.
ssam is offline   Reply With Quote
Old November 29th, 2005   #3
mwnovak
5 Cups of Ubuntu
 
Join Date: May 2005
Beans: 32
Re: Ubuntu PPC + UPS: how to auto-boot?

Okay, a little more digging trough the repositories led me to "powerpc-utils (1.1.3-16)" which includes an "autoboot" utility. From the man page, autoboot is a "tool for setting/resetting servermode booting of PowerMacs." This is exactly what I need, but...

...here's what I get when I run the utility:

Code:
mwnovak@myserver:~$ sudo autoboot on
autoboot: write returned -1
I can't find any information on "write returned -1", but I'm guessing it means the utility didn't work: when I kill/restore power to the machine, I still have to manually press the power button to get it running again.

Suggestions?

--MW
mwnovak is offline   Reply With Quote
Old November 29th, 2005   #4
ssam
Chocolate Ubuntu Mocha Blend
 
ssam's Avatar
 
Join Date: Dec 2004
Location: Manchester
Beans: 1,755
Ubuntu 8.10 Intrepid Ibex
Re: Ubuntu PPC + UPS: how to auto-boot?

thats an intersting package, thanks for finding it.

try emailing the package maintainer,
Code:
sudo apt-cache show powerpc-utils
Code:
autoboot: write returned -1
yes, returning a non zero number is unix speak for error. but it could mean anything.

update:
read man nvsetenv, that might be more useful for modern (open firmware) macs.

Code:
sudo nvsetenv
prints out a list of all the variables (the last one on mine contains a ascii control character or something and mangles my terminal display, use "reset" to fix it.)

one of the values on mine is
Code:
auto-boot?=true
that could be what your after.

please be careful (maybe do some more research). i think making mistakes here could make your system very unbootable.

Last edited by ssam; November 29th, 2005 at 09:50 AM..
ssam is offline   Reply With Quote
Old November 29th, 2005   #5
mwnovak
5 Cups of Ubuntu
 
Join Date: May 2005
Beans: 32
Re: Ubuntu PPC + UPS: how to auto-boot?

I emailed Rich Johnson, the listed maintainer for the autoboot utility. Here's what he had to say:

Quote:
autoboot, as currently implemented, only works on powermacs with
the CUDA peripheral controller. These are older nubus and pci
powermacs with an ADB. It needs to be modified to support
powermacs with PMU99 chips (such as the Cube). Unfortunatey, I
don't have such a machine running Linux, but I will poke around a bit
to see what I can find out. I do know that it _can_ be done. See
(http://www.versiontracker.com/dyn/moreinfo/macosx/19830 and http://
www.versiontracker.com/dyn/moreinfo/macosx/16555)

You also point out another bug: ''autoboot: write returned -1" is
neither friendly nor informative. It should read more like
"Unsupported Machine"
As suggested by ssam, I'm going to do some research on the "nvsetenv" utility and see if there's any traction there. I'll also see if I can find info about doing autoBoot via Open Firmware.

If I find anything useful, I'll post back here.

EDIT: I checked up on the auto-boot variable of nvsetenv. "auto-boot = false" will cause the machine to boot directly into Open Firmware and wait for input; "auto-boot = true" lets the the boot process move through OF and actually load the OS. That's not quite what I'm looking for... but it seems like there should be another OF variable that'll do the trick. Updates to follow...

--MW

Last edited by mwnovak; November 29th, 2005 at 02:03 PM..
mwnovak is offline   Reply With Quote
Old November 29th, 2005   #6
mwnovak
5 Cups of Ubuntu
 
Join Date: May 2005
Beans: 32
Re: Ubuntu PPC + UPS: how to auto-boot?

A little more information ... might spark something.

As already mentioned, OSX has a feature called "Restart automatically after a power failure" that creates the behavior I'm looking for. So I started messing with this option on my 10.4 Powerbook to see what I could learn.

I'm not sure that the "restart after power failure" behavior is actually happening through Open Firmware. Here's what I did:

"nvram" seems to be the OSX counterpart to Ubuntu's "nvsetenv" utility: it can print or set OF variables. To dump the OF variables into a text file, I ran:
Code:
nvram -p > pre.txt"
I then enabled OSX's "restart after power failure" option (Sys. Prefs. - Energy Saver - Options tab), before dumping the variables again:
Code:
nvram -p > post.txt
Then I compared the two files:
Code:
diff pre.txt post.txt
The files were identical, indicating that the "restart after power failure" option didn't alter any of the OF variables returned by nvram.

"Restart after power failure" is, however, flagging the "autorestart" variable of pmset (the command-line power management tool under OSX). I believe the analogous tools for Ubuntu are the apm and/or pmud packages... anyone know if either has a "restart after power failure" option?

--MW

Last edited by mwnovak; November 29th, 2005 at 03:19 PM..
mwnovak is offline   Reply With Quote
Old November 29th, 2005   #7
mwnovak
5 Cups of Ubuntu
 
Join Date: May 2005
Beans: 32
Re: Ubuntu PPC + UPS: how to auto-boot?

Rich Johnson, the maintainer of the "autoboot" utility, pointed me in the right direction here...

/proc/pmu/options contains the following variable: server_mode=0

Setting that variable to "1" (echo 'server_mode=1' > /proc/pmu/options) allows the Cube to restart automatically after a power failure.

However, I still can't get this to work in the context of a UPS.

Setting "server_mode=1" lets the machine restart when power returns after a power failure. That is, when I pull the plug on the Cube while it's running (which is such a bad idea, I know), wait a bit, and plug it back in ... the machine automatically starts again.

Wonderful.

However, when I issue any type of graceful shutdown command ("shutdown -h now", "halt", "halt -f") and subsequently pull the plug ... the machine will not automatically start when I restore power at the plug. I've even tried setting "HALT=halt" (instead of "poweroff") in /etc/default/halt. No joy.

Though he didn't find a solution, I did at least find someone with the same problem: http://lists.debian.org/debian-power.../msg00019.html

Does anyone have suggestions for an appropriate shutdown command that will halt the Cube without cutting power?

--MW
mwnovak is offline   Reply With Quote

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 07:05 PM.


vBulletin ©2000 - 2009, Jelsoft Enterprises Ltd. Ubuntu Logo, Ubuntu and Canonical © Canonical Ltd. Tango Icons © Tango Desktop Project. lingonberry