Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Auto restart after power fail
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Gentoo on PPC
View previous topic :: View next topic  
Author Message
Smedley
n00b
n00b


Joined: 10 Jan 2004
Posts: 2
Location: Seattle

PostPosted: Sat Jan 10, 2004 10:00 pm    Post subject: Auto restart after power fail Reply with quote

I'm in the process of building a server on a Mac Cube (G4). Of course I will use a UPS, but there is still the chance that the UPS will shut down the server.

When power is restored I would like the Cube to reboot. I know that under OS X you can tell the Cube to do this, but it does not seem to happen under Gentoo Linux. (I tested by pulling the plug).

Sage help and advice greatly appreciated.

My apologies if this information is available somewhere, I'm new to the forum and was unable to find this elsewhere.
_________________
-Steve
Back to top
View user's profile Send private message
adaptr
Watchman
Watchman


Joined: 06 Oct 2002
Posts: 6730
Location: Rotterdam, Netherlands

PostPosted: Sat Jan 10, 2004 10:01 pm    Post subject: Reply with quote

Since it's a sMack I have no idea, but every recent PC has BIOS options to decide what to do after a power failure.

Does a Mac have a BIOS ?
Back to top
View user's profile Send private message
jdv
n00b
n00b


Joined: 05 Apr 2003
Posts: 34
Location: Copenhagen, Denmark

PostPosted: Sun Jan 11, 2004 5:42 pm    Post subject: Re: Auto restart after power fail Reply with quote

Smedley wrote:
When power is restored I would like the Cube to reboot. I know that under OS X you can tell the Cube to do this, but it does not seem to happen under Gentoo Linux. (I tested by pulling the plug).

It seems that PenguinPPC (http://penguinppc.org/dev/pmac/) has a hack that enables the feature without using Mac OS. Look for "Mike Hudson's hack"...

If that doesn't help, this might: http://lists.linuxppc.org/linuxppc-user/200005/msg01454.html.
_________________
Your lucky number is 3552664958674928. Watch for it everywhere.
Back to top
View user's profile Send private message
Smedley
n00b
n00b


Joined: 10 Jan 2004
Posts: 2
Location: Seattle

PostPosted: Sun Jan 11, 2004 6:43 pm    Post subject: Reply with quote

Thanks v. much for the suggestions.

There is no BIOS as the PC world knows it on any Mac that I have ever owned. That is, there is no way to break into the boot process and change settings.

Although I am not an expert on the various Mac architectures, my understanding is that the Cube is a New World machine and does not have CUDA. Both of the references that jdv supplied are solutions for CUDA-based machines (as far as I can tell).

If I am wrong about CUDA not applying to the Cube, someone please tell me. Otherwise, I am still in need of something that will work for a PMU-based machine.

Thanks.
_________________
-Steve
Back to top
View user's profile Send private message
NewBlackDak
Guru
Guru


Joined: 02 Nov 2003
Posts: 512
Location: Utah County, UT

PostPosted: Sun Jan 11, 2004 7:50 pm    Post subject: Reply with quote

I believe there is a way to set it in open firmware, but you're on your own finding it.

You could always install MacOS long enough to set that option before you install Gentoo.
_________________
Gentoo systems.
X2 4200+@2.6 - Athy
X2 3600+ - Myth
UltraSparc5 440 - sparcy
Back to top
View user's profile Send private message
DiskBreaker
Apprentice
Apprentice


Joined: 07 Oct 2003
Posts: 224

PostPosted: Sun Jan 11, 2004 11:30 pm    Post subject: Reply with quote

The easiest way to set it would be through OS X:
Code:
pmset -g cap

will show you what power managment capabilities are supported by your machine, you are looking for the "autorestart" entry. (AFAIK the cube has PMU99 and it should work with it).
Code:
pmset -a autorestart 1

will turn the auto-restart on power loss setting on.
OS X Server also has a special "servermode" command (man 8 servermode).

If you want to dive into Open Firmware, have a look at via-pmu, there might be something there (cf. sample OF device tree):
Code:
hold down Command-Option-O-F on boot...
dev /pci
dev mac-io
words

should give you a list of available commands at that part of the tree (dev command is like unix "cd").
Code:
.properties

will give you a hexdump of the properties of the current device.

Also note that Apple seems to refer to that option as "Server Mode": http://developer.apple.com/technotes/tn/tn1190.html#Section13. You might also want to check out the Darwin sources for Power Managment, here are two links, but I haven't really looked into it yet:
(from the IO-Kit Headers)
http://www.opensource.apple.com/darwinsource/10.2.6/xnu/iokit/IOKit/pwr_mgt/IOPM.h
Code:
kPMSupportsServerModeAPIMask = (1<<18), // 1=supports reboot on AC resume for unexpected power loss

(from OpenPMU)
http://cvs.opendarwin.org//cgi-bin/cvsweb.cgi/proj/XPostFacto/Extensions/OpenPMU/OpenPMU.cpp?annotate=1.1&sortby=rev
Code:
void OpenPMUInterface::setFileServerMode(bool fileServerModeON)

seems to be the method to turn on ServerMode. Maybe someone clever can figure out how to properly set this in the NVRAM.

Have fun,
Disk
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo on PPC All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum