image
image

Go Back   macosx.com > Mac Help Forums > Unix & X11

Reply
 
Thread Tools
  #1  
Old October 17th, 2001, 03:51 AM
Registered User
 
Join Date: Oct 2000
Location: Greensboro, NC
Posts: 34
Thanks: 0
Thanked 0 Times in 0 Posts
JustinHoMi is on a distinguished road
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
Reply With Quote
  #2  
Old October 17th, 2001, 07:04 AM
rharder's Avatar
Do not read this sign.
 
Join Date: Mar 2001
Location: Virginia, USA
Posts: 1,186
Thanks: 0
Thanked 0 Times in 0 Posts
rharder is on a distinguished road
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.
Reply With Quote
  #3  
Old October 17th, 2001, 02:45 PM
Registered User
 
Join Date: Oct 2000
Location: Greensboro, NC
Posts: 34
Thanks: 0
Thanked 0 Times in 0 Posts
JustinHoMi is on a distinguished road
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
Reply With Quote
  #4  
Old October 17th, 2001, 03:08 PM
rharder's Avatar
Do not read this sign.
 
Join Date: Mar 2001
Location: Virginia, USA
Posts: 1,186
Thanks: 0
Thanked 0 Times in 0 Posts
rharder is on a distinguished road
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.
Reply With Quote
  #5  
Old October 17th, 2001, 03:18 PM
Registered User
 
Join Date: Oct 2000
Location: Greensboro, NC
Posts: 34
Thanks: 0
Thanked 0 Times in 0 Posts
JustinHoMi is on a distinguished road
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
Reply With Quote
  #6  
Old December 3rd, 2003, 01:44 AM
Registered User
 
Join Date: Mar 2002
Posts: 82
Thanks: 0
Thanked 0 Times in 0 Posts
isolder is on a distinguished road
^Bump^


Any progress made on this?
Reply With Quote
  #7  
Old December 3rd, 2003, 11:48 AM
btoneill's Avatar
keeper of the cheese
 
Join Date: Jul 2002
Location: Minneapolis, MN
Posts: 797
Thanks: 0
Thanked 0 Times in 0 Posts
btoneill is on a distinguished road
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
Reply With Quote
  #8  
Old December 3rd, 2003, 12:11 PM
scruffy's Avatar
Notorious Olive Counter
 
Join Date: Dec 2000
Location: Soviet Canuckistan
Posts: 1,726
Thanks: 0
Thanked 0 Times in 0 Posts
scruffy is on a distinguished road
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
Reply With Quote
Reply

Thread Tools

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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off
Forum Jump

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


All times are GMT -5. The time now is 10:04 PM.


Mac Support® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0
Copyright 2000-2008 DigitalCrowd, Inc.