diff options
author | Pav Lucistnik <pav@FreeBSD.org> | 2010-05-14 13:29:55 +0000 |
---|---|---|
committer | Pav Lucistnik <pav@FreeBSD.org> | 2010-05-14 13:29:55 +0000 |
commit | 856e18c1d030d4efba3819b14d14e399290b184f (patch) | |
tree | f4addcc5e6caf365329212c0883c41286d0b4ab3 /net/csync2 | |
parent | 13ca02695ec42e32e8b9ac3b978e677e2973c5d5 (diff) | |
download | ports-856e18c1d030d4efba3819b14d14e399290b184f.tar.gz ports-856e18c1d030d4efba3819b14d14e399290b184f.zip |
- Provide rc script
PR: ports/145107
Submitted by: Ari Maniatis <ari@ish.com.au>
Notes
Notes:
svn path=/head/; revision=254313
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" + |