I have a script which will do a lot of prep work (generate config files, minimize and gzip Javascript and CSS files, etc) and then restart apache which is installed in a non-standard location). But after the script is run, when I try to exit out of my ssh session it just hangs indefinitely.
I've read the recommendation that I should redirect the IO for the actual call to the httpd binary with something like this:
sudo /path/to/httpd -f /path/to/config < /dev/null >& /dev/null
And this works and my ssh session no longer hangs after the script is done. But the problem is that now I've lost any errors that are spit out to STDERR if something goes wrong when it's started. This just seems really odd to me because I have another system with a similar (but not exact) setup that doesn't hang. And from reading the recommendation that suggests this workaround it says that daemons (like apache) should already be taking care of this. So what am I missing? Any pointers on how I can track this down or how I can fix it?