Forum Replies Created

Viewing 14 posts - 16 through 29 (of 29 total)
  • Author
    Posts
  • in reply to: Setting launchd dependancy for first time run script #376889
    thomasb
    Participant

    Where have you put your launchd file?

    I think you need to make a LaunchAgent (put your plist file into /Library/LaunchAgents/, with root:wheel 644 permissions), to be able to use the [b]LimitLoadToSessionType[/b] key.

    [url]http://devworld.apple.com/technotes/tn2005/tn2083.html#SECLAUNCHDAGENT[/url]

    [quote][u]Quote: Apple[/u][p]”If you set LimitLoadToSessionType to an array, be aware that each instance of your agent runs independently. For example, if you set up your agent to run in LoginWindow and Aqua, the system will first run an instance of your agent in the loginwindow context. When a user logs in, that instance will be terminated and a second instance will launch in the standard GUI context.

    Finally, there are some significant gotchas associated with developing a pre-login launchd agent; see Sample Code ‘PreLoginAgents’ for more information.“[/p][/quote]

    [b]/Library/LaunchAgents/com.company.example.plist[/b]
    [code]

    Label
    com.company.example
    LimitLoadToSessionType

    LoginWindow

    ProgramArguments

    /path/to/your/script

    RunAtLoad
    [/code]

    in reply to: Development at a Standstill #376822
    thomasb
    Participant

    Will do! Looking forward to hear your thoughts about image creation and deployment, and of course about InstaDMG.

    in reply to: Development at a Standstill #376820
    thomasb
    Participant

    Sorry to hear this. Excellent work so far! Really appreciate the time and effort you have spent on the InstaDMG project 🙂

    I hope to see you at MacSysAdmin 2009 in Sweden.

    Good luck with your new job!

    in reply to: Setting default language #375359
    thomasb
    Participant

    Hehe… glad I can contribute.

    No, we do not enable root. The Setup Assistant creates/modifies files in the root home folder, as mentioned above. Since we bypass the Setup Assistant, we need to install them and make sure they “stick” to what they are supposed to.

    [code]/usr/libexec/PlistBuddy -c Print /Library/Preferences/com.apple.HIToolbox.plist
    Dict {
    AppleItlbNumber = Dict {
    smRoman = 16383
    }
    AppleEnabledInputSources = Array {
    Dict {
    InputSourceKind = Keyboard Layout
    KeyboardLayout Name = Norwegian
    KeyboardLayout ID = 12
    }
    }
    AppleInputSourceHistory = Array {
    Dict {
    InputSourceKind = Keyboard Layout
    KeyboardLayout Name = Norwegian
    KeyboardLayout ID = 12
    }
    }
    AppleDefaultAsciiInputSource = Dict {
    InputSourceKind = Keyboard Layout
    KeyboardLayout Name = Norwegian
    KeyboardLayout ID = 12
    }
    AppleDateResID = Dict {
    smRoman = 12
    }
    AppleTimeResID = Dict {
    smRoman = 12
    }
    AppleSelectedInputSources = Array {
    Dict {
    InputSourceKind = Keyboard Layout
    KeyboardLayout Name = Norwegian
    KeyboardLayout ID = 12
    }
    }
    AppleNumberResID = Dict {
    smRoman = 12
    }
    AppleItlbDate = Dict {
    smRoman = 16383
    }
    }[/code]
    [code]/usr/libexec/PlistBuddy -c Print /private/var/root/Library/Preferences/ByHost/com.apple.HIToolbox.{UUID}.plist
    Dict {
    AppleItlbNumber = Dict {
    smRoman = 16383
    }
    AppleEnabledInputSources = Array {
    Dict {
    InputSourceKind = Keyboard Layout
    KeyboardLayout Name = Norwegian
    KeyboardLayout ID = 12
    }
    }
    AppleInputSourceHistory = Array {
    Dict {
    InputSourceKind = Keyboard Layout
    KeyboardLayout Name = Norwegian
    KeyboardLayout ID = 12
    }
    }
    AppleDateResID = Dict {
    smRoman = 12
    }
    AppleTimeResID = Dict {
    smRoman = 12
    }
    AppleSelectedInputSources = Array {
    Dict {
    InputSourceKind = Keyboard Layout
    KeyboardLayout Name = Norwegian
    KeyboardLayout ID = 12
    }
    }
    AppleDefaultAsciiInputSource = Dict {
    InputSourceKind = Keyboard Layout
    KeyboardLayout Name = Norwegian
    KeyboardLayout ID = 12
    }
    AppleItlbDate = Dict {
    smRoman = 16383
    }
    AppleNumberResID = Dict {
    smRoman = 12
    }
    }[/code]

    in reply to: Setting default language #375352
    thomasb
    Participant

    All these files contain information about localization, that is why they are modified/created by the Setup Assistant when selecting a country and keyboard layout.
    [code]/usr/libexec/PlistBuddy -c Print /private/var/root/Library/Preferences/com.apple.HIToolbox.plist
    Dict {
    AppleItlbNumber = Dict {
    smRoman = 16383
    }
    AppleTimeResID = Dict {
    smRoman = 12
    }
    AppleDateResID = Dict {
    smRoman = 12
    }
    AppleNumberResID = Dict {
    smRoman = 12
    }
    AppleItlbDate = Dict {
    smRoman = 16383
    }
    }[/code]
    [code]/usr/libexec/PlistBuddy -c Print /private/var/root/Library/Preferences/com.apple.print.PrintingPrefs.plist
    Dict {
    DefaultPaperID = iso-a4
    }[/code]
    Sorry. I misspelled the com.apple.print.PrintingPrefs.plist

    We have created two packages for our localization. One that installs the files listed above, and one that installs a LaunchAgent and a shell script which fixes the Keyboard Layout in root’s ByHost HIToolbox plist on first boot. Seems to work fine. No issues since we implemented it in late December 2008. No more random switching to U.S. Keyboard Layout.

    In addition, we install all localization files into both English.lproj and no.lproj (Norwegian), because the home folders created on first login by ADmitMac are based on the English user template (that’s at least what the documentation from Thursby says). We also change the value of the .CFUserTextEncoding in the English.lproj to the same as the one in no.lproj

    I guess checking the .CFUserTextEncoding is an other way of finding the right Locale ID 🙂

    in reply to: Setting default language #375332
    thomasb
    Participant

    [QUOTE][u]Quote by: alantrewartha[/u][p]small addition to the efforts to localise keyboard input etc. after imaging my machines with the steps ^^ up thread, i still found some of my users reverting to US keyboard (“I can’t type a pound sign any more!”)

    the only place i found remnants of a plist refering to a US layout was in the root preferences:

    /private/var/root/Library/Preferences/ByHost/com.apple.HIToolbox.[byhostkeystuffhere].plist

    so i edited that (PlistBuddy) to set it to UK (with much the same commands as in the the steps up thread) and that LOOKS like it might be doing the trick. i logged in as a user with no library and it made a default byhost HIToolbox plist that is definitely setting for UK alright.

    trouble from the imaging PoV is that the root ByHost plist isn’t IN the image is it. it must be generated at some point from a setting some place else. not sure when either.[/p][/QUOTE]

    Same here. We had problems with our keyboard layout randomly reverting to U.S.

    I ran fseventer while running the Setup Assistant:
    [code]sudo /System/Library/CoreServices/Setup\ Assistant.app/Contents/MacOS/Setup\ Assistant[/code]
    The following files were modified when setting the Country and Keyboard Layout in the first two steps of the Setup Assistant:
    /private/var/root/Library/Preferences/com.apple.HIToolbox.plist
    /private/var/root/Library/Preferences/com.apple.print.PrinteringPrefs.plist
    /private/var/root/Library/Preferences/ByHost/com.apple.HIToolbox.{UUID}.plist
    /Library/Preferences/com.apple.HIToolbox.plist
    /Library/Preferences/.GlobalPreferences.plist

    To solve this, I made a shell script launched by a LaunchAgent running over the loginwindow checking the Keyboard Layout in root’s ByHost HIToolbox plist (I set the LimitLoadToSessionType key in the launchagent plist to LoginWindow). If the Keyboard Layout is not set to what I want it to be, it is changed to what I want (I use PlistBuddy to check and fix).

    It seems like the Keyboard Layout in the root’s ByHost HIToolbox only is changed on first boot of a newly imaged Mac, because the script has only run once after first boot. I implemented this fix in our image in the end of December 2008, and the keyboard layout has not changed since. The main problem here is that the Setup Assistant is bypassed. That obviously causes some problems, but it seems like the root’s ByHost HIToolbox is the key to making the Keyboard Layout stick.

    typofonic: Sorry, but I do not know where all these locale ID’s are stored. To find the Locale ID, I guess you just have set the language for a user account and find the right value in the ~/Library/Preferences/ByHost/com.apple.HIToolbox.{UUID}.plist

    in reply to: Setting default language #375256
    thomasb
    Participant

    To find the ISO language code of your current system, type this command:
    [code]cat /private/var/log/CDIS.custom[/code]

    To list all ISO codes supported by the Apple installer, type this command:
    [code]installer -listiso[/code]

    in reply to: dsconfigad #373800
    thomasb
    Participant

    Do the binding on the first boot instead, as pteeter suggests.

    Have a look at Brian Hanson’s AD AutoBind solution: [url]http://forums.bombich.com/viewtopic.php?t=12126[/url]

    One of the tricky things about AD binding using launchd, is making your script wait for Network/DNS before running. That problem is solved in a pretty neat way by Brian.

    Using the following code in your launch daemon (plist)…
    [code]KeepAlive

    SuccessfulExit

    [/code]
    You can make your script exit 1, until your DNS is reachable (i.e. /usr/sbin/scutil -r DOMAIN), and launchd will restart the script until exit 0 🙂

    in reply to: which default to write #373672
    thomasb
    Participant

    Try [url=http://www.macupdate.com/info.php/id/19141]fseventer[/url] 🙂

    That will easily show you what files gets changed.

    1. Download, install and open fseventer
    2. Open System Preferences > International > Input Menu
    3. Go back to fseventer and hit the play button
    4. Go back to System Preferences and change the keyboard layout
    5. Go baack to fseventer hit the pause button and see what files got changed

    Open the files you see got changed in i.e. [b]Property List Editor[/b], and make sure the settings you want are there.

    in reply to: How do you build your packages? #373482
    thomasb
    Participant

    Scott Amory at the Apple installer-dev mailing list found that if you check [b]Allow Custom Location[/b], the destination sticks.

    [url=http://lists.apple.com/archives/installer-dev/2008/Jul/msg00094.html]http://lists.apple.com/archives/installer-dev/2008/Jul/msg00094.html[/url]

    I guess that is a possible workaround until the problem is fixed. At least for packages made for the InstaDMG build train only (and you can rebuild your packages later on when the bug is fixed).

    in reply to: How do you build your packages? #373458
    thomasb
    Participant

    Good. It seems like that is the way to go with PackageMaker 3.x.x.

    The only problem now, is that the latest version of PackageMaker can not remember the [b]destination[/b] set for each component. Do you have the same problem?

    1. Open PackageMaker 3.0.2 (174)
    2. Create a new Package
    3. Add a component or more
    4. Set the destination for your component(s)
    5. Save and close your project
    6. Reopen the project

    When you look at the destination field for your component(s) after reopening the PackerMaker project, it is blank.

    in reply to: Editing System Prefs #373436
    thomasb
    Participant

    [QUOTE][u]Quote by: ewhite[/u][p]As a reference for others: I used fseventer [url]http://fernlightning.com/doku.php?id=software:fseventer:start[/url] to figure out where changes were made, which was very helpful.[/p][/QUOTE]
    Thanks a lot for the tip!

    Awesome little app 🙂

    in reply to: Need help customizing InstaUser #373276
    thomasb
    Participant

    [QUOTE][u]Quote by: calloway[/u][p]Hi!
    I attempted to customize the instauser scripts, following the directions I found in a different post here. However, when I add the resulting package to my install train, run instadmg, and then restore the resulting image to a test volume, I get an unbootable copy of OS X. It begins to load the kernel, then reboots. I’ve tried booting in verbose mode, but nothing jumps out; also there is no crash or panic logs.[/p][/QUOTE]
    I had a smiliar problem with [b]Instauser 10.5[/b]. The problem I had was that the [b]var[/b] folder was overwritten (it could not see the symlink to /private/var). It sounds like you have the same problem. This must be a bug with [b]Instauser 10.5[/b].

    The problem is that the [b]var[/b] folder is a symlink to [b]/private/var[/b]. Just put your [b]var[/b] folder inside a [b]private[/b] folder before adding it to your package, and you should be good to go.

    It should look like this, when issuing the following command on your package:
    [code]lsbom -fs `pkgutil –bom /path/to/your/package.pkg`[/code]
    That should give you an output simliar to this.
    [code]./Library/StartupItems/instauser/._instauser
    ./Library/StartupItems/instauser/StartupParameters.plist
    ./Library/StartupItems/instauser/instauser
    ./private/var/db/dslocal/nodes/Default/groups/admin.plist
    ./private/var/db/dslocal/nodes/Default/users/admin.plist
    ./private/var/db/shadow/hash/LONG-STRING-OF-CHARACTERS[/code]
    An other thing to be aware of, is that you need to get the permissions for your StartupItem correct. PackageMaker is not able to get it exactly right, when clicking [b]Apply Recommendations[/b].
    [code]folder (instauser): root/wheel : drwxr-xr-x (755)
    script: root/wheel : -rwxr-xr-x (755)
    StartupParameters.plist: root/wheel : -rw-r–r– (644)[/code]
    [url]http://developer.apple.com/documentation/MacOSX/Conceptual/BPSystemStartup/Articles/StartupItems.html[/url] (see [b]Startup Item Permissions[/b])

    You can make a new user account in System Preferences, and just copy the right folders/files, if you want to make your account the GUI-way. Then just distribute it the way it is done in [b]Instauser 10.5[/b] (remember /private/var).

    Hope this helps.

    in reply to: DNS for the hard of thinking #368957
    thomasb
    Participant

    huwmac: I know this might be a bit late, and maybe you have figured it out already, but maybe this can help you in the right direction.

    [b]Tiger Server Quickstart Guide[/b]
    [url]https://www.afp548.com/filemgmt/index.php?id=34[/url]

    [b]Internal DNS Setup with Dynamic Public IP[/b]
    [url]http://discussions.apple.com/thread.jspa?threadID=236181[/url]

    Good luck! 🙂

Viewing 14 posts - 16 through 29 (of 29 total)