|
#1
| |||
| |||
| logging out of aqua in terminal Hi. Is there a way to log out a user via terminal and take them back to the OS X login screen? I'm writing a shell script to logout a user if he has been on for more than a certain amount of time, and to disable usage during certain hours. Thanks, Justin |
|
#2
| ||||
| ||||
| Never heard of a way, unless it's AppleScriptable. -Rob
__________________ There are only 10 kinds of people in the world: Those who understand binary, and those who don't. |
|
#3
| |||
| |||
| Yeah, hopefully it is. I haven't messed with Applescript much under OS X, I'll have to check it out. Does anyone know how to accomplish this with a cocoa or carbon app? I have just enough experience that I might be able to through that function in there ![]() Justin |
|
#4
| ||||
| ||||
| If you mean, build a scriptable app just to log out, first see if there's already a scriptable way to log out. You can call applescript from the command line, but I forget what the command is. There's a thread on it here somewhere. -Rob
__________________ There are only 10 kinds of people in the world: Those who understand binary, and those who don't. |
|
#5
| |||
| |||
| Well, I looked at the Finder dictionary and there wasn't any reference to a logout command. I did see restart and shutdown, so I think I'm looking in the correct place. I'll have to check out calling scripts from commandline, that'd be cool anyways. I was thinking about putting it in a carbon or cocoa app b/c the program I'm writing utilizes a simple carbon app that I wrote to alert you when the computer is about to logout. If I could just find a shutdown method from there it would make it a lot smoother. Still, as long as I get it done I'm happy ![]() Justin |
|
#6
| |||
| |||
| ^Bump^ Any progress made on this? |
|
#7
| ||||
| ||||
| Try: sudo -u username_to_kick_off kill -9 -1 Just don't do it as root, or you'll kill your box ![]() Brian
__________________ UNIX is simple and coherent, but it takes a true genius (or a programmer at any rate) to understand and appreciate its simplicity -- Dennis Ritchie |
|
#8
| ||||
| ||||
| That's a bit of a hardcore way to do it... It'll work, but be prepared for noise and nastiness as programs don't get a chance to cleanly close their open files etc.
__________________ What is the robbing of a bank compared to the founding of a bank? -- Bertold Brecht |
![]() |
| Thread Tools | |
|
|
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| terminal potentials | lucasraggers | Mac OS X System & Mac Software | 10 | October 23rd, 2002 02:39 PM |
| Alarming Terminal app behavior (10.1.5) | bbloke | Mac OS X System & Mac Software | 3 | June 12th, 2002 05:12 PM |
| logging in as root in terminal? | weric | Mac OS X System & Mac Software | 3 | October 11th, 2001 08:48 AM |
| A sure way to crash OSX | paulboy | Mac OS X System & Mac Software | 4 | July 2nd, 2001 10:27 AM |