Permalink
Browse files

git-svn-id: svn://cherokee-project.com/cherokee/trunk@1918 5dc97367-9…

…7f1-0310-9951-d761b3857238
  • Loading branch information...
1 parent 5333765 commit 4ab56c633271eada37ed78f03b1a6256ca8bd567 @alobbs alobbs committed Aug 31, 2008
Showing with 589 additions and 523 deletions.
  1. +9 −0 ChangeLog
  2. +11 −10 admin/CherokeeManagement.py
  3. +1 −1 admin/PageMain.py
  4. +2 −2 admin/configured.py.pre
  5. +9 −9 cherokee/Makefile.am
  6. +233 −221 cherokee/main.c
  7. +0 −277 cherokee/main_guardian.c
  8. +313 −0 cherokee/main_worker.c
  9. +9 −2 cherokee/server.c
  10. +2 −1 constants.h.pre
View
@@ -1,3 +1,12 @@
+2008-08-31 Alvaro Lopez Ortega <alvaro@alobbs.com>
+
+ * cherokee/Makefile.am, cherokee/main.c, cherokee/main_guardian.c,
+ cherokee/server.c, constants.h.pre, admin/configured.py.pre,
+ admin/PageMain.py, admin/CherokeeManagement.py: Cherokee-guardian
+ becomes Cherokee, and Cherokee is renamed to Cherokee-worker. The
+ idea behind this change is to use the "guardian" feature by
+ default.
+
2008-08-30 Alvaro Lopez Ortega <alvaro@alobbs.com>
* admin/ModuleAdmin.py, admin/PageEntry.py, admin/server.py,
@@ -49,7 +49,7 @@ def cherokee_management_reset ():
class CherokeeManagement:
def __init__ (self, cfg):
self._cfg = cfg
- self._pid = self._get_guardian_pid()
+ self._pid = self._get_pid (worker=False)
# Public
#
@@ -73,7 +73,7 @@ def launch (self):
def daemonize():
os.setsid()
- p = Popen ([CHEROKEE_GUARDIAN, '-C', self._cfg.file],
+ p = Popen ([CHEROKEE_SERVER, '-C', self._cfg.file],
stdout=PIPE, stderr=PIPE,
preexec_fn=daemonize, close_fds=True)
@@ -111,7 +111,7 @@ def stop (self):
self._pid = None
# Get the PID
- pid = self._get_cherokee_pid()
+ pid = self._get_pid (worker=True)
if not pid: return
# Stop Cherokee
@@ -138,15 +138,16 @@ def create_config (self, file):
# Protected
#
-
- def _get_guardian_pid (self):
- pid_file = os.path.join (CHEROKEE_VAR_RUN, "cherokee-guardian.pid")
- return self.__read_pid_file (pid_file)
-
- def _get_cherokee_pid (self):
+ def _get_pid_path (self, worker):
pid_file = self._cfg.get_val("server!pid_file")
if not pid_file:
- pid_file = os.path.join (CHEROKEE_VAR_RUN, "cherokee-guardian.pid")
+ pid_file = os.path.join (CHEROKEE_VAR_RUN, "cherokee.pid")
+ if worker:
+ pid_file += ".worker"
+ return pid_file
+
+ def _get_pid (self, worker=False):
+ pid_file = self._get_pid_path(worker)
return self.__read_pid_file (pid_file)
def _restart (self, graceful=False):
View
@@ -68,7 +68,7 @@ def _render_extra_info (self):
table += ("Server default path", WWWROOT)
manager = cherokee_management_get (self._cfg)
- if manager._pid:
+ if manager.is_alive():
current_pid = str(manager._pid)
else:
current_pid = "Not running"
@@ -8,8 +8,8 @@ SYSCONFDIR = "%sysconfdir%"
LOCALSTATE = "%localstatedir%"
VERSION = "%version%"
-CHEROKEE_SRV_PATH = join (PREFIX, "sbin/cherokee")
-CHEROKEE_GUARDIAN = join (PREFIX, "sbin/cherokee-guardian")
+CHEROKEE_SERVER = join (PREFIX, "sbin/cherokee")
+CHEROKEE_WORKER = join (PREFIX, "sbin/cherokee-worker")
CHEROKEE_ADMINDIR = join (PREFIX, "share/cherokee/admin")
CHEROKEE_ICONSDIR = join (PREFIX, "share/cherokee/icons")
CHEROKEE_THEMEDIR = join (PREFIX, "share/cherokee/themes")
View
@@ -1189,33 +1189,33 @@ $(dynamic_balancer_round_robin_lib)
#
-# Main binary: Cherokee server
+# Cherokee server worker
#
-sbin_PROGRAMS = cherokee cherokee-admin
+sbin_PROGRAMS = cherokee-worker cherokee-admin
if !PLATFORM_WIN32
-sbin_PROGRAMS += cherokee-guardian
+sbin_PROGRAMS += cherokee
endif
-cherokee_SOURCES = main.c
-cherokee_LDADD = \
+cherokee_worker_SOURCES = main_worker.c
+cherokee_worker_LDADD = \
$(PTHREAD_LIBS) \
$(PTHREAD_CFLAGS) \
libcherokee-base.la \
libcherokee-server.la
cherokee_LDFLAGS = -export-dynamic
#
-# Cherokee guardians
+# Cherokee
#
-cherokee_guardian_SOURCES = main_guardian.c
+cherokee_SOURCES = main.c
#
# Cherokee admin
#
cherokee_admin_SOURCES = main_admin.c
-cherokee_admin_LDADD = $(cherokee_LDADD)
-cherokee_admin_LDFLAGS = $(cherokee_LDFLAGS)
+cherokee_admin_LDADD = $(cherokee_worker_LDADD)
+cherokee_admin_LDFLAGS = $(cherokee_worker_LDFLAGS)
#
Oops, something went wrong. Retry.

0 comments on commit 4ab56c6

Please sign in to comment.