ProLiant Servers (ML,DL,SL)
cancel
Showing results for 
Search instead for 
Did you mean: 

DL380 G1 wakes up at midnight. How stop?

Marcin Gomulkiewicz
Occasional Visitor

DL380 G1 wakes up at midnight. How stop?

I bought an old DL380 G1 machine for test purposes. In general, I don't want it run 24/7, just from time to time, so when I shut it down I want it to stay down until I power it up again. Unfortunately, it wakes up every day just before midnight (IIRC at 23:59:57).

Does anybody know how to stop it?

(There was similar issue on DL140 http://forums11.itrc.hp.com/service/forums/questionanswer.do?threadId=664807 )

(Machine is on UPS. I have erased the systen w/ Compaq utils, searched through all settings in BIOS, in RILOE II card, updated all firmwares, nothing helps. At the moment the machine is running Ubuntu 8.04 server; I can change it to any pretty recent Linux system if necessary).
4 REPLIES
Brian_Murdoch
Honored Contributor

Re: DL380 G1 wakes up at midnight. How stop?

Hi,

Remove the RILOE II and connect the keyboard, mouse and video cables to the normal system board ports instead just to check if the RILOE II is somehow responsible using it's virtual power button capabilities.

I can't remember if you need to disable the onboard video when you install a RILOE II in a DL380 G1 but if you don't get video check the maintenance switchpack and just make sure only switch 3 is on (For Rack System). The top cover will show you what each switch function is.

I hope this helps.

Brian
Phil.Howell
Honored Contributor

Re: DL380 G1 wakes up at midnight. How stop?

hammer a wooden stake through its heart? :)
Marcin Gomulkiewicz
Occasional Visitor

Re: DL380 G1 wakes up at midnight. How stop?

In G1 to use RILOE II when server is powered off you have to connect an external power supply. I've disconnected this PSU and RILOE II became unavailable when server was down, but machine still woke up as always. Sorry I've omitted that info.
Marcin Gomulkiewicz
Occasional Visitor

Re: DL380 G1 wakes up at midnight. How stop?

After some thinking & googling I think I have found a solution (well, hack would certainly be more appropriate):

Proliant's wake up clock can be controlled through standard linux rtc driver. It is possible to change the wake-up hour in a standard way (echoing new alarm settings to the /proc/acpi/alarm), but this way the alarm cannot be disabled. By using direct ioctls we can bypass the sanity checks for the alarm settings and set an alarm to, say, 25:61:61... which should prevent machine from waking up (disabling alarm IRQ only will not work). I did that, and for two days my machine slept like a baby, and after powering up there were no negative side-effects. The hack seem to survive resets and reboots, but to be sure I've added it to my /etc/rc.local. Ok, so here's the code (it works for me, but may fry any other server, so use it on your own risk) - I guess it's short enough to be inlined:

/*
* Compaq Proliant wake-up disable hack.
*
* Copyright (C) 2008, Marcin Gomulkiewicz
*
* Most of it is taken from Real Time Clock Driver Test/Example Program
* Copyright (C) 1996, Paul Gortmaker.
*
* Released under the GNU General Public License, version 2.
*/

#include
#include
#include
#include
#include
#include
#include
#include

int main(int argc, char **argv)
{
int fd, retval, verbose = 0;
struct rtc_time rtc_tm;
const char *rtc = "/dev/rtc";

switch (argc) {
case 3:
rtc = argv[2];
/* FALLTHROUGH */
case 2:
verbose = (!strcmp(argv[1],"-v")) || (!strcmp(argv[1],"--verbose"));
if (!verbose) {
rtc = argv[1];
}
/* FALLTHROUGH */
case 1:
break;
default:
fprintf(stderr, "usage: %s [-v|--verbose][rtcdev]\n",argv[0]);
return 1;
}

if (verbose) {
fprintf(stderr,"Opening %s...",rtc);
}

fd = open(rtc, O_RDONLY);

if (fd == -1) {
if (verbose) {
perror(" failed");
}
exit(errno);
}

/* Read the RTC time/date */

if (verbose) {
fprintf(stderr," done.\nReading the clock...");
}

retval = ioctl(fd, RTC_RD_TIME, &rtc_tm);
if (retval == -1) {
if (verbose) {
perror(" failed. RTC_RD_TIME ioctl");
}
exit(errno);
}

if (verbose) {
fprintf(stderr," done.\nSetting the clock to bogus values...");
}

/* Set the alarm to bogus values */

rtc_tm.tm_sec = 61;
rtc_tm.tm_min = 61;
rtc_tm.tm_hour = 25;

retval = ioctl(fd, RTC_ALM_SET, &rtc_tm);
if (retval == -1) {
if (verbose) {
perror(" failed. RTC_ALM_SET ioctl");
}
exit(errno);
}

if (verbose) {
fprintf(stderr," done.\nReading current alarm settings...");
}

/* Read the current alarm settings */
retval = ioctl(fd, RTC_ALM_READ, &rtc_tm);
if (retval == -1) {
if (verbose) {
perror(" failed. RTC_ALM_READ ioctl");
}
exit(errno);
}

if (verbose) {
fprintf(stderr, " done.\nAlarm time now set to %02d:%02d:%02d.\nDisabling alarm interrupts...",
rtc_tm.tm_hour, rtc_tm.tm_min, rtc_tm.tm_sec);
}

/* Disable alarm interrupts */
retval = ioctl(fd, RTC_AIE_OFF, 0);
if (retval == -1) {
if (verbose) {
perror(" failed. RTC_AIE_OFF ioctl");
}
exit(errno);
}

if (verbose) {
fprintf(stderr, " done.\n");
}

close(fd);

return EXIT_SUCCESS;
}

It would be nice if someone could confirm this hack and/or write similar program(s) for other operating systems. Unfortunately, I am linux-only guy.

Best regards,

Marcin