Killing background processes at logout-fix to sysline

Jim Ziobro z at rocksvax.UUCP
Wed Dec 19 18:24:34 AEST 1984


/***** rocksvax:net.unix-wizards / chalmers!bernerus /  3:50 pm  Dec 14, 1984*/
Subject: Killing background processes at logout (AGAIN)
Chris.		...!mcvax!enea!chalmers!bernerus
/* ---------- */

	These are the changes I made to sysline.c to make it die when
the user logged off.  It works for all hardwired terminals.  It still
has a problem on ptys though.

//Z\\
------
64a65,66
> #include <sgtty.h>
> #include <sys/file.h>
356c358,366
<     if(!emacs && !dbug && fork()) exit(0); 
---
>     if(!emacs && !dbug && fork()) {exit(0); }
>     else
>     { int pgrp;
> 	/* We want to die on hangup */
> 	int ttyfd=open("/dev/tty",O_WRONLY,0);
> 	ioctl(ttyfd, TIOCGPGRP, &pgrp);
> 	setpgrp(0, pgrp);
> 	};
> 
-- 
//Z\\
James M. Ziobro
Ziobro.Henr at Xerox.ARPA
{rochester,amd,sunybcs,allegra}!rocksvax!z



More information about the Comp.unix.wizards mailing list