What I was thinking of doing was a ps for each process with the certain conf file. Then put that in a loop and if it doesn't exist then restart the process. However, I don't see how I can output the contents of ps so that i can check this. Like how do you do this: ps -arguments < temp.file
i'd try counting the number of processes first before i'd check for which process-configuration pair needs to be restarted ... here's my version of events ... put in cron to run every minute or hack what you need off it and put in your script in perpetual loop ...
Code:
#! /bin/ksh
numproc=7
a="sam.cfg h20war.cfg cypher.cfg ryan.cfg cell.cfg alls.cfg p31.cfg"
if [ `ps -ef | grep -wc "cod_lnxded"` -lt "$numproc" ]
then
ps -ef | awk '/cod_lnxded/ && !/awk/' > /tmp/$$
if [ -s /tmp/$$ ]
then
for cfg in $a
do
grep $cfg /tmp/$$ > /dev/null
if [ $? -ne 0 ]
then
/path/cod_lnxded +exec $cfg &
fi
done
else
for cfg in $a
do
/path/cod_lnxded +exec $cfg &
done
fi
rm /tmp/$$ 2> /dev/null
fi
exit 0
Last edited by Just Ice; 05-04-2005 at 10:00 AM..
Reason: add code to remove the /tmp/$$ file after use
Hello
We had an old system designed in fortran that ran on a IBM RS6000 AIX 3.2 system. The person who designed is long gone. It was replaced with a completely different (non unix) system 6 years ago. We still used it for historical lookups of older information. Well yesterday it died. The... (5 Replies)
Hello,
Iam a running a apache webserver in CentOS and i get a heavy traffic about 2.5 lac pageviews daily and my db size is about 2GB. Now the problem is after serving some lacs of requests by apache....Both apache and mysql hangouts and the system gets hanged up...using all resources in the... (2 Replies)
Hi everybody,
I want to find out all the processes that ran before a server crashed. Is that possible?
I've looked in /var/log/messages and found out that the system was out of memory.
A user probably wrote a script (in Perl or Python) that used up all available memory and crashed the... (11 Replies)
Hello
Im using redhat and try to debug my application , its crashes and in strace I also see it has problems , but I can't see any core dump
I configured all the limit ( im using .cshrc ) and it looks like this :
cputime unlimited
filesize unlimited
datasize unlimited... (8 Replies)
Hi,
I need a script to kill the process Ids for the user ABC.
I prepared the following script after that while logging with user therough script i am not sure how to pass the user name and password.Can ou modify the script and help me out.
#!/bin/bash
for filesize in $(ls -ltr | grep... (4 Replies)
Hi,
How is it possible to restart only your process. I can get the process killed but I am not able to start it.
For eg : i first did this ps -ef|grep _out --displays all the process with _out in the name
then I killed kill -15 36044 -- process id.
Now how can i start the same... (1 Reply)
Hi Admins,
In my local Vmware system i have installed solaris but while getting my root disk mirrored in svm I changed the vfstab entries and rebooted the server , the server got crashed, and now the root file systems and other filesystems are crashed.
Please help me in recovering this. (2 Replies)
Hi friends,
I have one unix command which is used to check the network status manually.
followig is the command
check_Network this command give follwoing status
Network 1 is ok
Network 2 is ok
network 3 is ok
network 4 is ok
.
.
.
.
Network 10 is... (8 Replies)
Hello,
In our Production system one process is in S state(interruptible)and after killing and restarting the process gives 'advertise error'.
This error goes after rebooting the Server.
I have RHEL 5.9 (tikanga) OS in our server.
We tried debugging the issue with the help of 'strace' command... (9 Replies)
Discussion started by: Rohits
9 Replies
LEARN ABOUT DEBIAN
abootimg
ABOOTIMG(1) General Commands Manual ABOOTIMG(1)NAME
abootimg - manipulate Android Boot Images.
DESCRIPTION
Tool to read/write/update android boot images
SYNOPSIS
abootimg
-i <bootimg>
abootimg
-x <bootimg> [<bootimg.cfg> [<kernel> [<ramdisk> [<secondstage>]]]]
abootimg
-u <bootimg> [-c "param=value"] [-f <bootimg.cfg>] [-k <kernel>] [-r <ramdisk>] [-s <secondstage>]
abootimg
--create <bootimg> [-c "param=value"] [-f <bootimg.cfg>] -k <kernel> -r <ramdisk> [-s <secondstage>]
OPTIONS -i print boot imgage informations
-x Extract a boot image
-u Update a boot image
--create
Create a boot image
Options for extracting boot images
bootimg
Existing bootimage to use
bootimg.cfg
Name for the bootimg.cfg file, defaults to bootimg.cfg
kernel Name for the kernel image, defaults to zImage
ramdisk
Name for the ramdisk image, defaults to initrd.img
secondstage
Name for the second-stage image, defaults to stage2.img
Options for updating and creating boot images
bootimg
Existing bootimage to use
-c param=value
Existing bootimage to use
-f <bootimg.cfg>
Update bootimg.cfg with the named file
-k <kernel>
Update kernel with the named file
-r <ramdisk>
Update ramdisk with the named file
-s <secondstage>
Update secondstage image with the named file
ABOOTIMG(1)