diff options
Diffstat (limited to 'net/csync2')
-rw-r--r-- | net/csync2/Makefile | 4 | ||||
-rw-r--r-- | net/csync2/files/csync2.in | 38 |
2 files changed, 41 insertions, 1 deletions
diff --git a/net/csync2/Makefile b/net/csync2/Makefile index cc9cb520c1e8..02c8abde9456 100644 --- a/net/csync2/Makefile +++ b/net/csync2/Makefile @@ -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= CPPFLAGS="-I${LOCALBASE}/include" CONFIGURE_ENV+= LDFLAGS="-L${LOCALBASE}/lib" CONFIGURE_ENV+= LIBGNUTLS_CONFIG="${LOCALBASE}/bin/pkg-config gnutls" +USE_RC_SUBR= csync2 + PLIST_FILES= etc/csync2.cfg-dist \ sbin/csync2 \ sbin/csync2-compare diff --git a/net/csync2/files/csync2.in b/net/csync2/files/csync2.in new file mode 100644 index 000000000000..cd1e95639817 --- /dev/null +++ b/net/csync2/files/csync2.in @@ -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" + +. /etc/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" + |