HP UX Startup Script

Startup scripts in HP-UX 10 

Startup scripts in /sbin/init.d obtain configuration data from variables in the scripts located in /etc/rc.config.d
i.e. static route information is read from /etc/rc.config.d/netconf

Links in the relevant startup scripts in /sbin need to be created pointing to /sbin/init.d
i.e. /sbin/rc2.d/S89app1_start could point to /sbin/init.d/app1_start and would start when the system came up to run-level 2
 

Where does HP-UX keep auto startup scripts?

The actual scripts are held in /sbin/init.d but they are run from links in the level directories.. /sbin/rc2.d, /sbin/rc3.d etc. 

Some scripts look  for a flag in a config file in /etc/rc.config.d directory to determine if they should run or not. If Postgres doesn't have a file there then you should remove or rename the links in the level directories. 

To find them run this -

find /sbin -name "[SK]*postgres"

and remove or rename the scripts found. 

If you are  renaming them then prefixing them with off (off.S70postgres) will stop  them from running. Leave the script located in /sbin/init.d. You might  want to run it another time.
 

How to add the startup script in HP-UX 11.11

in /sbin/init.d/mystartupscript

#!/sbin/sh

#
# mystartup script
#

PATH=/sbin:/usr/sbin:/usr/bin
export PATH

rval=0
set_return() {
        x=$?
        if [ $x -ne 0 ]; then
                echo "EXIT CODE: $x"
                rval=1
        fi
}

case $1 in
start_msg)
        echo "My ownstartup"
        ;;

'start')
        if [ -f /usr/flex/112.8/license.dat ]; then
 

                cd /usr/flex/112.8

               ./lmstat -c /usr/flex/112.8/license.dat
 

                set_return
        else
                rval=2
        fi
        ;;

*)
        echo "usage: $0 {start}"
        rval=1
        ;;
esac

exit $rval

Then

chmod +500 /sbin/init.d/mystartupscript

ln -s /sbin/init.d/mystartupscript/ /sbin/rc2.d/S995mystartupscript

Just one thing, I supposed that lmstat is self demonizing, else you need to add  a & on lmstat line.

Unix Tips

See Also
Ways of System Logging and Auditing

Have a Unix Problem
Unix Forum - Do you have a UNIX Question?

Unix Books :-
UNIX Programming, Certification, System Administration, Performance Tuning Reference Books

Return to : - Unix System Administration Hints and Tips

(c) www.gotothings.com All material on this site is Copyright.
Every effort is made to ensure the content integrity.  Information used on this site is at your own risk.
All product names are trademarks of their respective companies.
The site www.gotothings.com is in no way affiliated with or endorsed by any company listed at this site.
Any unauthorised copying or mirroring is prohibited.