On 2/14/2010 11:26 AM, nope wrote: > I'm new to OpenSolaris and have been trying to figure out exactly how to get > one of my own created scripts to run at boot. I wrote the following sample > (perl) script just to see if I could get it to work, with no luck: > > ---------------------------------------------------------------------------- > #!/usr/bin/perl > > while(true) { > open(FILE, ">>file.txt"); > print FILE "This is a test script.\n"; > close(FILE); > sleep(300); > } > ----------------------------------------------------------------------------- > > The method I tried was: > > - Naming the script "myscript", and placing it in the /etc/init.d directory > - using "chmod +x myscript" to make it an executable > - creating a symbolic link with ln -s to the /etc/rc2.d and /etc/rc3.d > directories each with the name S50myscript > > I have searched exhaustively and can't seem to find a way to make this script > run at boot. Can anyone help?
If that script did run, your system would fail to boot. The problem is that the boot-time scripts are run synchronously. They're expected either to do some work and then exit, or to fork one or more daemons into the background -- and then exit. Having a boot script that just runs without exiting is toxic. There are a number of possibilities here. I suggest starting your investigation by looking at these files: /var/svc/log/milestone-multi-user:default.log /var/svc/log/milestone-multi-user-server:default.log Those files are where the rc2.d and rc3.d outputs are logged (respectively). -- James Carlson 42.703N 71.076W <carls...@workingcode.com> _______________________________________________ opensolaris-code mailing list opensolaris-code@opensolaris.org http://mail.opensolaris.org/mailman/listinfo/opensolaris-code