Script on Solaris spawning 2 processes for one shell script execution


 
Thread Tools Search this Thread
Operating Systems Solaris Script on Solaris spawning 2 processes for one shell script execution
# 1  
Old 06-04-2013
Script on Solaris spawning 2 processes for one shell script execution

Hi,

I am having a shell script on Solaris 10 which has a while loop as shown below.

Code:
#!/usr/bin/ksh
#
while [ ! -f LANDDIR/TRIGGERFILE ]
do
  sleep 60
done


Name of the shell script is coldcentric.sh. I executed script /DATAWAREHOUSE/LOAD/Scripts/coldcentric.sh from a command task in Informatica worklow as shown below.

Code:
ksh -c /DATAWAREHOUSE/LOAD/Scripts/coldcentric.sh

After this, I see 2 processes created for this shell script execution on Solaris which is not expected. For one script execution, i would expect one process to be created.

Code:
% ps -ef | grep '[c]oldcentric'
     DW  3146  3145   0 12:24:56 ?           0:00 /usr/bin/ksh -c /DATAWAREHOUSE/LOAD/Scripts/coldcentric.sh
     DW  3145 13496   0 12:24:56 ?           0:00 sh -c ksh -c /DATAWAREHOUSE/LOAD/Scripts/coldcentric.sh

I would appreciate if anybody helps me finding out the root cause for this.

Thanks
# 2  
Old 06-04-2013
I have little knowledge of Informatica but from the looks of the process table looks like you should use this in Informatica workflow:
Code:
/DATAWAREHOUSE/LOAD/Scripts/coldcentric.sh

instead of:
Code:
ksh -c /DATAWAREHOUSE/LOAD/Scripts/coldcentric.sh

It's as if Informatica was appending "sh -c" to whatever command you execute.

Besides, the shell script should already contain a valid shebang so there's no need to duplicate it in the command line.

Last edited by verdepollo; 06-04-2013 at 01:26 PM..
# 3  
Old 06-04-2013
I did modify as per your suggestion. I removed first line shebang and modified script execution through command task as below

Code:
/DATAWAREHOUSE/LOAD/Scripts/coldcentric.sh

But still i see 2 processes getting created as below.

Code:
 % ps -ef | grep '[c]oldcentric'
     DW  3623  3622   0 09:25:37 ?           0:00 sh -c /DATAWAREHOUSE/LOAD/Scripts/coldcentric.sh
     DW  3622 26562   0 09:25:37 ?           0:00 sh -c /DATAWAREHOUSE/LOAD/Scripts/coldcentric.sh

When i run the same script using ksh -c /DATAWAREHOUSE/LOAD/Scripts/coldcentric.sh, then i see only one process getting created.

As mentioned by you, informatica by default uses sh -c to execute scripts.
# 4  
Old 06-04-2013
That's strange. Is the while loop the only content of the script?
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Shell script executed from Informatica ETL tool is spawning 2 processes for one script

Hi, I am having a shell script which has a while loop as shown below. while do sleep 60 done I am executing this script from Informatica ETL tool command task from where we can execute UNIX commands/scripts. When i do that, i am seeing 2 processes getting started for one script... (2 Replies)
Discussion started by: chekusi
2 Replies

2. AIX

Multiple pconsole processes spawning indefinetly

Good night everyone, I've been trying to make AD authentication work with RBAC and I think I messed my test LPAR up. I've manually modified the /etc/security/user.roles file, adding a role to one of my AD users (who is not defined locally) and then runned setkst. It worked fine, but now I found... (3 Replies)
Discussion started by: Janpol
3 Replies

3. Shell Programming and Scripting

How to execute one shell script after execution of another shell script?

I have a master shell script master.sh which will invoke 2 shell scripts (test1.sh,test2.sh). Both of these shell scripts will execute stored procedure. I will invoke test1.sh, test2.sh respectively. Now both of these scripts are executing parallel. But i want to invoke the 2nd script(test2.sh)... (3 Replies)
Discussion started by: vel4ever
3 Replies

4. UNIX for Advanced & Expert Users

SSH using shell script terminates the script execution

Hello, I am writing a shell script in which i do ssh to remote server and count the number of files there and then exit. After the exit the shell script terminates which i believe is expected behavior. Can some one suggest me a way where even after the exit the script execution resumes. ... (2 Replies)
Discussion started by: manaankit
2 Replies

5. Shell Programming and Scripting

shell script for getting pid of spawn processes from shell

Hi, I am new this forum. I request you peoples help in understanding and finding some solution to my problem. Here it goes: I need to perform this set of actions by writing a shell script. I need to read a config file for the bunch of processes to execute. I need to fecth the pid of... (4 Replies)
Discussion started by: sachin4sachi
4 Replies

6. UNIX for Advanced & Expert Users

Help! imapd is spawning multiple processes, all of a sudden, for no reason!

Hi All, I need some assistance, if possible... Our IMAP server has recently (as of 10:30 GMT today) started spawning multiple processes for no reason! This is causing the mail server's load average to increase continually until the whole machine grinds to a halt. Here is a typical... (0 Replies)
Discussion started by: fishsponge
0 Replies

7. UNIX for Advanced & Expert Users

Crontab spawning multiple at processes

Hi - I need help. My user crontab is spawning multiple at processes (and multiple mencoder program starts, that exit, then restart, repeatedly), locking up my system. For example I have this entry in my crontab: $ sudo crontab -u victoria -e * * * * * ~/recordings/pvr1 * * * * *... (10 Replies)
Discussion started by: gstuart
10 Replies

8. Programming

spawning multiple processes spread across two files

I want to spawn n child processes but have two different classes..with the foremost one forking/spawning the child process and the latter performing a function w/ the spawned processes. I can do this in one class with an if statement and the simple if((pid=fork())==0) //child process { ... (1 Reply)
Discussion started by: StrengthThaDon
1 Replies

9. Shell Programming and Scripting

execution of shell script

How can I execute another shell script from one? Malay (5 Replies)
Discussion started by: malaymaru
5 Replies

10. Shell Programming and Scripting

Spawning a shell script

Hi there, I have a shell script which I need to run it from two different places on the same server, are there any specific rules I need to apply? What is the best practice to achieve this task. Regards (5 Replies)
Discussion started by: JimJim
5 Replies
Login or Register to Ask a Question