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

Similar Threads
thread Thread Starter Forum Replies Last Post
Remap command q to command h and vice versa? TheArgonaut OS X Mavericks (10.9) 1 Jan 29, 2014 09:08 AM
Change Auto Logout - Via command line? dcain OS X 10.8 Mountain Lion 0 Dec 11, 2013 11:47 AM
Nicl: command not found (how to replace it? trying to erase user) sun surfer Mac Programming 10 Jul 20, 2013 08:42 AM
single user mode display identification command needed retinalcircus Mac Programming 0 Jul 14, 2012 05:37 PM
Auto Logout JamesP. Site and Forum Feedback 5 Jul 5, 2012 03:20 PM

Forum Jump

All times are GMT -5. The time now is 02:55 AM.

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

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