473,769 Members | 8,134 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Can the subprocess kill its parent process?

Hello,
In the parent process(A), run update function, and start the update
process(B), in B process, kill A, then download and update files, then
restart A.
I want to know can the B process kill A process?
Thank you
Aug 1 '08 #1
2 2511
On Aug 1, 5:51 am, YXQ <Y...@discussio ns.microsoft.co mwrote:
Hello,
In the parent process(A), run update function, and start the update
process(B), in B process, kill A, then download and update files, then
restart A.
I want to know can the B process kill A process?
Thank you
As you stated like they're seperate processes, killing process A "may"
kill process B if process B(updater process?) has an explict
dependency with process A. You may have seen many applications like
Firefox is needed to close main application to perform update
operation and restart main application again. So, it depends on what
you're trying to do and how you update your application.

Thanks,

Onur
Aug 1 '08 #2
Sorry, please ignore this problem, the parent process can be killed normal
using the kill function in subprocess.

"kimiraikko nen" wrote:
On Aug 1, 5:51 am, YXQ <Y...@discussio ns.microsoft.co mwrote:
Hello,
In the parent process(A), run update function, and start the update
process(B), in B process, kill A, then download and update files, then
restart A.
I want to know can the B process kill A process?
Thank you

As you stated like they're seperate processes, killing process A "may"
kill process B if process B(updater process?) has an explict
dependency with process A. You may have seen many applications like
Firefox is needed to close main application to perform update
operation and restart main application again. So, it depends on what
you're trying to do and how you update your application.

Thanks,

Onur
Aug 1 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
3165
by: Greg Kuperberg | last post by:
I want to run subprocesses with limits on the execution time and the output size of the subprocess. If the subprocess exceeds limits, then the parent should kill it gracefully (SIGTERM rather than SIGKILL). This is a useful safety mechanism if you have a CGI interface that starts jobs per user request. As a result of this effort, I have a comment and a question: (1) I don't think that process control is thought through very well in...
0
2636
by: Corey Wallis | last post by:
Dear All, I'm currently working on a project that needs to collect the output of the JHOVE application. More information about the application is available at this website: http://hul.harvard.edu/jhove/ The application is written in Java and is executed by a shell script. There are occasions where this application may get stuck in an
15
17565
by: Thomas Dybdahl Ahle | last post by:
Hi, When I do a small program like from subprocess import Popen popen = Popen() from time import sleep sleep(100) start it and kill it, the ping process lives on. Is there a way to ensure that the ping process is always killed when the python process is?
9
6495
by: Phoe6 | last post by:
Hi all, Consider this scenario, where in I need to use subprocess to execute a command like 'ping 127.0.0.1' which will have a continuous non- terminating output in Linux. # code # This hangs at this point. How should I handle these kind of commands (ping 127.0.0.1) with
12
4533
by: bhunter | last post by:
Hi, I've used subprocess with 2.4 several times to execute a process, wait for it to finish, and then look at its output. Now I want to spawn the process separately, later check to see if it's finished, and if it is look at its output. I may want to send a signal at some point to kill the process. This seems straightforward, but it doesn't seem to be working. Here's my test case:
23
2066
by: Harishankar | last post by:
Hi, Sorry to start off on a negative note in the list, but I feel that the Python subprocess module is sorely deficient because it lacks a mechanism to: 1. Create non-blocking pipes which can be read in a separate thread (I am currently writing a mencoder GUI in Tkinter and need a full fledged process handler to control the command line and to display the progress in a text-box)
7
6237
by: Samuel A. Falvo II | last post by:
I have a shell script script.sh that launches a Java process in the background using the &-operator, like so: #!/bin/bash java ... arguments here ... & In my Python code, I want to invoke this shell script using the Subprocess module. Here is my code: def resultFromRunning_(command):
8
3942
by: Michele Petrazzo | last post by:
Hi all, I believe that this is a *nix question, but since I'm developing in python, I'm here. I have a code that execute into a "Popen" a command (ssh). I need that, if the python process die, the parent pid (PPID) of the child don't become 1 (like I can seen on /proc/$pid$/status ), but it has to die, following it's parent It's possible in linux and with subprocess?
6
16916
by: itsraghz | last post by:
Dear All, I have an issue with destroy() method of java.lang.Process class. All what I am trying to do is, controlling the execution of one program through another. Let's say, Program B has to be executed conditionally through Program A based on the commands it gets from the user. Let's say, we have two inputs, "start" and "stop" to drive the Program B. I have thought of various alternatives. (1) Using Thread to control the execution...
0
9423
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10219
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10049
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9998
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9865
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8876
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7413
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6675
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
2
3567
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.