So, I have what seems to be a very strange problem. I work for a company with multiple offices, and the web servers are not at the one where I happen to sit. So, for releasing an application I wrote, I have a script that does packing into a .tar, uploading to the server, unpacking, etc. All of that works fine. However, at the very end of the script there I have a couple of lines to restart the server's Apache instance, as follows. (server.sh is a softlink to Apache's startstop.sh script) sudo -u [SUgroup] ssh [server] "/proj/webgroup/japancup-qa/apache/server.sh stop" sudo -u [SUgroup] ssh [server] "/proj/webgroup/japancup-qa/apache/server.sh start" Code (markup): If I run the script (or manually run the commands above from my local machine), then when I visit the address where the app should be, I get no response, and segmentation faults recorded in the log. In contrast, if I personally open a connection to [server] via PuTTY, and then manually run the commands: sudo -u [SUgroup] [appPath]/apache/server.sh stop sudo -u [SUgroup] [appPath]/apache/server.sh start Code (markup): Then I can visit the app's site and it works perfectly. Additional detail that might help: the site runs in mod_python, via Django. I know there are a lot more details here that are probably needed, but I'm completely new to Apache as well as Unix in general and honestly am not sure where to even start looking, so even "maybe you should take a look at X" is a helpful post for me. For a start, I've posted a sanitized version of my httpd.conf file. And yes, I know that my use of square brackets to denote redacted info makes syntax errors. It's not like that in the real thing. Mostly I'm posting it so you can see the list of active modules. Anyway, any help the forums can offer will be greatly appreciated. Thanks in advance! TL;DR Version: local sudo restart works fine, but if I do sudo ssh restart from a remote location, then instead of HTTP response I get segfaults.
I'm afraid there's not much to go on there. I did tail on the error_log file, and all that appears in there is the following: [Mon Apr 07 18:28:45 2008] [notice] mod_python: (Re)importing module 'django.core.handlers.modpython' [Mon Apr 07 18:28:46 2008] [notice] child pid 13122 exit signal Segmentation fault (11) Code (markup): If you'd like to see the contents of the module in question, you can check it out on the web: http://code.djangoproject.com/browser/django/trunk/django/core/handlers/modpython.py But the same thing works when I start/stop locally, so I'm not sure how the contents of the module could cause that.
By the way, thanks for taking a look; I know this is probably a pain to think about without access to the systems in question.
I have two thoughts: 1. Shouldn't the command be this ? ssh [server] "sudo -u [SUgroup] /proj/webgroup/japancup-qa/apache/server.sh stop" ssh [server] "sudo -u [SUgroup] /proj/webgroup/japancup-qa/apache/server.sh start" Code (markup): Running "sudo ssh" will ssh as root which will mean that you don't need to use sudo on the remote server (so the whole command will still work) but it will also change things such as your home directory and all of your environment variables. 2. From what little Python I have dealt with I remember that it uses your Unix environment variables and in the absence of specific environment variables, uses the defaults which puts stuff in your home directory. You may be getting different environment variables depending on whether you log in as root or as yourself and you will definitely be getting a different home directory. The main problem we ran into was the "python_eggs" directory which ended up in the home directory of whoever last restarted Apache.