Summary:Automatic init.d Script

From: Naidu V. T. (naidu@iitcoman.com)
Date: Wed Sep 17 2003 - 04:01:51 EDT


Hi,

Many thanks to Thomas Kolejaka,Jim Fitzmaurice,Bluejay Adametz,Jenny Butler.

Original Question:

 I need to run an UPS script automatically when tru64 boots up. I
> know I need to modify the following script with an option of start
> and stop and I have to copy these files in /sbin/initd. I tried but
> it's not happening. I will be happy if gurus can help me to modify
> the following script and procedure for automatic startup. We are
> using Tru64 version 5.1a .
>
>

Answer:

After moving the script to the /sbin/init.d directory, you have to link
it to the /sbin/rc3.d directory.

# cd /sbin/rc3.d
# ln -s ../init.d/<scriptname> S99<scriptname>

I also found a script which can automate the above activity. Example of that script is as follows:

#!/sbin/sh
#

PATH=/sbin:/bin:/usr/bin:/etc:/usr/sbin:/usr/ucb
export PATH
script=/sbin/init.d/powerflag
killscript=/sbin/rc0.d/K00powerflag
startscript=/sbin/rc3.d/S60powerflag
#
if [ ! -x $script ]; then
  cp pf_boot.osf1 $script
  chmod 744 $script
fi
#
if [ ! -x $startscript ]; then
  ln $script $startscript
  chmod 744 $startscript
fi
#
if [ ! -x $killscript ]; then
  ln $script $killscript
  chmod 744 $killscript
fi

Thanks & Regards

Naidu
OHI Telecommunications
P.O BOX 889, PC 113
MUSCAT



This archive was generated by hypermail 2.1.7 : Sat Apr 12 2008 - 10:49:36 EDT