Hi folks. I'm trying to get the following script working for rebooting a bunch of clients. Up to now I've been using PSSH, but when they all startup again at the same time I get a few mount problems. So, I'm trying to stagger the reboot command. I know reboot will depend on what's running at the time. According to everything I've found the code attached should work.
But this script exits after the first iteration. I'm guessing the rsh command loses connection without getting a return so it produces an error "closed by remote host" which isn't getting caught
Could someone please help me out, this is starting to drive me nuts! I could do the same in python, but then I'm not learning anything.
Hi ,
reading a "file1" with 2 data in each line (VAR1 and VAR2) , i'm using a while loop like this :
cat file1|awk '{print $1,$2}'|while read VAR1 VA2
do
echo $VAR1
echo $VAR2
done
as this example shows , it works but if between do and done i use
a "rsh" command , the script reads... (6 Replies)
hi
I wanted to use the for loop structure in tandem with rsh command and the result to be redirected into a local .lst file within a shell script .
Tried the following but does not help :confused: .
rsh ABCD "cd /bosp/local/home/linus/;for i in `ls -ltr | grep ^- | awk {'print $9'}`
do... (4 Replies)
Hi all
I have a while read loop that I use to process a file line by line. The reason I am using this is due the fact that I have spaces in the line and a for loop treats the space as a delimeter for the next record.
In this while loop I have a rsh. It appears that cos of the rsh, I never get... (1 Reply)
Hey all
I have two scripts, one script containing the guts of my code.
The other simply loops through a list, calling the other script on each iteration.
Problem is when I add the line
`/usr/bin/rsh -l root $HOSTNAME ""`
to my main script, the loop never seems to exectute any more... (1 Reply)
hi everyone,
I have the following problem: the foreach loop inside rsh doesn'work.
I have tried the for command but it's not recognized. with the foreach command I don't receive any error, but it doesn't really make the cycle, ignoring the foreach and executing 1 time the echo command. Anyone has... (5 Replies)
Oh, how I regret having chosen Solaris...
Really, when I had my last Solaris system ten years ago I was just happy. Like a tank: Slow, clumsy, ugly but rock-solid. Then there were 10 ten years of FreeBSD and OpenBSD. Simple install, fast, nice, good package managing, just running along.
But... (11 Replies)
So I was patching a Solaris 10 U08 X86 X2200 box in preparation for an Oracle upgrade. Rebooted the box because the patches failed and the box will not boot successfully. I need to back up the zones on the 2 drives before going further. I pulled the drives and attempted to mount them on my Ubuntu... (0 Replies)
Hello folks,
I've a (perhaps) simple question.
In a text file I've :
server_name1: directory1
server_name2: directory2
server_name3: directory3
I want to make a loop that lets me connect and operate on every server:
rsh server_name1 "ls -l directory1"
I've tried with awk,... (6 Replies)
Discussion started by: gogol_bordello
6 Replies
LEARN ABOUT OSF1
reboot
reboot(2) System Calls Manual reboot(2)NAME
reboot - Reboots system or halts processor
SYNOPSIS
#include <sys/reboot.h>
void reboot( int howto );
PARAMETERS
Specifies a mask of options.
DESCRIPTION
The reboot() function restarts the system. The startup is automatic and brings up /vmunix in the normal, nonmaintenance mode. The calling
process must have superuser privilege to run this function successfully. However, a reboot is invoked automatically in the event of unre-
coverable system failures.
The following options, defined in the sys/reboot.h include file are passed to the new kernel or the new bootstrap and init programs. They
are supplied as values to the howto parameter. The default, causing the system to reboot in its usual fashion. Dump kernel memory before
rebooting; see the savecore command for more information. The processor is simply halted; no reboot takes place. The disks are not sync'd
before the processor is halted or rebooted. Normally, the disks are sync'd (see the sync() command) before the processor is halted or
rebooted. Because the disks are not sync'd with the RB_NOSYNC option, loss of data may result from using it.
When no options are given (that is, RB_AUTOBOOT is used), the system is rebooted from file vmunix in the root file system of unit 0 (zero)
of a disk chosen in a processor-specific way. (see the fsck command).
RETURN VALUES
If successful, this call does not return. Otherwise, a -1 is returned and errno is set to indicate the error.
ERRORS
If the reboot() function fails, errno may be set to the following value: The calling process does not have appropriate privilege.
RELATED INFORMATION
Commands: crashdc(8),
halt(8), init(8), reboot(8), savecore(8) delim off
reboot(2)