unix shutdown scripts

unix shutdown scripts

Post by ragu » Sat, 05 May 2001 03:35:56



Hi
Is it possible to write a shell script which would allow me to shutdown
1 sun machine after another from a single centralised machine. I will be
allowing rsh to allow me to go from 1 machine to another. TIA
ragu
 
 
 

unix shutdown scripts

Post by David Lod » Sat, 05 May 2001 04:20:15



>Is it possible to write a shell script which would allow me to shutdown
>1 sun machine after another from a single centralised machine. I will be
>allowing rsh to allow me to go from 1 machine to another. TIA

If you want to do this; though I'd have my reservations about doing a
blanket shutdown, you can do this:

for i in server1 server2 server3
do
   rsh ${i} "shutdown -h -y now"
done

Or if you want to read the servers from a file, make the file with the
server list in it and replace the for with:
   for i in $(<serverfile)

dave

 
 
 

unix shutdown scripts

Post by Rahul Meht » Sat, 05 May 2001 04:08:16


it's possible
to put up a some while loop or for loop

like this

for i in $cat filename
do
rlogin $i
shutdown -y -r0
done

filename holds your server names.
you need to setup host file and trusted host i.e /etc/.rhosts for root
login

Hi
Is it possible to write a shell script which would allow me to
shutdown
1 sun machine after another from a single centralised machine. I will
be
allowing rsh to allow me to go from 1 machine to another. TIA
ragu

 
 
 

unix shutdown scripts

Post by David Lod » Sat, 05 May 2001 07:20:30




Quote:>it's possible
>to put up a some while loop or for loop
>like this

>for i in $cat filename
>do
>rlogin $i
>shutdown -y -r0
>done

I know that this an 'off the top of head and untested' answer but
*don't* do that above - apart from an UUOC it will not work and will
shut down the calling machine!

dave

 
 
 

unix shutdown scripts

Post by Michael Heimin » Sat, 05 May 2001 08:22:41





> >it's possible
> >to put up a some while loop or for loop
> >like this

> >for i in $cat filename
> >do
> >rlogin $i
> >shutdown -y -r0
> >done

> I know that this an 'off the top of head and untested' answer but
> *don't* do that above - apart from an UUOC it will not work and will
> shut down the calling machine!

> dave

I wouldn't use any r* tools, everything can be done with
ssh much more secure.

The easiest way would be to setup an account which
uses key exchange to enable remote login without password.
This account needs to be enabled to use the shutdown command,
normally only root can perform this and direct root login
should be disabled. "apropos ssh" should show you all man
pages on this topic on your box and the net is full of docs
how to setup this.

Michael Heiming

 
 
 

1. /usr/ucb/shutdown & Shutdown scripts

I have a Solaris 8 system, along with AIX & Linux systems.  I prefer to to
shut the system down with the '/usr/ucb/shutdown' command, because it uses
the same syntax as my other systems.  However, when I run 'shutdown -r
now', which reboots, the system does not execute the runlevel 0 scripts. I
assume this is because it is not running the /etc/rc6 script. However, the
/usr/ucb/ flavor of shutdown is supplied by Sun, so I would _hope_ that it
would simply enter runlevel 6 the same as a /usr/sbin/shutdown -i 6 would.
 Is this a known behavior, or do I have a problem?

2. automatic hostname resolution

3. Shell script help, shutdown script

4. Line lenght limitation for 'cut'

5. migration tool from UNIX script to NT script

6. help: partition table corrupt

7. . sed script unix shell script ispell

8. SB 2x CDROM work with linux?

9. VMS Script -> UNIX script

10. calling CGI scripts from UNIX shell scripts->html

11. Help with shutdown script

12. startup & shutdown scripts

13. shutdown script