Home Forums OS X Server and Client Discussion Questions and Answers LoginHooks/MCX Login Scripts not working in Leopard?

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #371309
    doxym
    Participant

    Hi,

    I’ve just taken delivery of our first Leopard machine and set about trying to integrate it with our Tiger 10.4.11 Open Directory Server.

    I’m impressed so far with the AutoFS implementation, and the inability to do SSL to an Open Directory Server out of the box is pretty inexcusable (Linux prompts you for certificates to configure openldap, why can’t user friendly OS X do this!) but have come across a major flaw that has lead to me having to install Tiger on the machine. No matter what I try I can’t get MCX Login Scripts to work.

    I’ve got the script we use with Tiger in the OD record for the computer group and have setup the config with:

    sudo defaults write com.apple.loginwindow EnableMCXLoginScripts -bool TRUE
    sudo defaults write com.apple.loginwindow MCXScriptTrust -string Authenticated

    Nothing happens.
    I’ve tried upping the trust level (changing the bind settings as per the OSX Server docs) but to no avail.

    I’ve also tried copying the script to the local disc and then making that a login hook:

    sudo defaults write com.apple.loginwindow LoginHook /Library/Managed/loginscript.sh

    but again nothing.

    Although I know the script works fine on Tiger, I’ve tried a very simple script that just creates a local folder at the user, but nothing. The Console and system.log don’t show any obviously related error messages.

    Has anyone successfully managed to get LoginHook/Login Scripts to work on Leopard, or is this a feature to be restored in 10.5.2?

    #371310
    khiltd
    Participant

    Will launchd not suffice?

    #371314
    doxym
    Participant

    This could be a temporary work-around, but it defeats the point of domain management, and how would one go about writing a launchd script to create folders etc *when* any user logs in, without breaking the use of the remote account for a Tiger machine?

    Is it possible there is some undocumented extra switch that has to be given to loginwindow?

    #371319
    khiltd
    Participant

    [QUOTE][u]Quote by: doxym[/u][p]how would one go about writing a launchd script to create folders etc *when* any user logs in[/p][/QUOTE]

    In /Library/LaunchAgents/:

    [code]

    Label
    com.khiltd.whoami
    ProgramArguments

    id

    RunAtLoad
    [/code]

    Output during fast user switching:

    Jan 30 09:35:32 Panopticon com.khiltd.whoami[30242]: uid=502(nate) gid=20(staff) groups=20(staff),98(_lpadmin),80(admin)
    Jan 30 09:44:52 Panopticon com.khiltd.whoami[30368]: uid=503(khiltd) gid=20(staff) groups=20(staff),98(_lpadmin)

    Doesn’t catch SSH logins if that’s what you’re after, but it does run when loginwindow does.

    #371337
    doxym
    Participant

    Thanks, that worked (although had to jump through some sudo hoops to get the functionality we required).

    I’ve created a bug report with Apple…

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.

Comments are closed