you use an treatment on every line but you took only the first line. It's more logical to put the head -1 before the awk treatement. Moreover the grep has the option "-m x" which stop reading file when the x patterns are found.
so the code should be :
Quote:
I do not want the last letter "A" here, because of which it does not reastar the process. Please advice.
awk is a powerful tool, if you use a simple grep you must filter lines with awk :
For your code :
Hi,
I have a task that Im stuck on. I have an elementary script named 'myscript' that prints "the script is running" once a second. It runs for 27 seconds. I need to write a 2nd script that starts 'myscript' and takes a parameter '$1' for a number. my 2nd script then needs to pause myscript... (1 Reply)
I am working on a project, which need to constantly watch the process, and check its status, if it was dead, it should be restart automatically.
Please kindly refer me to URL which teach how to write this kind of script, or service.
Thanks. (1 Reply)
I have a process that gradually eats up memory, it's currently at 80.2% and slowing down the linux server
> ps aux | grep SNMPME
root 3129 0.0 80.2 3591752 2480700 ? Sl Feb13 5:04 /opt/nampe/lib/snmpme/SNMPME config/startup.xml
Is there a command I can execute to restart this... (3 Replies)
Hi all.
I do have a script "startApp.sh" (app result is a file /opt/extract/appextract.txt)
I have no problems with stopping app
var1=`ps -ef | grep -v grep | grep MyApp | awk '{print $2}'`
kill -9 $var1
What I want to achieve is:
I start app, app is doing some extraction, after... (11 Replies)
Hi, I have a PHP application that starts a couple of processes on the server...the problem is that if I restart apache those running apps will die.
How can I start them in a way that they are not killed when I restart/stop apache ?
$cmdstr = "nohup ".$config."/".$config."... (6 Replies)
I have posted this on the Web subforum but it seems that nobody knows to do this, maybe someone has a solution here. Thank you
I have a PHP application that starts a couple of processes on the server...the problem is that if I restart apache those running apps will die.
How can I start them... (1 Reply)
I have written a script which checks for a file if that is being updated or not. If the files is not being updated then it will restart the process.
#!/bin/sh
DATE=`date +%Y%m%d%H%M%S`
LOG_FILE=/var/xmp/log/XMP_*
INCEPT=`ls -l $LOG_FILE |awk '{print $5}'`
PROC=`xms show pr |grep -i... (3 Replies)
Hi all
I have networker running on a RHEL 5.7 and over time it hangs. So the solution backup team proposed is to check if the process is hung, to stop and start it.
Unfortunately for me, the rc script only allows three commands, start, stop and status (no restart option) so I managed to set... (15 Replies)
Hi all,
Tearing my hair out..!
I have a requirement to monitor and restart a unix process via a simple watchdog script.
I have the following 3 scripts that dont work for me..
script 1 (only produces 1 output if process is up or not)... (4 Replies)
Hi Guru's,
I just want to have an idea on how to restart a particular step when it fails?
SCENARIO
we have plenty of steps such as the following below:
Step 1
copy file from source to target location which is in a different server.
Step 2
create initial and incremental process
... (4 Replies)
Discussion started by: reignangel2003
4 Replies
LEARN ABOUT DEBIAN
opal-restart
OPAL-RESTART(1) Open MPI OPAL-RESTART(1)NAME
opal-restart - Restart a previously checkpointed sequential process using the Open PAL Checkpoint/Restart Service (CRS)
Note: This should only be used by the user if the application being restarted is an OPAL-only application. If it is an Open RTE or Open MPI
program their respective tools should be used.
SYNOPSIS
opal-restart [ options ] <SNAPSHOT HANDLE>
Options
opal-restart will attempt to restart a previously checkpointed squential process from the snapshot handle reference returned by opal_check-
point.
<SNAPSHOT HANDLE>
The snapshot handle reference returned by opal_checkpoint, used to restart the process. This is required to be the last argument
to this command.
-h | --help
Display help for this command
--fork Fork off a new process, which is the restarted process. By default, the restarted process will replace opal-restart process.
-w | --where
The location of the local snapshot reference.
-s | --self
Restart this process using the self CRS component. This component is a special case, all other CRS components are automatically
detected.
-v | --verbose
Enable verbose output for debugging.
-gmca | --gmca <key> <value>
Pass global MCA parameters that are applicable to all contexts. <key> is the parameter name; <value> is the parameter value.
-mca | --mca <key> <value>
Send arguments to various MCA modules.
DESCRIPTION
opal-restart can be invoked multiple, non-overlapping times. This allows the user to restart a previously running sequential process. See
opal_crs(7) for more information about the CRS framework and components.
When using the self CRS component, the <FILENAME> argument is replaced by the name of the program to be restarted followed by any arguments
that need to be passed to the program. For example, if under normal execution we would start our program "foo" as:
shell$ setenv OMPI_MCA_crs=self
shell$ setenv OMPI_MCA_crs_self_prefix=my_callback_prefix
shell$ ./foo arg1 arg2
To restart this process, we may only need to call:
shell$ opal-restart --self
-mca crs_self_prefix my_callback_prefix
./foo arg1 arg2
This will cause the "my_callback_prefix-restart" function to be called as soon as the program "foo" calls OPAL_INIT. You do not have to
call your program with the same argument set as before. There for we could have just as correctly called:
shell$ opal-restart --self-mca crs_self_prefix my_callback_prefix
./foo arg3
This depends upon the behavior of the program "foo".
SEE ALSO opal-checkpoint(1), opal_crs(7)1.4.5 Feb 10, 2012 OPAL-RESTART(1)