09-17-2007
Quote:
Originally Posted by
StrengthThaDon
also is there a way to JUST spawn children? I don't understand why fork() would create parent processes.
You are missing the point.
Your code is executing within one process.
You call fork().
Your code is now executing in two processes, the original process and the child process,
fork() only creates one new process, the child process.
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Below an example of what I mean. The first attempt does what I want; the second doesn't, because bash assumes a line break means the end of an individual "command unix". Is there some way that I can convince bash to parse out, eg, to the closing parenthesis?
I'm thinking this would allow for... (1 Reply)
Discussion started by: tphyahoo
1 Replies
2. Shell Programming and Scripting
Hi,
I need to spawn mutilpe threads , each invoking a different set of shell scripts, in parallel.
What would be the best way to do that.
Any sample script would greatly help. I am a novice at Unix so any help is much appreciated.
Thanks (5 Replies)
Discussion started by: neeto
5 Replies
3. Shell Programming and Scripting
I have several huge files wich contains oracle table creation scripts as follows:
I would need to remove the pattern colored in red above. Any sed/awk/pearl code will be of much help.
Thanks (2 Replies)
Discussion started by: sabyasm
2 Replies
4. UNIX for Advanced & Expert Users
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
5. Shell Programming and Scripting
Hi,
I have to look for the full string below in a large file(>5GB) , but that string may be spread in two lines.
string :-- "f8f8 f5f0 f0f0 f1f7 f4f7 f7c1"
By grep "f8f8 f5f0 f0f0 f1f7 f4f7 f7c1" file | tail -1
, I am getting incorrect result because there is a line after this also which... (1 Reply)
Discussion started by: finder255
1 Replies
6. UNIX for Advanced & Expert Users
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. Shell Programming and Scripting
Hello all,
first off great forum.
Now for my little problem.
Using RHEL 5.4 and awk. Been doing code since a few month. So just starting.
My problem is handeling data on multiple lines.
{
if ($1 != LASTKEY && h ~ /.*\/s_fr_/) {
checkgecos( h, h )
h=""
... (2 Replies)
Discussion started by: maverick72
2 Replies
8. AIX
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
9. Shell Programming and Scripting
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
10. Solaris
Hi,
I am having a shell script on Solaris 10 which has a while loop as shown below.
#!/usr/bin/ksh
#
while
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... (3 Replies)
Discussion started by: chekusi
3 Replies
LEARN ABOUT FREEBSD
protect
PROTECT(1) BSD General Commands Manual PROTECT(1)
NAME
protect -- protect processes from being killed when swap space is exhausted
SYNOPSIS
protect [-i] command
protect [-cdi] -g pgrp | -p pid
DESCRIPTION
The protect command is used to mark processes as protected. The kernel does not kill protected processes when swap space is exhausted. Note
that this protected state is not inherited by child processes by default.
The options are:
-c Remove protection from the specified processes.
-d Apply the operation to all current children of the specified processes.
-i Apply the operation to all future children of the specified processes.
-g pgrp Apply the operation to all processes in the specified process group.
-p pid Apply the operation to the specified process.
command Execute command as a protected process.
Note that only one of the -p or -g flags may be specified when adjusting the state of existing processes.
EXIT STATUS
The protect utility exits 0 on success, and >0 if an error occurs.
EXAMPLES
Mark the Xorg server as protected:
pgrep Xorg | xargs protect -p
Protect all ssh sessions and their child processes:
pgrep sshd | xargs protect -dip
Remove protection from all current and future processes:
protect -cdi -p 1
SEE ALSO
procctl(2)
BUGS
If you protect a runaway process that allocates all memory the system will deadlock.
BSD
September 19, 2013 BSD