Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 28 Mar 2010 12:56:31 GMT
From:      Ari Maniatis <ari@ish.com.au>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   ports/145107: [patch] net/csync2 improvements
Message-ID:  <201003281256.o2SCuV2D079333@www.freebsd.org>
Resent-Message-ID: <201003281300.o2SD0GUZ072474@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         145107
>Category:       ports
>Synopsis:       [patch] net/csync2 improvements
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sun Mar 28 13:00:15 UTC 2010
>Closed-Date:
>Last-Modified:
>Originator:     Ari Maniatis
>Release:        
>Organization:
>Environment:
>Description:
net/csync2 port could do with a startup script
>How-To-Repeat:

>Fix:
diff -ruN csync2.bak/Makefile csync2/Makefile
--- csync2.bak/Makefile	2009-09-17 00:26:58.000000000 +1000
+++ csync2/Makefile	2010-03-28 23:34:08.908464331 +1100
@@ -7,7 +7,7 @@
 
 PORTNAME=	csync2
 PORTVERSION=	1.34
-PORTREVISION=	6
+PORTREVISION=	7
 CATEGORIES=	net
 MASTER_SITES=	http://oss.linbit.com/csync2/ \
 		http://people.freebsd.org/~aaron/distfiles/
@@ -30,6 +30,8 @@
 CONFIGURE_ENV+=	LDFLAGS="-L${LOCALBASE}/lib"
 CONFIGURE_ENV+=	LIBGNUTLS_CONFIG="${LOCALBASE}/bin/pkg-config gnutls"
 
+USE_RC_SUBR=    csync2.sh
+
 PLIST_FILES=	etc/csync2.cfg-dist \
 		sbin/csync2 \
 		sbin/csync2-compare
diff -ruN csync2.bak/files/csync2.sh.in csync2/files/csync2.sh.in
--- csync2.bak/files/csync2.sh.in	1970-01-01 10:00:00.000000000 +1000
+++ csync2/files/csync2.sh.in	2010-03-28 23:30:20.458500416 +1100
@@ -0,0 +1,38 @@
+#!/bin/sh
+#
+# PROVIDE: csync2
+# REQUIRE: LOGIN
+# KEYWORD: shutdown
+
+# Add the following line to /etc/rc.conf to enable csync2:
+# csync2_enable="YES"
+
+. %%RC_SUBR%%
+
+name="csync2"
+rcvar=${name}_enable
+
+pidfile=/var/run/${name}.pid
+start_cmd="${name}_start"
+stop_cmd="${name}_stop"
+
+load_rc_config $name
+: ${csync2_enable="NO"}
+
+csync2_start()
+{
+  %%PREFIX%%/sbin/csync2 -ii & echo $! > ${pidfile}
+}
+csync2_stop()
+{   
+  if [ -f "${pidfile}" ]; then
+        kill `cat ${pidfile}`
+        wait_for_pid `cat ${pidfile}`
+        rm -f ${pidfile}
+  else 
+        echo "PIDFILE not found: ${pidfile}, ${name} may already be stopped"
+  fi
+}
+
+run_rc_command "$1"
+


>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201003281256.o2SCuV2D079333>