Path: utzoo!attcan!uunet!wyse!vsi1!ames!haven!uflorida!gatech!kong!emory!stiatl!john From: john@stiatl.UUCP (John DeArmond) Newsgroups: comp.sources.d Subject: Re: "monthd" doesn't terminate Keywords: month, exit, ultrix 1.2 Message-ID: <1566@stiatl.UUCP> Date: 16 Nov 88 16:01:44 GMT References: <1252@leah.Albany.Edu> <3035@haven.umd.edu> <6454@csli.STANFORD.EDU> Reply-To: john@stiatl.UUCP (John DeArmond) Organization: Sales Technologies Inc., Atlanta, GA Lines: 46 In article <6454@csli.STANFORD.EDU> wagner.pa@xerox.com (Juergen Wagner) writes: >In article <3035@haven.umd.edu> louie@trantor.umd.edu (Louis A. Mamakos) writes: >>I also have the problem with monthd not exiting when I log out; I have not >>yet had the time to solve that problem. > >I don't have the original sources of `month' around, but the problem with >`monthd' sitting around even after logging out can be fixed easily by doing >a kill(getppid(), 0) and checking the return value for ESRCH. I did that >in the main daemon loop after the sleeping. > >You could also check /etc/utmp if the user is still logged in, or use a wrapper >which forks the monthd, and which kills it off as soon the parent dies. > >Juergen Wagner >wagner.pa@xerox.com >-- >Juergen "Gandalf" Wagner, gandalf@csli.stanford.edu >Center for the Study of Language and Information (CSLI), Stanford CA I have brought the distribution version of MONTH up on our Convergent Mightyframe (sysV, rel 2), and it does in fact terminate after logoff, though not necessarily immediately. What you may be seeing is if you logoff and immediately back in, monthd is still there because it may not have awoke yet. If it awakes and the logon session is gone, it does terminate. Here's my Cshell solution to the problem. Put this in your .login file. ---------------- if (`ps | grep -c monthd` == 0) then monthd echo loading monthd endif ---------------- That way, it is only loaded if it does not already exist. I also experienced the problem of the notices not making it to the screen but the fflush(tty) fix already posted should work. I have not had time to do that though. John De Armond Sales Technologies, Inc. Atlanta, GA ...!gatech!stiatl!john