12-16-2008
Script causing multi forked porcess - not sure why ?
Hi,
I am facing a queer situation, when i run the below script it starts up multiple forked process and hangs the unix server , we had to reboot the server once. Can someone pls help me understand why the script is causing multiple processes to start . If i run ps -ef rename.sh , after i start it and even cancel it (ctrl+c) still i see numerous multiple processes starting
Script name: rename.sh
#!/bin/sh
(
echo "Script `$basename $0` started at `date`"
echo " "
echo "Merging files A and B at `date`"
## merge 1
merge_files.ksh /dummy/test/files file_list_A*txt N N file_list_A.txt
echo "Status (file_list_A) = $?"
echo " "
merge_files.ksh /dummy/test/files file_list_B*txt N N file_list_B.txt
echo "Status (file_list_B) = $?"
#
echo " "
#
echo "Merging files C and D at `date`"
## Merge 2
merge_files.ksh /dummy/test/files file_list_C*txt Y N file_list_C.txt
echo "Status (file_list_C) = $?"
echo " "
merge_files.ksh /dummy/test/files file_list_D*txt Y N file_list_D.txt
echo "Status (file_list_D) = $?"
echo " "
echo "Merging of files Done at `date`"
echo "-----------------------------------------------------------"
) >> log_file.log
above script when i run seems to go in loops and forks out multiple porcesses quite fast. The embedded script "merge_files.ksh" which actually merges the files is fine as it runs perfectly fine independently with NO issues at all. The embedded merge_files.ksh takes 5 parameters (as can be seen above when calling it) - file dir path, file pattern name, header flag (Y if header is there and N if not), Footer flag (same as header flag, Y and N), final name of then merged file.
can someone pls guie me as to why the above script is going in loops and forking multiple processes ?
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Not sure what has changed in the Unix environment.
The following script which was working is now not working.
#!/usr/bin/ksh
# -----------------------------------------------------------------------------
# File: monitor_db.sh
#
#... (1 Reply)
Discussion started by: uuser
1 Replies
2. Programming
I know how to read and write if i have a forked process with only one child. However what is involved with reading and writing with many forked processes. Say one parent that forks 5 children, and needs to communicate with all 5 in half duplex.
int temp, counter=0;
do{
pipe(temp);
... (5 Replies)
Discussion started by: steveneliuk
5 Replies
3. Programming
Hi,
From within my C++ program, I fork a child process and execl an ftp session (solaris), like this :
std::string szStartCmd = "ftp -i -n -v 192.168.149.31";
int nExecRes = execl("/bin/sh", "sh", "-c", szStartCmd.c_str(), (char *)0);
I use 2 pipes to communicate between my... (7 Replies)
Discussion started by: KittyJ
7 Replies
4. UNIX for Advanced & Expert Users
Hi,
I have an application where if it runs indivisually could able to execute commands (like system("ls")) and could able to execute tcl script.
Same application if started from health monitor process (From health monitor process my application will be forked), it could not execute the... (1 Reply)
Discussion started by: chandrutiptur
1 Replies
5. Shell Programming and Scripting
I am relatively new at scripting in linux. Most of my scripting knowledge comes from doing batch scripting in windows.
Anyway, I have this script I'm trying to write that will install a program called Nagios along with a few other packages. I know it has to be something at the beginning that is... (4 Replies)
Discussion started by: nanite51
4 Replies
6. Programming
This needs to work on HPUX and Linux.
I do a fork and create a child process. During execution of the child process, it is possible child become lost or get killed. That is the reason why I create the child process. However if the child process doesnt get killed, I do want to know the return... (2 Replies)
Discussion started by: usustarr
2 Replies
7. Shell Programming and Scripting
Hi,
Closing the thread (3 Replies)
Discussion started by: dbashyam
3 Replies
8. Shell Programming and Scripting
can someone please explain to me what i'm doing wrong with this code:
WELT=$(awk '(($1 ~ "^${caag}$") || ($2 ~ "^${caag}$"))' /tmp/Compare.TEXT)
when run from the command line, it works. but it seems to be having a problem doing the comparison when variables are involved.
i tested from... (1 Reply)
Discussion started by: SkySmart
1 Replies
9. Shell Programming and Scripting
Hi,
I have a problem where I need to make this input:
nameRow1a,text1a,text2a,floatValue1a,FloatValue2a,...,floatValue140a
nameRow1b,text1b,text2b,floatValue1b,FloatValue2b,...,floatValue140b
look like this output:
nameRow1a,text1b,text2a,(floatValue1a - floatValue1b),(floatValue2a -... (4 Replies)
Discussion started by: nricardo
4 Replies
10. Shell Programming and Scripting
I am trying to check multiple server's "uptime" in a loop over "ssh".
When I execute multiple ssh commands with hard coded servernames script is executing fine.
But when I pass server names using while loop, script is exiting after checking first server's status, why?
# serverList... (8 Replies)
Discussion started by: kchinnam
8 Replies
LEARN ABOUT DEBIAN
forked-daapd
FORKED-DAAPD(8) RSP & DAAP media server FORKED-DAAPD(8)
NAME
mt-daapd - RSP & iTunes-compatible DAAP server
SYNOPSIS
forked-daapd [options]
DESCRIPTION
forked-daapd is an RSP (Roku Streaming Protocol) and DAAP (Digital Audio Access Protocol) server. It allows you to share your music collec-
tion over the local network using the RSP protocol used by devices from Roku and/or the DAAP protocol also used by Apple's iTunes.
OPTIONS
-d level
Log level (0-5).
-D dom,..,dom
Debug domains; available domains are: config, daap, db, httpd, main, mdns, misc, rsp, scan, xcode, event.
-s Synchronous logging; logging is asynchronous by default. Use when debugging, especially if debugging a crash.
-c file
Use file as the configuration file.
-P file
Write PID to file.
-f Run in the foreground.
-b ffid
ffid to be broadcast in mDNS records.
-v Display version information.
FILES
/etc/forked-daapd.conf
/var/cache/forked-daapd
AUTHORS
forked-daapd was written by Julien BLACHE <jb@jblache.org> as a fork/rewrite of mt-daapd. mt-daapd was written by Ron Pedde
<ron@pedde.com>.
This manual page was written by Rogerio Brito <rbrito@users.sf.net> and Julien BLACHE <jblache@debian.org> for the Debian project (but may
be used by others).
forked-daapd 2010-07-18 FORKED-DAAPD(8)