|Nov 26, 2007, 11: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, 12:28 PM||#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, 12:55 PM||#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 10:08 AM|
|Change Auto Logout - Via command line?||dcain||OS X 10.8 Mountain Lion||0||Dec 11, 2013 12:47 PM|
|Nicl: command not found (how to replace it? trying to erase user)||sun surfer||Mac Programming||10||Jul 20, 2013 09:42 AM|
|single user mode display identification command needed||retinalcircus||Mac Programming||0||Jul 14, 2012 06:37 PM|
|Auto Logout||JamesP.||Site and Forum Feedback||5||Jul 5, 2012 04:20 PM|
All times are GMT -5. The time now is 05:49 PM.