You are not logged in.
Hi, I'm experiencing some strange behaviour that I seem unable to find the cause for.
For testing purposes I installed the Apache 2 webserver on my desktop machine, not running it as a systemd service but under my default user account instead, whenever I need it.
To start the server I call this command:
/usr/bin/httpd -d "$HOME/Webserver" -f "$HOME/Webserver/httpd.conf" -DFOREGROUND
To stop the server I append "-k stop" to it:
/usr/bin/httpd -d "$HOME/Webserver" -f "$HOME/Webserver/httpd.conf" -DFOREGROUND -k stop
Of course I created the corresponding configuration environment in mentioned directory. This used to work fine as long as I was using the event mpm. Now I enabled the prefork mpm instead and it started to behave strangely when calling the stop command: Instead of just stoping the webserver, it kicks me out of the whole desktop session. The logs show nothing but the default startup / shutdown messages.
Do you have any idea what's going on?
Offline
Are you using port 80? If so, are you running httpd as root?
Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way
Offline
As I already wrote in my first posting, I'm running it as my desktop user, as this is more convenient for testing, which in turn means I can't use port 80. It is configured to listen on 127.0.0.1:8080 and [::1]:8080 instead.
Offline
No problem. My question was to establish whether you had run it is root. Sometimes that has unexpected side effects.
I don't have httpd installed on my systems (I changed over to nginx). Does it have a verbose option you can try?
Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way
Offline
Unfortunately it does not log anything unusual, even when LogLevel is set to debug. I just tracked it down to using the -DFOREGROUND in combination with a .desktop starter. Really strange. Without -DFOREGROUND everything works fine, also when running with -DFOREGROUND and from a terminal window. Very strange...
Last edited by Bachsau (2018-07-10 01:45:37)
Offline
Look at the process tree, the apache processes will likely be children of the session.
Question is whether they raise a SIGCHLD or your stopping routine is the problem, what happens for "apachectl -k stop"?
Offline
They are children of whatever I used to start them, or at least, the master process is and it's spawn are children of it, just as it should be. apachectl does exactly the same thing, as it does nothing else but wrapping httpd, which in turn, is a compiled ELF binary as distributed by the package.
Offline
What if you just kill the master process?
What if you disown the master process?
What happens to processes owned by your user running directly under PID 1?
What if you trap (and log) various signals in the parenting shell?
The principal question here would be whether the daemon fires up the termination or simply kills all PIDs of your user.
Offline