• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Force logout, but run logout hook
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Force logout, but run logout hook


  • Subject: Force logout, but run logout hook
  • From: Rhon Fitzwater <email@hidden>
  • Date: Sun, 12 Jan 2003 21:09:33 -0500

I have a screensaver that will forceably log a user out after a cetain
amount of time. What it doesnt do though is run the logout hook script
I have set. Does anyone know how I can get it to do this? The code I
have now works now, but I need a way to either cleanly log the user
out, but ignore all application responses, so if anything is open, it
will close without saving, and run the logout hook just like it does
when the user normally logs off. Or have it run the perl a perl logoff
script that I could add to this code(maybe), but what i really want is
a way to log the user out cleanly and have the log out hook script
automatically run. Any suggestions?

Here is a snippet of the code I have, not sure what to add to get
everything to work:

- (void) performLogoutIfAppropriate
{
if (![self isPreview] && countdownSecs <= 0)
{

pid_t loginProcessID;

loginProcessID = getProcessInfo();

// NSLog(@"Trying to kill process %d", loginProcessID);

if (loginProcessID != -1)
{
//This should now run the logout hook.
kill(loginProcessID, SIGKILL); // SIGQUIT or SIGKILL
}
}
return;
}

@end

Thanks,

-Rhon
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Prev by Date: Re: Removing submenus from a menu
  • Next by Date: positioning items in a drawer
  • Previous by thread: Re: HI spec.
  • Next by thread: positioning items in a drawer
  • Index(es):
    • Date
    • Thread