logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Building & Member Downloads View previous topic :: View next topic
Reply to topic   Topic: Is there any way to make the two httpd.exe dependable.
Author
ashwani_ap



Joined: 29 Aug 2007
Posts: 47
Location: Bangalore

PostPosted: Thu 30 Aug '07 12:09    Post subject: Is there any way to make the two httpd.exe dependable. Reply with quote

Hi,
Is there any way to make the two httpd.exe dependable on each other. So that when I kill one main PID oh httpd.exe, other should get killed.

-Ashwani-
Back to top
poetics5



Joined: 31 Aug 2007
Posts: 6
Location: all over

PostPosted: Fri 31 Aug '07 4:34    Post subject: Reply with quote

just wondering how are you running both at the same time?

also you could make a .bat file to call a stop on both files, my $.02
Back to top
ashwani_ap



Joined: 29 Aug 2007
Posts: 47
Location: Bangalore

PostPosted: Fri 31 Aug '07 12:12    Post subject: writing .bat file for killing the two httpd.exe Reply with quote

Hi,
Please guide how to write the .bat file for killing both the .exe of apache. I am not able to kill only the parent process, because I know only the PID of that. Urgent please
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7294
Location: Germany, Next to Hamburg

PostPosted: Fri 31 Aug '07 12:29    Post subject: Reply with quote

Code:

@echo off
TASKKILL /F /IM httpd.exe


Tested under XP and 2003.

When you run it as a service

httpd -k stop
Back to top
ashwani_ap



Joined: 29 Aug 2007
Posts: 47
Location: Bangalore

PostPosted: Fri 31 Aug '07 13:06    Post subject: Generic kill method for all the windows platform Reply with quote

Actually, I tried this command but it works only for few win platforms.
I want to use some generic comand for all the win platform. Or please tell me some C Windows code to do so.

Actually in my C code I am able to start the Apache web server by calling spawn(). This returns the PID for the parent process httpd.exe. Using this PID I am able to kill that I am not able to kill both the httpd.exe because I am not able to find the PID for both. I did this. Sad

hProcess1 = OpenProcess(PROCESS_TERMINATE, FALSE, pi.dwProcessId);
if (hProcess1 == NULL) return FALSE;
dwError = ERROR_SUCCESS;
if (!TerminateProcess(hProcess1, (DWORD)-1))
dwError = GetLastError();


But in vain. Please guide me. this also kills the parent process and lives the child httpd.exe running which in turn relies to all the web request. Sad
Back to top
poetics5



Joined: 31 Aug 2007
Posts: 6
Location: all over

PostPosted: Fri 31 Aug '07 20:26    Post subject: Reply with quote

actually i was thinking you could just do something like

path to http1 httpd -k stop
path to http2 httpd -k stop
Back to top


Reply to topic   Topic: Is there any way to make the two httpd.exe dependable. View previous topic :: View next topic
Post new topic   Forum Index -> Building & Member Downloads