Sponsored Content
Top Forums Shell Programming and Scripting starting a bash session as child process to another bash session from a process Post 302297583 by alirezan on Friday 13th of March 2009 08:51:24 PM
Old 03-13-2009
Quote:
Originally Posted by cfajohnson

You would need a method to communicate with the running process and have it start the child process.

Interesting...something like IPC..eh? but how? any ideas?

Thanks
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

simulate session.getMaxInactiveInterval() in bash script

hi everyone, I have a question about the java object oriented function which to simulate in bash script... here is the function "session.getMaxInactiveInterval() / 60 " got any web can read this function? coz i need to simulate to bash script... Hope someone give me a suggestion... (0 Replies)
Discussion started by: ryanW
0 Replies

2. UNIX for Advanced & Expert Users

attach process from another ssh session

Hi, I was logged in on a server, by ssh, with a vim open, when the battery of my laptop got empty. When I return to the server by ssh, I can see my previous ssh session still open, and the vim process running (ttyp0). Is there a way to attach that vim to my new session (ttyp4)? Here's part... (2 Replies)
Discussion started by: raphinou
2 Replies

3. Shell Programming and Scripting

bash telnet session logging

I'm looking at allowing remote telnet into my server. like any security-minded administrator, I want to log what my users type on the telnet session. I'm using the script command to generate transcripts of the users session. I have /etc/profile set to automatically start the script command... (2 Replies)
Discussion started by: ramnet
2 Replies

4. UNIX for Dummies Questions & Answers

bash history - each session in different file

Hello How to configure, or where to have each session history in different file Example: someone is connecting as root and at this time is creating file in which we have history of executed command to server is connecting another user and is created another file with command executed by... (1 Reply)
Discussion started by: vikus
1 Replies

5. Solaris

Number of process per user session

Hi All, Do we have any option through which we can limit the number of process which can be started by single user session. Thanks (3 Replies)
Discussion started by: kumarmani
3 Replies

6. Shell Programming and Scripting

[KSH/Bash] Starting a parent process from a child process?

Hey all, I need to launch a script from within 2 other scripts that can run independently of the two parent scripts... Im having a hard time doing this, if anyone knows how please let me know. More detail. ScriptA (bash), ScriptB (ksh), ScriptC (bash) ScriptA, launches ScriptB ScirptB,... (7 Replies)
Discussion started by: trey85stang
7 Replies

7. Shell Programming and Scripting

Session independent process

Hi i am trying to run a report which takes approx 5 hours to complete so what i did i put that reporting command in background and then this reporting process started executed in background but the problem is when i close that session that background job lost :( .... please help me that... (3 Replies)
Discussion started by: aishsimplesweet
3 Replies

8. UNIX for Dummies Questions & Answers

connecting to an ssh session with putty/bash.

Hi, sorry if this is the wrong forum for this question but I couldnt spot another obvious forum for it. I have a windows shortcut which opens up a saved session in putty. From this session I then ssh to another remote server. I was wondering is there a way that I can either edit my shortcut... (2 Replies)
Discussion started by: newb1000
2 Replies

9. Emergency UNIX and Linux Support

Nohup process getting killed after closing PUTTY session

I am running a process in nohup . nohup getkeys.ksh 132 > 132.out & When I close the putty terminal,The process is getting killed . default_signal_handler called for signal no: 1 Is there a way to keep the process running even If I close the terminal (2 Replies)
Discussion started by: prasperl
2 Replies

10. Shell Programming and Scripting

Bash find with expression - process all files except the starting-points

Hello. This command is correct : find /home/user_install \( \ \( -type d \( -iname "*firefox*" -o -iname ".cache" -o -iname "libreoffice" \ -o -iname "session" -o -wholename "/home/user_install/dir1/dir2/¬¬ICONS_WALLPAPERS_THEMES" \) \) -prune -o \ \( -type f \( -iname... (1 Reply)
Discussion started by: jcdole
1 Replies
Child(3pm)						User Contributed Perl Documentation						Child(3pm)

NAME
Child - Object oriented simple interface to fork() DESCRIPTION
Fork is too low level, and difficult to manage. Often people forget to exit at the end, reap their children, and check exit status. The problem is the low level functions provided to do these things. Throw in pipes for IPC and you just have a pile of things nobody wants to think about. Child is an Object Oriented interface to fork. It provides a clean way to start a child process, and manage it afterwords. It provides methods for running, waiting, killing, checking, and even communicating with a child process. NOTE: kill() is unpredictable on windows, strawberry perl sends the kill signal to the parent as well as the child. SYNOPSIS
BASIC use Child; my $child = Child->new(sub { my ( $parent ) = @_; .... # exit() is called for you at the end. }); my $proc = $child->start # Kill the child if it is not done $proc->complete || $proc->kill(9); $proc->wait; #blocking IPC # Build with IPC my $child2 = Child->new(sub { my $self = shift; $self->say("message1"); $self->say("message2"); my $reply = $self->read(1); }, pipe => 1 ); my $proc2 = $child2->start; # Read (blocking) my $message1 = $proc2->read(); my $message2 = $proc2->read(); $proc2->say("reply"); SHORTCUT Child can export the child() shortcut function when requested. This function creates and starts the child process in one action. use Child qw/child/; my $proc = child { my $parent = shift; ... }; You can also request IPC: use Child qw/child/; my $child = child { my $parent = shift; ... } pipe => 1; DETAILS
First you define a child, you do this by constructing a Child object. Defining a child does not start a new process, it is just the way to define what the new process will look like. Once you have defined the child you can start the process by calling $child->start(). One child object can start as many processes as you like. When you start a child an Child::Link::Proc object is returned. This object provides multiple useful methods for interacting with your process. Within the process itself an Child::Link::Parent is created and passed as the only parameter to the function used to define the child. The parent object is how the child interacts with its parent. PROCESS MANAGEMENT METHODS
@procs = Child->all_procs() Get a list of all the processes that have been started. This list is cleared in processes when they are started; that is a child will not list its siblings. @pids = Child->all_proc_pids() Get a list of all the pids of processes that have been started. Child->wait_all() Call wait() on all processes. EXPORTS
$proc = child( sub { ... } ) $proc = child { ... } $proc = child( sub { ... }, $plugin, @data ) $proc = child { ... } $plugin => @data Create and start a process in one action. CONSTRUCTOR
$child = Child->new( sub { ... } ) $child = Child->new( sub { ... }, $plugin, @plugin_data ) Create a new Child object. Does not start the child. OBJECT METHODS
$proc = $child->start() Start the child process. SEE ALSO
Child::Link::Proc The proc object that is returned by $child->start() Child::Link::Parent The parent object that is provided as the argumunt to the function used to define the child. Child::Link::IPC The base class for IPC plugin link objects. This provides the IPC methods. HISTORY
Most of this was part of Parrallel::Runner intended for use in the Fennec project. Fennec is being broken into multiple parts, this is one such part. FENNEC PROJECT
This module is part of the Fennec project. See Fennec for more details. Fennec is a project to develop an extendable and powerful testing framework. Together the tools that make up the Fennec framework provide a potent testing environment. The tools provided by Fennec are also useful on their own. Sometimes a tool created for Fennec is useful outside the greator framework. Such tools are turned into their own projects. This is one such project. Fennec - The core framework The primary Fennec project that ties them all together. AUTHORS
Chad Granum exodist7@gmail.com COPYRIGHT
Copyright (C) 2010 Chad Granum Child is free software; Standard perl licence. Child is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the license for more details. perl v5.10.1 2011-03-07 Child(3pm)
All times are GMT -4. The time now is 06:42 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy