I had trouble getting stuff in /Library/StartupItems working. I would copy the files other people have posted here, but it never seemed to work.
The trick, I found, was in the line-feed characters. I created my scripts using BBEdit, saved using Macintosh line feeds. It appears (I think, anyway) that if you the script will not execute properly.
To see why, open Terminal and do vi script_name. You'll see that the entire script is treated as one comment line with ^M charcters instead of proper line feeds. (This is because Unix uses \n characters for line feeds and the Mac uses \r.)
So, when you build your script, either use BBEdit to save as a Unix file, or use a Unix tool (vi, pico, etc.) to create the script.
Also, you should probably change the owner of the file to root, using "sudo chown root file_name"