System should not kill the child process when parent id is 1
HI i would like to know how i can simulate a shell scripts for my requirement.
example
Most of the time we restart our server by killing child processes ids , so processes will come again with new child id and parent id . My requirement is - When Parent Process id is 1 that time system should not kill the child processes , it should display one msg" Parent Process id is 1 , you should kill this process" .
How can i simulate this ?
This is simple command i wrote to kill only child processes ids but it doesn't look for parent id .. so whenever parent id is 1 , this command is killing child processes .which is not acceptable .
Thank
Vaibhav
Moderator's Comments:
Welcome, please use code tags next time for your code and data, thanks
Last edited by vbe; 01-26-2017 at 02:33 PM..
Reason: code tags
Hello all,
I have gone through the search and looked at posting about idle users and killing processes. Here is my question I would like to kill an idle user ( which I can do) but how can I asure that all of his process is also killed whit out tracing his inital start PID. I have tried this on a... (4 Replies)
Hi everybody,
I'm trying to understand how a parent and child processes interact.
This function( below) basically measures the fork time from the perspective of the parent only.
what i would like to know is how to measure the time from the perspective of parent and child (ie: inserting... (0 Replies)
Hi all,
I'm trying to write a program that has some data it wants to send through a filter program(in this case tr), and then recieve the output from that filter program. The way I'm trying to do it is by setting up two pipes between the programs and piping the data in through one pipe and back... (2 Replies)
Hi All,
I have two ksh script. 1st script calls the 2nd script and the second script calls an 'C' program.
I want 1st script to wait until the 'C' program completes.
I cant able to get the process id for the 'C' program (child process) to make the 1st script to wait for the second... (7 Replies)
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)
Hi,
I have a script that calls other scripts/commands which may or may not spawn other process.
From my understanding, when I do a ps -ef, the highest numbered process ID is supposed to be the parent ID of all the other related child processes, is this correct?
In most or all... (3 Replies)
Hi, i want that the parent process start before the child, this code doesn't work,
if the child start before the parent it wait for signal, then the father send the signal SIGALRM and the child catch it and call printf;
else the father call printf and send the signal to the child that call its... (1 Reply)
Hello, everyone.
Here's a program:
pid_t pid = fork();
if (0 == pid) // child process
{
execvp ...;
}
I send a signal (such as SIGINT) to the parent process, the child process receive the signal as well as the parent process.
However I don't want to child process to receive the... (7 Replies)
Hi everyone
i am very new to linux , working on bash shell.
I am trying to solve the given problem
1. Create a process and then create children using fork
2. Check the Status of the application for successful running.
3. Kill all the process(threads) except parent and first child... (2 Replies)
I am trying to kill PIDs that are tied to a KSH "load_sqlplus" and I am using the below code
LIST_PID=`ps -ef | grep -i "load_sqlplus" | grep -v grep | awk '{print $2}'`
if ; then
echo "Processes killed" "PID : " $LIST_PID
kill -9 $LIST_PID
else
echo "Nothing to Kill"
fi... (4 Replies)
Discussion started by: venky338
4 Replies
LEARN ABOUT HPUX
xtcreatepob
XtCreatePopupShell() XtCreatePopupShell()
Name
XtCreatePopupShell - create a popup shell widget.
Synopsis
Widget XtCreatePopupShell(name, widget_class, parent, args, num_args)
String name;
WidgetClass widget_class;
Widget parent;
ArgList args;
Cardinal num_args;
Inputs
name Specifies the resource name for the created shell widget.
widget_class
Specifies the widget class pointer for the created shell widget; must be shellClass or any subclass.
parent Specifies the parent widget; must be of class Core or any subclass thereof.
args Specifies the argument list to override the resource defaults.
num_args Specifies the number of arguments in the argument list.
Returns
A widget of class widget_class created as a popup child of parent.
Description
XtCreatePopupShell() checks that widget_class is a subclass of Shell, and, if it is, creates a widget of that class. The widget is not
stored in the children array (maintained by Composite widgets), but rather in the popup_list array (which all widgets have).
The screen resource for this widget is determined by first scanning args for the XtNscreen resource. If it is not found, the resource
database associated with the parent's screen is queried. If both queries fail, the parent's screen is used. Once the screen is deter-
mined, the resource database associated with that screen is used to retrieve all remaining resources for the widget not specified in args.
Usage
All shell widgets other than those created by XtAppInitialize() and XtAppCreateShell() must be created with XtCreatePopupShell(). Popup
shells can be a child of any widget, not just Composite widgets. Remember that shell widgets can only have a single child, which will gen-
erally be the layout widget that arranges whatever grandchildren widgets are to appear in the popup.
Creating and realizing a popup shell widget is not enough to make it visible. To make a shell pop up, use XtPopup() or one of the prede-
fined callback procedures or menu actions that call this function. To make it popdown, call XtPopdown().
Rather than initializing an ArgList to pass to XtCreatePopupShell(), you can call XtVaCreatePopupShell() which accepts a NULL-terminated
variable length argument list of resource names and resource values.
See AlsoXtCallbackExclusive(1), XtMenuPopup(1), XtPopdown(1), XtPopup(1), XtVaCreatePopupShell(1).
Xt - Pop Ups XtCreatePopupShell()