🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.bugs.misc
Article #96

Korn shell leaves phantom jobs -BSD

#96
From: Richard Doty
Date: Tue, 02 Feb 1988 21:46
24 lines
1372 bytes
Subject: Korn shell leaves phantom jobs -BSD
Index:	sh/jobs.c

Description:
	If a korn shell with the monitor option set is interrupted
	during a macro expansion (e.g.  eval `tset -Tvt100 ...` ), a
	job is left on the jobs stack.  This is a "pipejob" so 'jobs'
	does not see it, but if this happens to a login shell (perhaps
	while processing your .profile), you will get the "you have
	running jobs" message when you try to log out.

Repeat-By:
	Put a macro expansion in your .profile, and interrupt it
	while logging in.  Then try to log out.

Fix:
	The fix I use is to have list_jobs detect the case where a
	pipejob has been waited for (the NOTIFY bit is set), but has no
	associated job leader (job_bynum() returns NULL).  If that happens,
	I assume it is a bogus job table entry, and unpost it.

	This still looks like a kludge, but I think it is because of the
	dual use of the P_PIPEJOB flag - these macro jobs shouldn't be
	post()ed in the first place.
Technical Details
Message-ID: <2357@tekgen.TEK.COM>
Path: arc1-ca.pugleaf.net!utzoo!mnetor!uunet!lll-winken!lll-lcc!ames!aurora!labrea!decwrl!decvax!tektronix!tekgen!rad

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!mnetor!uunet!lll-winken!lll-lcc!ames!aurora!labrea!decwrl!decvax!tektronix!tekgen!rad
From: rad@tekgen.TEK.COM (Richard Doty)
Newsgroups: comp.bugs.misc
Subject: Korn shell leaves phantom jobs -BSD
Message-ID: <2357@tekgen.TEK.COM>
Date: 2 Feb 88 21:46:48 GMT
Reply-To: rad@tektronix.tek.com (Richard Doty)
Organization: Tektronix, Inc., Beaverton, OR.
Lines: 23