Follow us on...
Follow us on Twitter Follow us on Facebook
Register
Results 1 to 2 of 2
  1. #1
    sandpilot is offline Registered User
    Join Date
    Apr 2002
    Location
    Palmdale, CA
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Getting LoginHooks to work

    Hello All-

    I have a situation where I need every G4 (around 200) on my network to "Do a little housecleaning" upon login. I have been refered to Apple's site and found that LoginHooks will do exactly what I want it to do, with the least intrusion to the user machine. I read up on how to implement these and thought it would be pretty straight forward.

    I modified line in the ttys file from:
    console "/System/Library/CoreServices/loginwindow.app/Contents/MacOS/loginwindow" vt100 on secure window=/System/Library/CoreServices/WindowServer onoption="/usr/libexec/getty std.9600"

    to this:
    console "/System/Library/CoreServices/loginwindow.app/Contents/MacOS/loginwindow -LoginHook /Users/admin/Scripts/cleanDT" vt100 on secure window=/System/Library/CoreServices/WindowServer onoption="/usr/libexec/getty std.9600"

    where cleanDT is a script that is executable. A very simple one line script to remove a file called errorlog.txt.

    Here is the script I used:

    #!/bin/zsh

    /bin/rm /Applications/DTApps/errorlog.txt

    It works great if I'm in the scripts folder and issue ./cleanDT command. Boom the file is gone. But when I modify the line in ttys, upon reboot I get to the login window, enter name and password and the screen flickers abit a goes right back to the login window. Is there something blindingly obvious that I have wrong here.

    Thanks for any help!!

    John

  2. #2
    gatorparrots is offline ~departed~
    Join Date
    Jul 2002
    Location
    Kansas City, MO
    Posts
    457
    Thanks
    0
    Thanked 5 Times in 5 Posts
    Are you sure the cleanDT script executable?
    chmod +x /Users/admin/Scripts/cleanDT
    Is that path readable or have you made your permissions more restrictive than the defaults?

    Have you tried it as just a #!/bin/sh script, rather than zsh?

    And does the target file of the rm have a sticky bit or is it root owned, or some other permissions setting that may prevent your hook from working?

 

 

Similar Threads

  1. Anyone get their NEC PetiScan scanner to work on OSX?
    By strawberry in forum Hardware & Peripherals
    Replies: 2
    Last Post: December 8th, 2006, 12:02 PM
  2. Replies: 5
    Last Post: August 3rd, 2003, 06:13 PM
  3. Getting a CGI script to work locally on my Mac
    By simX in forum Mac OS X System & Mac Software
    Replies: 11
    Last Post: July 12th, 2002, 01:43 PM
  4. DAVE Is Now Free, but does it work???
    By RHITMacMan in forum Mac OS X System & Mac Software
    Replies: 5
    Last Post: September 19th, 2001, 02:56 AM
  5. AppleShare (or why doesn't macosx work like *nix)
    By mrjohns in forum Mac OS X System & Mac Software
    Replies: 1
    Last Post: July 26th, 2001, 03:43 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •