- This topic has 20 replies, 2 voices, and was last updated 14 years, 4 months ago by
dead2sin.
-
AuthorPosts
-
November 15, 2010 at 8:16 pm #379861
mgb123
ParticipantI’m experiencing issues with the Firstboot package and was hoping to reach out for assistance.
To the best of my understanding – the Firstboot package carries out the following:
-Package installs
*Installs firstboot.plist in Library/Launchd
*Installs firstboot.sh in Library/Scripts/(Insert your company/institution name here)
-Package Runs postflight on image being created
*Sets a number of ‘pre-boot’ settings which are baked into the imageAs a result the image will have a number of settings that are set into the image, and a number of settings that are dormant but will be implemented on the first successful boot of the machine.
I’ve used the info at the OS X Deployment Wiki – including the Firstboot template.
I’ve noticed the following:
-The firstboot.sh script isn’t proceeded by #!/bin/sh ([b]should[/b] it be?)
-There’s no mention of how to set the permissions on the /Library/Scripts/(insert your compnay/institution name here) directory. As a result, though I’ve ensured proper permissions on the script itself, I’m unsure of how to so for the directory. Currently my scripts directory is shows as ‘no access’.
-The firsboot.sh script doesn’t run at startup, or delete itself afterwards. Most of the postflight settings don’t seem to have applied either.I’m happy to post my actual scripts, and would appreciate any feedback.
November 16, 2010 at 12:08 am #379866dead2sin
Participant1. Yes, #!/bin/bash at the beginning of the script is desired. It indicates what type of script it is. This is common across all bash scripts.
2. Permissions are in step 6 towards the very end of the guide. Some others have run into this problem so I corrected the guide about a week ago with this info as follows:
[quote]Check the permissions on each item. Click each item on the left and select the contents section. The launchd item MUST be set to owner: root and group: wheel, permissions set to 644. If they are not set to this, the launchditem will never load the firstboot script. There are some issues with this and PackageMaker, so be 100% the permissions are set correctly and being applied correctly
[/quote]3. If the firstboot script runs, it will apply settings and then delete itself. If it isn’t deleted, the the permissions are most likely wrong and it never ran. If it is not present and the settings are not set, I’d check InstaDMG logs to confirm it was installed correctly (Or you can mount the image that was created and check for the presence of the script, this is probably the easiest way to go about it).
If you still have issues, feel free to post the script here to have people look over it or hop on ##osx-server on irc.freenode.net. There are always people around that are willing to help 🙂
Nate
November 16, 2010 at 1:13 am #379868mgb123
ParticipantI checked my permissions, they seem fine- one followup question then is, how do I set the permissions for the folder that I’m putting the script in?
For instance, if I tell Packagemaker that I want the script in /Library/Scripts/The_greatest_company_ever/firstboot.sh – by selecting the firstboot file and then listing /Library/Scripts/The_greatest_company_ever/ as the destination, my firstboot.sh permissions are fine, but the folder The_greatest_company_ever is marked as no access.
I thought perhaps the best way to deal with this would be to put the folder itself in the package, and then mark the permissions as 644 (which is drw-r–r– right?) but this didn’t seem to work either.
I’m doing another test image right now, I’ll post my progress. Thanks very much for the response!
November 16, 2010 at 1:37 am #379869mgb123
ParticipantNate,
I checked my permissions, everything seems to be in order- any chance that the 10.6.5 update hosed something with regards to Launchd?
November 16, 2010 at 2:01 am #379872dead2sin
ParticipantI’ll have to double check, but I just build an image this morning and tested it, everything in the firstboot seemed to run just fine.
Does the firstboot.sh script exist if you just mount the image and go to /Library/LaunchDaemons/ ?
Are any of the settings actually set that are present in the firstboot.sh script?
Nate
November 16, 2010 at 1:36 pm #379875mgb123
ParticipantNate- first off thanks very much for your time on this.
The script and the plist both exist. The error that I was getting in console is: Permission Denied, so chmod’ed the permissions to 644 – then I tried to run the script from the command line and got the following error: command not found – which was Odd, since I was looking at the firstboot.sh script.
One last attempt prior to calling it a night – sudo sh./firstboot.sh – and BAM everythign ran, and the machine rebooted. The changes implemented in the script have applied.
As a side note, the script deleted the .plist file, but the script didn’t self destruct- it’s still there in the directory.
So – I’m guessing that I’ve missed something in my plist – maybe?
November 16, 2010 at 2:09 pm #379876dead2sin
ParticipantPost your launchd item and your script and I’ll take a gander.
Nate
November 16, 2010 at 4:27 pm #379882mgb123
Participant[code]
[/code]
Label
com.mycompanyisbetterthanyourcompay.firstboot
ProgramArguments
/Library/Scripts/firstboot.sh
QueueDirectories
RunAtLoad
WatchPaths
November 16, 2010 at 4:58 pm #379883dead2sin
ParticipantThat looks right. How about the script itself? Just clean up any sensitive info first 🙂
Nate
November 16, 2010 at 5:40 pm #379885mgb123
ParticipantI tried to post my code, but it’s getting flagged as spam- any ideas.
November 16, 2010 at 5:52 pm #379886dead2sin
ParticipantI like [url]http://pastebin.com/[/url]. You can set it to automatically expire after X amount of time.
Nate
November 16, 2010 at 10:05 pm #379892mgb123
ParticipantI tried posting my code but it doesn’t seem to work – append this to the end of the pastebin dot com site name /pB25VVjU
November 17, 2010 at 1:01 am #379896dead2sin
ParticipantI’m getting pretty sick of this spam detected feature. I can’t even respond to what you are saying without it saying its spam.
Open this: [url]http://pastebin.com/K4GGU1bc[/url]
Nate
November 17, 2010 at 2:35 am #379897mgb123
ParticipantNate – Got the note – just to be clear, though my permissions are correct, the script doesn’t run at all unless I run it manually after booting. All settings are Running the script manually is odd too – – the script won’t run with the plain ‘ole ./firstboot.sh – it requires that I specify sh./firstboot.sh – is that normal?
I’m going to make the change to the running of the script in the .plist and see if that will resolve the running- I’m curious as to why my script requires this but no one else seems to have encountered it.
I’ll make the adjustments to the reboot/kill sequence that you specify.
Thanks for your help on this!
November 17, 2010 at 2:47 am #379898dead2sin
Participant[QUOTE][u]Quote by: mgb123[/u][p]Nate – Got the note – just to be clear, though my permissions are correct, the script doesn’t run at all unless I run it manually after booting. All settings are Running the script manually is odd too – – the script won’t run with the plain ‘ole ./firstboot.sh – it requires that I specify sh./firstboot.sh – is that normal?
I’m going to make the change to the running of the script in the .plist and see if that will resolve the running- I’m curious as to why my script requires this but no one else seems to have encountered it.
I’ll make the adjustments to the reboot/kill sequence that you specify.
Thanks for your help on this![/p][/QUOTE]
Ahhh, yea. You shouldn’t have to do sh ./firstboot.sh. Try doing chmod +x on it to make it executable and see what happens. I wonder if that is why it is not running. Try the chmod +x then reboot the machine. If it runs and deletes itself, you know what the issue is.
Nate
-
AuthorPosts
- You must be logged in to reply to this topic.
Comments are closed