Shutdown Scripts


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Shutdown Scripts
# 1  
Old 07-08-2003
Shutdown Scripts

Hi,

Recently I've created a script to shutdown a few hpux workstations and I found out that the script can only shutdown 1 workstation and then exit out from the loop without shutting down the rest of the workstation. The scripts is as below (brief one):

hcp_list="machine_a
machine_b"

for hcp_machine in $hcp_list; do

remsh $hcp_machine '/usr/bin/shutdown -hy 0'

done

Please advise! Thanks!

Rgds,
Chin Soon
# 2  
Old 07-08-2003
Replace

hcp_list="machine_a
machine_b"

with

hcp_list="machine_a machine_b"
# 3  
Old 07-08-2003
Hi,

Actuall it was a typo mistake in my previous mail, it should be

hcp_list ="machine_a \
machine_b"

which is the same as :

hcp_list="machine_a machine_b"


And fyi, I'm using ksh to write this script.

Thanks!

Rgds,
Chin Soon
# 4  
Old 07-08-2003
That loop works fine for me...

Comment out the line with "remsh" on it and place "echo $hcp_machine" under it and make sure the loop really is ending. It should execute twice...
# 5  
Old 07-09-2003
Hammer & Screwdriver

Thanks! It works!
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Red Hat

Boot/Shutdown scripts

Server: Redhat 6.2 Goal: Startup script/Shutdown Script Overview: I'm just doing a very basic test. I'm not getting chkconfig involved. Research so far: I've found a few different ways of getting this to work, some say I can just drop the scripts in the corresponding rc directory. Others... (4 Replies)
Discussion started by: HayekSplosives1
4 Replies

2. Shell Programming and Scripting

KSH - How to call different scripts from master scripts based on a column in an Oracle table

Dear Members, I have a table REQUESTS in Oracle which has an attribute REQUEST_ACTION. The entries in REQUEST_ACTION are like, ME, MD, ND, NE etc. I would like to create a script which will will call other scripts based on the request action. Can we directly read from the REQUEST_ACTION... (2 Replies)
Discussion started by: Yoodit
2 Replies

3. Shell Programming and Scripting

Oracle DB Start shutdown scripts

Hi, We have a requirement wherein we do not want to share the Oracle DB sys and system passwords to be shared with the support desk. But they will be responsible for starting/shuting down the Database. Is it possible to write a shell script which will read the sys and system passwords from a... (0 Replies)
Discussion started by: narayanv
0 Replies

4. AIX

Please update inittab/rc.shutdown/rc scripts to start/stop mqm (need help Urgent)

HI i need help from seniors on this issue, i need to know how to do this, i need to update 50+ server starting saturday. below is the ticket which i have with full description. Currently MQ Series must be stopped before and started after any reboot. Not having the start/stop as part of... (2 Replies)
Discussion started by: gulamibrahim
2 Replies

5. UNIX for Dummies Questions & Answers

Script to force Oracle database shutdown when shutdown immediate does not work

I have Oracle 9i R2 on AIX 5.2. My Database is running in shared server mode (MTS). Sometimes when I shutdown the database it shutsdown cleanly in 4-5 mints and sometimes it takes good 15-20 minutes and then I get some ora-600 errors and only way to shutdown is by opening another session and... (7 Replies)
Discussion started by: aixhp
7 Replies

6. AIX

Startup/shutdown scripts in AIX

hi, If we place Sxx (startup script) and Kxx(shutdown script) in /etc/rc.d/rc2.d,then it would start and stop automatically(assume they are linked to other script that actually starts/stops). is there really a link needed here to /etc/rc.d/init.d? if not,what is the use of this directory..?... (1 Reply)
Discussion started by: to_bsr
1 Replies

7. Shell Programming and Scripting

Changing the Bash Scripts to Bourne Scripts:URGENT

Hi, I have to write a program to compute the checksums of files ./script.sh I wrote the program using bash and it took me forever since I am a beginner but it works very well. I'm getting so close to the deadline and I realised today that actually I have to use normal Bourne shell... (3 Replies)
Discussion started by: pgarg1989
3 Replies

8. AIX

Startup/Shutdown scripts

I understand that by putting in entries into the /etc/inittab file. We can actually call the our scripts during startup. mkitab "start_server:2:once:sh /scripts/startserver.sh" Would the system wait for startserver.sh finish executing before it goes to another entry? and how long would it... (1 Reply)
Discussion started by: vincente
1 Replies

9. SuSE

Shutdown scripts

Hello all I'm trying to automate the startup/shutdown of my database whenever the OS is bounced ... OS : Linux (Kernel : 2.4.20.-6) Oracle : 9.2.0.5 The contents of /etc/init.d/dbora file is listed below case "$1" in 'start') su - $ORACLE_OWNER -c "$ORACLE_HOME/bin/dbstart"... (1 Reply)
Discussion started by: luft
1 Replies

10. UNIX for Advanced & Expert Users

rc scripts, do i need to kill them on shutdown?

We have a bunch of tools, that run on linux and on unix, I've got start up scripts that bring up their license managers when the unix box boots, do I need kill scripts for when the box is shutting down? I've not seen much documentation on this, just on getting the license managers started, but... (1 Reply)
Discussion started by: kymberm
1 Replies
Login or Register to Ask a Question