Many thanks to all who helped me with this one. The key fix came from
Hellebo Knut who suggested I use an rexec call to shutdown and restart
the xdm server.
So, instead of powering down the machine and crashing all the disks, I
successfully got control of the machine again. Here is the C I used:
#include <stdio.h>
main()
{
int zero = 0;
char *out[] = { "hostname" };
rexec((char **)out,512,"rootuser","rootpassword",
"/sbin/init.d/xdm stop",&zero);
perror("exec()");
}
and on solaris I linked with -lnsl -lsocket.
(in case anyone needs this fix).
- BRad
Received on Thu Nov 02 1995 - 17:42:45 NZDT