1846858 Members
8856 Online
110256 Solutions
New Discussion

Re: Scripting question

 
SOLVED
Go to solution
S-un-B-ix-S
Advisor

Scripting question

We are heading to a DR exercise, and we turn off a high number of services in /etc/rc.config.d. This always takes a fair bit of time and it can be scripted.

Does anyone have a script similar that already accomplishes this function?

We edit the following stuff:
/etc/rc.config.d/ems EMS_ENABLED=0
/etc/rc.config.d/opcagt OPCAGT=0
/etc/rc.config.d/cmcluster AUTOSTART_CMCLD=0
/etc/rc.config.d/runner.conf START_RUNNER=0
/etc/rc.config.d/hpservices.conf START_TUNER=0
/etc/rc.config.d/SnmpHpunix SNMP_HPUNIX_START=0
/etc/rc.config.d/SnmpMaster SNMP_MASTER_START=0
/etc/rc.config.d/SnmpMib2 SNMP_MIB2_START=0
/etc/rc.config.d/SnmpTrpDst SNMP_TRAPDEST_START=0
/etc/rc.config.d/rstemsListener RST_LISTENER=0
/etc/rc.config.d/emsagtconf AUTOSTART_EMSAGT=0
/etc/rc.config.d/cmsnmpagt AUTOSTART_CMSNMPD=0
/etc/rc.config.d/ntp NTP=0
6 REPLIES 6
Raj D.
Honored Contributor
Solution

Re: Scripting question

Also attached,
Enjoy Have fun,

Raj.
" If u think u can , If u think u cannot , - You are always Right . "
Patrick Wallek
Honored Contributor

Re: Scripting question

Are you installing the OS from scratch? Or are you using Ignite/UX to install? If you were using Ignite/UX, either a make_tape_recovery or make_net_recovery, then you wouldn't have to do this. The OS would be installed as it was when the make_tape|net_recovery image was made.
Scott Lindstrom_2
Regular Advisor

Re: Scripting question

Patrick -

We also turn off lots of RC scripts at DR tests. Even though we install the OS from the ignite tape, there are lots of services we don't want started yet. Most are system services, but also lots of things in rc3.d like our backup software, databases, etc.

Scott
TwoProc
Honored Contributor

Re: Scripting question

It's actually easier than a sed editing script. There ALREADY exists a tool for scripting making those changes in HPUX, it's called "ch_rc"

Your whole solution would be fixed with:

ch_rc -a -p EMS_ENABLED=0
ch_rc -a -p OPCAGT=0
ch_rc -a -p AUTOSTART_CMCLD=0
ch_rc -a -p START_RUNNER=0
ch_rc -a -p START_TUNER=0
ch_rc -a -p SNMP_HPUNIX_START=0
ch_rc -a -p SNMP_MASTER_START=0
ch_rc -a -p SNMP_MIB2_START=0
ch_rc -a -p SNMP_TRAPDEST_START=0
ch_rc -a -p RST_LISTENER=0
ch_rc -a -p AUTOSTART_EMSAGT=0
ch_rc -a -p AUTOSTART_CMSNMPD=0
ch_rc -a -p NTP=0

Note: In case you were wondering why: The individual file names themselves didn't need to be passed to ch_rc command because they all exist in the default area of /etc/rc.config.d.
We are the people our parents warned us about --Jimmy Buffett
Raj D.
Honored Contributor

Re: Scripting question

S-un-B-ix-S ,
You may be new here, But you must take time to review your threads and assign point to those who replied and tried to help you.

cheers,
" If u think u can , If u think u cannot , - You are always Right . "
S-un-B-ix-S
Advisor

Re: Scripting question

Sed worked awesomely.