Index: head/net/htpdate/Makefile =================================================================== --- head/net/htpdate/Makefile (revision 510075) +++ head/net/htpdate/Makefile (revision 510076) @@ -1,33 +1,34 @@ # Created by: Vsevolod Stakhov # $FreeBSD$ PORTNAME= htpdate PORTVERSION= 1.2.2 +PORTREVISION= 1 CATEGORIES= net ipv6 MASTER_SITES= http://www.vervest.org/htp/archive/c/ \ http://twekkel.home.xs4all.nl/htp/ MAINTAINER= jgh@FreeBSD.org COMMENT= Time synchronization over http utility LICENSE= GPLv2+ USES= tar:xz MAKE_ARGS= CC="${CC}" CFLAGS="${CFLAGS}" PLIST_FILES= bin/${PORTNAME} man/man8/${PORTNAME}.8.gz PORTDOCS= Changelog README USE_RC_SUBR= ${PORTNAME} OPTIONS_DEFINE= DOCS do-install: ${INSTALL_PROGRAM} ${WRKSRC}/${PORTNAME} ${STAGEDIR}${PREFIX}/bin ${INSTALL_MAN} ${WRKSRC}/${PORTNAME}.8 ${STAGEDIR}${MAN8PREFIX}/man/man8 @${MKDIR} ${STAGEDIR}${DOCSDIR} .for doc in ${PORTDOCS} ${INSTALL_DATA} ${WRKSRC}/${doc} ${STAGEDIR}${DOCSDIR} .endfor .include Index: head/net/htpdate/files/htpdate.in =================================================================== --- head/net/htpdate/files/htpdate.in (revision 510075) +++ head/net/htpdate/files/htpdate.in (revision 510076) @@ -1,44 +1,39 @@ #!/bin/sh # # $FreeBSD$ # PROVIDE: htpdate -# REQUIRE: NETWORKING SERVERS -# BEFORE: DAEMON +# REQUIRE: NETWORKING syslogd # KEYWORD: shutdown # Add the following line to /etc/rc.conf to enable htpdate: # # htpdate_enable="YES" . /etc/rc.subr -load_rc_config htpdate - -htpdate_enable="${htpdate_enable:-"NO"}" -htpdate_servers="${htpdate_servers:-"www.example.com"}" -htpdate_flags="${htpdate_flags:-"-l -s -D"}" - name=htpdate +desc="HTTP Time Protocol daemon" rcvar=htpdate_enable -servers=${htpdate_servers} -pidfile=/var/run/htpdate.pid -command="/usr/local/bin/htpdate" -command_args="${htpdate_flags} $servers" -stop_cmd=htpdate_stop +load_rc_config htpdate -htpdate_stop () +: ${htpdate_enable:="NO"} +: ${htpdate_servers:="www.example.com"} +: ${htpdate_flags:="-l -s -D"} + +start_precmd=htpdate_prestart +command="%%PREFIX%%/bin/htpdate" +command_args="${htpdate_servers}" + +htpdate_prestart() { - if [ -f ${pidfile} ]; then - echo "Stopping htpdate." - kill `cat ${pidfile}` - else - echo "htpdate is not running." - fi + local _pidfile="/var/run/htpdate.pid" - rm -f ${pidfile} + if [ -z "$(check_process "${command}")" ]; then + rm -f -- "${_pidfile}" + fi } run_rc_command "$1"