diff options
author | pav <pav@FreeBSD.org> | 2010-05-14 21:29:55 +0800 |
---|---|---|
committer | pav <pav@FreeBSD.org> | 2010-05-14 21:29:55 +0800 |
commit | 3863ac1b0588be5c924780fe0cd8c7a8b10e66b0 (patch) | |
tree | 7291a6be02b310f43958d954306ab7e0192fcf82 /net/csync2 | |
parent | 0070528f378e2b7a6069e9f879a3b9e96662c89f (diff) | |
download | freebsd-ports-gnome-3863ac1b0588be5c924780fe0cd8c7a8b10e66b0.tar.gz freebsd-ports-gnome-3863ac1b0588be5c924780fe0cd8c7a8b10e66b0.tar.zst freebsd-ports-gnome-3863ac1b0588be5c924780fe0cd8c7a8b10e66b0.zip |
- Provide rc script
PR: ports/145107
Submitted by: Ari Maniatis <ari@ish.com.au>
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" + |