I in such case use a different UID when having 2 instances of the same program running to differenciate them (different UID - same GID with group set as -rws-on the directories ...)
The traditional way to check if a process is running is PID files. When you start it, arrange for a file containing its PID to be created to reference later. This avoids the ps | awk | grep | sed | cut | kitchen | sink nonsense, and is a lot more portable, and allows you to run more than one of the same thing independently without them conflicting.
It's possible that your daemons are creating PID files somewhere already. Take a look around their files.
What you are saying is to set a variable with the pid of my process and check if it's running based on that pid?
Would that alone solve the problem of parallel processes or do i have to combine this solution with the change of uid?
More specificly, on each of the environments i have this binary folder i have different scripts for verifying the processes, i mean i run them from different paths, being different scripts. They have the same permissions now. Each pair of isProgRunning and runProg to be in the same gid, but have different uid?
Dear All,
I have script.
Dest=""
IFS='
'
for translation in $(echo $MY_MAP)
do
t1=$(echo $translation | cut -d"=" -f1)
t2=$(echo $translation | cut -d"=" -f2| cut -d"," -f1)
if
then
Dest=$UNX/$u_product_path/$u_study_path/$UNXTR/$t2
break;
... (4 Replies)
i Run 2 scripts on all of around 50 nodes every day.
1.Mod_1.sh
2.Mod_2.sh
eg..
i run file with specific node no like
Mod_1.sh NODE_(node number)
Mod_2.sh NODE_(node number)
I want to run both file by using single script with unique node number.
Eg..
Mod_new.sh NODE_(node... (11 Replies)
Hi
We use "tcsh" shell . We do the following steps manually:
> exec ssh-agent zsh
> python "heloo.py" (in the zsh shell)
I am trying to do the steps above from a shell script
This is what I have so far
echo "Executing "
exec ssh-agent zsh
python "hello.py"
exit 0
Problem is... (5 Replies)
I would like to execute a commands in four different servers through ssh at a single instance(simultaneously).
Below are the details with examples,
ssh user1@server1 "grep xxxx logs"
ssh user1@server2 "grep xxxx logs"
ssh user1@server3 "grep xxxx logs"
Each statement will take some... (4 Replies)
hi all,
my system having two interfaces of 172.16.1.232 and 10.250.41.10 and i am using this to establish tunnel to our client network.
eth0=10.250.41.10
eth1=172.16.1.232
I am not able to connect when two interfaces are up
root@mind-41 ~]# ssh -l avytla 172.16.80.203
ssh:... (2 Replies)
Hi people,
I have a solaris OS system. I configured its interfaces. They are UP but not in RUNNING status except loopback interface. I made the interfaces DOWN and UP again. The other side of the interfaces (switch ports) are UP. Does anyone have any idea? What may cause this problem, How can I... (1 Reply)
Hi All,
Is there any way where we can run few commands with different shell in a shell script ?
Let's have an example below,
My first line in script reads below,
#!/bin/sh
However due to some limitation of "/bin/sh" shell I wanted to use "/bin/bash" while executing few... (9 Replies)
Hi,
i have a script which need to do behave differently when run as a startup process from init.d/ rc2.d script and when run manually from shell.
How do i distinguish whether my script is run by init process or by shell??
Will the command
/proc/$$/psinfo | grep "myscript" work well???... (2 Replies)
So I have yet another query which requires the genius of the users on Unix.com. Having asked around at my work (Tech company) No one can really answer my question thoroughly.
My goal is to get 2 Hard drives running at the same time and allow me to switch between working on one to the other.... (4 Replies)
Hello, I want to run 2 apaches simultaneusly in a system, one operating with port 80 and the other one with 85, i already have the configuration files ready and i tryed something i saw in a manual, like this:
first i start apache as normal:
/usr/local/etc/httpd/bin/apachectl start
the i... (2 Replies)