home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!cis.ohio-state.edu!zaphod.mps.ohio-state.edu!magnus.acs.ohio-state.edu!usenet.ins.cwru.edu!news.ysu.edu!psuvm!frmop11!dearn!dmswwu1a!pegelow
- Organisation: Westfaelische Wilhelms-Universitaet, Muenster, Germany
- Date: Monday, 17 Aug 1992 13:53:29 MES
- From: Ulrich Pegelow <PEGELOW@DMSWWU1A.UNI-MUENSTER.DE>
- Message-ID: <92230.135329PEGELOW@DMSWWU1A.UNI-MUENSTER.DE>
- Newsgroups: comp.os.linux
- Subject: Re: Ctrl-Alt-Del in linux, doesn't work.
- References: <1992Aug4.225341.9785@unibi.uni-bielefeld.de>
- <92226.132926PEGELOW@DMSWWU1A.UNI-MUENSTER.DE>
- <1992Aug13.164743.7685@funet.fi>
- Lines: 74
-
- In article <1992Aug13.164743.7685@funet.fi> sjm86289@tut.fi
- writes:
-
- >Yup, right. I've encountered just the same problem with X11.
- >The cure is simple: as root say echo > /etc/utmp; reboot
- >
- >You will not see the warning message, though. :)
-
- Ok, here is another solution. I enclose a patch to shutdown.c
- as of admutils-1.1. I'm using the alarm timer to interrupt
- the blocking fopen() call if it doesn't return within one
- second.
-
- Hope this helps
-
- Ulrich
- pegelow@dmswwu1a.uni-muenster.de
-
- BTW: There may be a problem as "patch" might reject the following
- context diff; I'm working on a VM/CMS system here (uses EBCDIC
- instead of ASCII). As there are only few changes it should be
- possible to do them by hand though.
-
- *** shutdown.c Sat Aug 15 19:36:18 1992
- --- shutdown.c.new Sat Aug 15 19:36:42 1992
- ***************
- *** 36,39 ****
- --- 36,45 ----
- }
-
- + void alarm_handler()
- + {
- + signal(SIGALRM, alarm_handler);
- + }
- +
- +
- main(argc, argv)
- int argc;
- ***************
- *** 135,138 ****
- --- 141,145 ----
-
- signal(SIGINT, int_handler);
- + signal(SIGALRM, alarm_handler);
-
- chdir("/");
- ***************
- *** 196,199 ****
- --- 203,207 ----
- {
- FILE *f;
- + int rest;
- int minutes;
- char term[40] = {'/','d','e','v','/',0};
- ***************
- *** 201,206 ****
- minutes = timeout / 60;
- (void) strcat(term, ut->ut_line);
- !
- ! if(f = fopen(term, "w")) {
- fprintf(f, "\007\r\nURGENT: message from the sysadmin:\r\n");
- if(minutes == 0) {
- --- 209,218 ----
- minutes = timeout / 60;
- (void) strcat(term, ut->ut_line);
- !
- ! rest = alarm(1);
- ! f = fopen(term, "w");
- ! alarm(rest);
- !
- ! if (f) {
- fprintf(f, "\007\r\nURGENT: message from the sysadmin:\r\n");
- if(minutes == 0) {
-
-