WebFaction
Community site: login faq

When I attempt to run ~/webapps/python_app/apache2/bin/restart most times it errors out with the message:

sh: line 0: kill: (912065) - No such process

Im pretty sure I can just kill the process manually but im not sure how to get the process ID properly. When I do a

es -ef | grep username

I get a number of processes but I am not sure which is correct one to kill. Any advice?

asked 24 Sep '14, 18:55

leotemp
1116
accept rate: 100%

edited 24 Sep '14, 19:10


This is just a side effect of the way our apache app "stop" script works.

The script looks like this:

#!/bin/env python

import os

stopped = False

# Stop Apache if it is running.
for line in os.popen('ps -o pid,command -u testweb343'):
    if '/home/username/webapps/appname/apache2/conf/httpd.conf' in line:
        stopped = True
        os.system('kill %s' % line.split()[0])

if not stopped:
    print "Apache is not running."

It basically looks for processes that contain "/home/username/webapps/app/apache2/conf/httpd.conf" and kills them as it finds them. If it kills your WSGI parent process first, then the children will sometimes die before the script kills them, which results in the "No such process" error message.

This is, admittedly, not a great technique, but the error message is harmless. If it's causing problems for you, then you could replace your ~/webapps/app/apache2/bin/stop script with something like this:

#!/bin/bash

APP_PATH=/home/username/webapps/app

$APP_PATH/apache2/bin/httpd.worker -f $APP_PATH/apache2/conf/httpd.conf -k stop

Hope that helps!

permanent link

answered 24 Sep '14, 19:32

seanf
12.2k41836
accept rate: 37%

Okay thanks Seanf. I'm attempting to get a static application to work correctly and I was sure i just needed to restart the app. So if I understand you correctly the app is being restarted the msg isn't something to worry about?

(24 Sep '14, 19:39) leotemp

That's correct.

(24 Sep '14, 20:35) seanf
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×909
×225
×62
×23

question asked: 24 Sep '14, 18:55

question was seen: 2,075 times

last updated: 24 Sep '14, 20:35

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2019 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM