Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread Display Modes
Old Nov 26, 2007, 10:01 AM   #1
macrumors newbie
Join Date: Oct 2005
command to logout user

Hi Guys,

Can any body tell me what is the command to logout user from system?

I know the "reboot" and "shutdown" command but I don't know how to logout the user from system.

Previously I was using Carbon API "SendAppleEventToSystemProcess" to restart,shutdown and logout in my Cocoa application. But now I have mad one daemon now this API is not working in my daemon. So I m looking for system commands to achieve these things.

Thanks in advance.
Sunil is offline   0 Reply With Quote
Old Nov 26, 2007, 11:28 AM   #2
Moderator emeritus
kainjow's Avatar
Join Date: Jun 2000
I don't know why it wouldn't work. The AE event is kAELogOut. If the Carbon functions aren't working (are you linking against Carbon.framework?), you could always use NSTask/system() and call the AppleScript directly with osascript.
kainjow is offline   0 Reply With Quote
Old Nov 26, 2007, 11:55 AM   #3
robbieduncan's Avatar
Join Date: Jul 2002
Location: London
Is the daemon running as the user? Or as another user (non-root). I'd imagine the system would not let you log other users out unless you are the super user.
robbieduncan is offline   0 Reply With Quote

MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
thread Thread Starter Forum Replies Last Post
Exporting Video to Windows users - best video formats? CmactalkAust Digital Video 6 Sep 11, 2012 09:09 AM
Login/Logout/User Switching Problem Silverstring Mac OS X 10.7 Lion 2 Aug 28, 2012 12:59 AM
iMac27 with LionOSX Sudden logout/login msslife iMac 1 Oct 7, 2011 11:32 AM
iMac won't shut down or logout users film916 iMac 6 Nov 12, 2010 11:56 AM
Command to delete user data... philstone OS X 0 Oct 21, 2009 08:08 AM

All times are GMT -5. The time now is 10:53 AM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013,, LLC