Path: utzoo!attcan!utgpu!news-server.csri.toronto.edu!mailrus!uwm.edu!zaphod.mps.ohio-state.edu!rpi!crdgw1!sixhub!davidsen From: davidsen@sixhub.UUCP (Wm E. Davidsen Jr) Newsgroups: comp.unix.xenix Subject: Re: cu/uucp suspend/restart getty - how? Keywords: uucp getty Message-ID: <1137@sixhub.UUCP> Date: 10 Jun 90 12:59:08 GMT References: <272@sherpa.UUCP> Reply-To: davidsen@sixhub.UUCP (bill davidsen) Organization: *IX Public Access UNIX, Schenectady NY Lines: 32 In article <272@sherpa.UUCP> rac@sherpa.UUCP (Roger Cornelius) writes: | | Can someone enlighten me as to how uucp and cu signal getty to suspend | and restart with SCO's HDB uucp? I recall discussion here about | manually using SIGUSR1 and SIGUSR2 to accomplish this, but I'd like to | understand how cu/uucp do it (ie., from within a C program). Name kill - Sends a signal to a process or a group of processes. Syntax #include int kill (pid, sig) int pid, sig; The hard part is getting the PID of the getty, and the info you want can be found in utmp.h (to human read) and either /usr/adm/wtmp or /etc/wtmp (for program reading at runtime). See man section utmp. Logic: - Scan utmp for a getty. - Get the line # from the entry. - Send SIGUSR1 to the getty using kill(). - Use the line. - Send SIGUSR2 to the getty. -- bill davidsen - davidsen@sixhub.uucp (uunet!crdgw1!sixhub!davidsen) sysop *IX BBS and Public Access UNIX moderator of comp.binaries.ibm.pc and 80386 mailing list "Stupidity, like virtue, is its own reward" -me