Sponsored Content
Full Discussion: FORK/EXEC technique
Top Forums UNIX for Dummies Questions & Answers FORK/EXEC technique Post 302103464 by Perderabo on Thursday 18th of January 2007 05:36:53 PM
Old 01-18-2007
I don't really understand this question. But let's say you have a process running that is a shell. A user has entered the command "date". So no wthe shell would like to run the separate program called "date" and display the results to the user. So the shell will fork and exec the date program. Why? Because that is the only game in town. There is no other way for it to run another program. Either it can fork/exec and thus run the program or it can tell the user "sorry I don't know how to run programs".
 

10 More Discussions You Might Find Interesting

1. Programming

Fork and exec

Hello! I am working on a server where I should have 4 (resident)processes, one of them being "the father" of the others, so I do 3 forks. The problem that I have is that I do an accept (for sockets) in the "father" process and I want to transmit the job to one of the processes "child" with... (3 Replies)
Discussion started by: driki
3 Replies

2. Programming

fork/exec clobbers write. I need ideas why...

On my *nix box, I have a telegram program. When I go like tel person "la\nla\nla\n" the person sees "la\nla\nla\n" However, when I have a program that forks and execs tel like: pid = fork(); if (pid < 0) { perror("fork failed"); exit(EXIT_FAILURE); } if (pid == 0) {... (7 Replies)
Discussion started by: frequency8
7 Replies

3. Solaris

fork and exec ftp

Hi, I need to find/implement an application that FTPs (puts) all new files in a certain directory to an external storage unit. This application should check for new files every 10 seconds (leaving the FTP connection open in between the 10 seconds). The easiest way would be if there are... (2 Replies)
Discussion started by: KittyJ
2 Replies

4. Shell Programming and Scripting

fork and exec

I need to ssh to a remote server and run my script there. This is my script. $ssh = "ssh username@host"; $cmd = "$ssh 'cd <my dir> && < sudo Run_exe>'"; my $pid = fork; if ($pid == 0){ exec $cmd; } When I run this I get: pccons_getchar: got r == 0 (1 Reply)
Discussion started by: looza
1 Replies

5. Programming

How forbid use fork() in exec() program.

Hello World! I am writing code in C++ which have to launch another application X using exec(). I would like to set some limits on it using setrlimit etc... My problem is that i don't know how to forbid using fork() and strlimit by application X. How can i do it? (3 Replies)
Discussion started by: kzi
3 Replies

6. Programming

Fork and then exec problem with signals

Hi All, In my program i am handling SIGHUP signal. In the handler i fork and then exec on child process same binary file which is running. Parent process will die after 10 mins. Now my child process which was exec with same binary file is not receiving SIGHUP signal. Below is the progran code:... (6 Replies)
Discussion started by: sushil_shalin
6 Replies

7. Programming

Newbie question on exec,fork, wait,pipe C

Hello everybody.I want to make clear that i am not going to ask from anybody to build my asignement but i have a big problem. I can't seem to find anywhere ONE good example on C about what i am trying to do:wall:.I think it is simple. All i ask is one example, even a link is fine. So, i want to... (1 Reply)
Discussion started by: Cuervo
1 Replies

8. UNIX for Dummies Questions & Answers

fork with exec

What is is difference between 'fork with exec' and 'fork without exec'? How both are related? (1 Reply)
Discussion started by: kkalyan
1 Replies

9. Linux

Best Compression technique ?

Hi all, I am working on a sample backup code, where i read the files per 7200 bytes and send it to server. Before sending to server, i compress each 7200 bytes using zlib compression algorithm using dictionary max length of 1.5 MB . I find zlib is slow. Can anyone recommend me a... (3 Replies)
Discussion started by: selvarajvss
3 Replies

10. UNIX for Beginners Questions & Answers

Question about global environment variables & fork() exec()

Hello... And thanks in advance for any help anyone can offer me on my question! I've been doing a lot of reading to try and find my answer... But I haven't had any luck What I'm trying to understand is where a child process inherits global environment variables from? I understand the exec()... (2 Replies)
Discussion started by: bodisha
2 Replies
GLOBUS-FORK-STARTE(8)					       University of Chicago					     GLOBUS-FORK-STARTE(8)

NAME
globus-fork-starter - Start and monitor a fork job SYNOPSIS
globus-fork-starter DESCRIPTION
The globus-fork-starter program is executes jobs specified on its standard input stream, recording the job state changes to a file defined in the $GLOBUS_LOCATION/etc/globus-fork.conf configuration file. It runs until its standard input stream is closed and all jobs it is managing have terminated. The log generated by this program can be used by the SEG to provide job state changes and exit codes to the GRAM service. The globus-fork-starter program is typically started by the fork GRAM module. The globus-fork-starter program expects its input to be a series of task definitions, separated by the newline character, each representing a separate job. Each task definition contains a number of fields, separated by the colon character. The first field is always the literal string 100 indicating the message format, the second field is a unique job tag that will be distinguish the reply from this program when multiple jobs are submitted. The rest of fields contain attribute bindings. The supported attributes are: directory Working directory of the job environment Comma-separated list of strings defining environment variables. The form of these strings is var=value count Number of processes to start executable Full path to the executable to run arguments Comma-separated list of command-line arguments for the job stdin Full path to a file containing the input of the job stdout Full path to a file to write the output of the job to stderr Full path to a file to write the error stream of the job Within each field, the following characters may be escaped by preceding them with the backslash character: o backslash () o semicolor (;) o comma (,) o equal (=) Additionally, newline can be represented within a field by using the escape sequence . For each job the globus-fork-starter processes, it replies by writing a single line to standard output. The replies again consist of a number of fields separated by the semicolon character. For a successful job start, the first field of the reply is the literal 101, the second field is the tag from the input, and the third field is a comma-separated list of SEG job identifiers which consist the concatenation of a UUID and a process id. The globus-fork-starter program will write state changes to the SEG log using these job identifiers. For a failure, the first field of the reply is the literal 102, the second field is the tag from the input, the third field is the integer representation of a GRAM erorr code, and the fourth field is an string explaining the error. ENVIRONMENT
If the following variables affect the execution of globus-fork-starter GLOBUS_LOCATION Path to Globus Toolkit installation. This is used to locate the globus-fork.conf configuration file. FILES
$GLOBUS_LOCATION/etc/globus-fork.conf Path to fork SEG configuration file. University of Chicago 12/01/2009 GLOBUS-FORK-STARTE(8)
All times are GMT -4. The time now is 05:20 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy