Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

During my activities on Solaris 10 machine I need twice reboot the Solaris unit and after reboot I'd like to run several scripts.

Before first reboot I store in /etc/rc3.d/S99myScript some bash script.The script runs OK after reboot

Before second reboot I store in the same place under same name /etc/rc3.d/S99myScript Perl script. After reboot the script does not run.

When I execute Perl script manually on my Solaris machine the script working OK.

What is going on here?

share|improve this question

migrated from stackoverflow.com May 22 '11 at 21:44

This question came from our site for professional and enthusiast programmers.

    
Why do you switch the scripts? What's wrong with one conditional rc.script running your 1st reboot script if (insert logic here: eg. last reboot done by your perl script or last reboot > 10 mins ago) and your pl script else? You could even use a another file containing the script to load next. Did I miss something? BTW, what does the log say? –  mbx May 22 '11 at 21:58
add comment

1 Answer

up vote 1 down vote accepted

Solaris 10 and older rc scripts are strictly old bourne shell syntax. The sheband I suspect you added is ignored. If you need to run a perl script, just call it with perl myscript.perl from your rc script instead.

By the way, rc scripts are still supported but deprecated by SMF on Solaris 10 and newer.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.