Show apache status and start/stop controls

Bug #241033 reported by Sense Egbert Hofstede
6
Affects Status Importance Assigned to Milestone
Remote Apache Management tool
Fix Released
Medium
KillerKiwi

Bug Description

It would be nice to be able to see if the apache server is (still) running and control that with rapache. At Windows you've got the Apache monitor. It would be great if similar functionality would also be implemented in Rapache. This would include these features:
-View of current server status
-Stop/start/reload control
-Be able to control more servers(this is probably something for stage 2/3)

Tags: need-help
TAC one (tacone)
Changed in rapache:
importance: Undecided → Medium
milestone: none → stage0
status: New → Confirmed
Revision history for this message
TAC one (tacone) wrote :

Further elaborating:
  - we need to understand WHICH is the right way to check for apache status.
  - apache status shuold be checked every X seconds. So:
    - we need a light way to do that.
    - we need to know how to properly use threads (and how to close them on main program quit)

Revision history for this message
KillerKiwi (killerkiwi2005) wrote :

I can help with threading

a couple of things,

you must init the threading modal
# Turn on threading
gtk.gdk.threads_init()

If you want to update the UI from a thread you must lock the gtk thread
gtk.gdk.threads_enter()
input_name.set_text("example")
gtk.gdk.threads_leave()

# Thread handler
def threaded(f):
 def wrapper(*args):
  t = threading.Thread(target=f, args=args)
  t.setDaemon(True) # wont keep app alive
  t.start()
 return wrapper

@threaded
def test_thread():
        while True:
               print "threaded"
               time.sleep(1)

Revision history for this message
Craig Roberts (craig1709) wrote :

A couple of thoughts:

You could always check the output of
$ ps -e |grep apache
which would return a blank string if the server is stopped, and a formatted list of process IDs if it's running.

Or you could check for the existence of /var/run/apache2.pid which I *assume* is created when the process is running, and deleted when stopped (which seems to be the case on my machine).

Fantastic software by the way.

Revision history for this message
KillerKiwi (killerkiwi2005) wrote :

Status is shown in the main window status bar in the plugins branch

Changed in rapache:
status: Confirmed → In Progress
TAC one (tacone)
Changed in rapache:
assignee: nobody → killerkiwi2005
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.