[Dev OpenGP] [111] Daemon

[ Thread Index | Date Index | More opengp.tuxfamily.org/development Archives ]


Revision: 111
Author:   alband85
Date:     2009-03-26 17:32:44 +0100 (Thu, 26 Mar 2009)

Log Message:
-----------
Daemon

Modified Paths:
--------------
    trunk/Makefile
    trunk/src/bin/init.d_daemon


Modified: trunk/Makefile
===================================================================
--- trunk/Makefile	2009-03-26 16:17:12 UTC (rev 110)
+++ trunk/Makefile	2009-03-26 16:32:44 UTC (rev 111)
@@ -2,12 +2,18 @@
 exec_prefix=$(prefix)
 
 PYTHON_LIB=$(prefix)/lib/python2.5
-
+INITD=/etc/init.d
+SBIN=/usr/sbin
 PYTHON=`which python`
 PYTHON_FLAGS=-mcompileall
+
 OGPLIB=src/lib/ogp
+OGPBIN=src/bin
+DAEMON_NAME=ogpdaemon
+INIT_SCRIPT_NAME=$(DAEMON_NAME)
+script_path=$(INITD)/$(INIT_SCRIPT_NAME)
+bin_path=$(SBIN)/$(DAEMON_NAME)
 
-
 all: binaries
 
 binaries:
@@ -22,9 +28,20 @@
 	@cd $(OGPLIB);\
 	tar -cf - --exclude='.svn' * |  tar --no-same-owner -xf - -C $(PYTHON_LIB)/ogp
 
-install-daemon:
+install-daemon: install-daemon-bin install-daemon-initd
 
+install-daemon-initd:
+	@echo "Installing init.d script ($(script_path))..."
+	@cp -f $(OGPBIN)/init.d_daemon $(script_path)
+	@chmod 755 $(script_path)
+	@chown 0:0 $(script_path)
 
+install-daemon-bin:
+	@echo "Installing daemon ($(bin_path))..."
+	@cp -f $(OGPBIN)/$(DAEMON_NAME) $(bin_path)
+	@chmod 755 $(bin_path)
+	@chown 0:0 $(bin_path)
+
 .PHONY: config clean mrproper
 
 config:

Modified: trunk/src/bin/init.d_daemon
===================================================================
--- trunk/src/bin/init.d_daemon	2009-03-26 16:17:12 UTC (rev 110)
+++ trunk/src/bin/init.d_daemon	2009-03-26 16:32:44 UTC (rev 111)
@@ -12,9 +12,9 @@
 #	
 
 PATH="/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin"
-PIDFILE="/home/nico/ogpdaemon.pid"
-DAEMON="./ogpdaemon"
-NAME="OGP daemon"
+PIDFILE="/var/run/ogpdaemon.pid"
+DAEMON="/usr/sbin/ogpdaemon"
+NAME="ogpdaemon"
 
 set -e
 


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/