|Nov 26, 2007, 10:01 AM||#1|
command to logout user
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.
|Nov 26, 2007, 11:28 AM||#2|
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.
|Nov 26, 2007, 11:55 AM||#3|
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.
Sponsor me to cycle 100Km round London in the dark
|Thread Tools||Search this Thread|
|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|
All times are GMT -5. The time now is 01:55 PM.