public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] gentoo-x86 commit in mail-filter/dcc/files: dcc.initd-1.3.140
@ 2011-10-22 22:57 Robin H. Johnson (robbat2)
  0 siblings, 0 replies; 2+ messages in thread
From: Robin H. Johnson (robbat2) @ 2011-10-22 22:57 UTC (permalink / raw
  To: gentoo-commits

robbat2     11/10/22 22:57:48

  Added:                dcc.initd-1.3.140
  Log:
  Version bump with patch from bug #334245. EAPI2, cgi, milter, docs, /var/run tmpfs support, POSIX init compliance. Thanks to Eray Aslan <eras@gentoo.org>.
  
  (Portage version: 2.2.0_alpha60/cvs/Linux x86_64)

Revision  Changes    Path
1.1                  mail-filter/dcc/files/dcc.initd-1.3.140

file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/mail-filter/dcc/files/dcc.initd-1.3.140?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/mail-filter/dcc/files/dcc.initd-1.3.140?rev=1.1&content-type=text/plain

Index: dcc.initd-1.3.140
===================================================================
#!/sbin/runscript
# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/mail-filter/dcc/files/dcc.initd-1.3.140,v 1.1 2011/10/22 22:57:48 robbat2 Exp $

depend() {
	use logger
	need net
	before mta
}

checkconfig() {
	if [ ! -f "/etc/dcc/dcc_conf" ]; then
		eerror "You need a DCC configuration in /etc/dcc/dcc_conf"
		return 1
	fi
	for i in DCCD_ENABLE GREY_ENABLE DCCM_ENABLE DCCIFD_ENABLE DCC_LIBEXEC DCC_RUNDIR \
		SOCKET_USER SOCKET_GROUP SOCKET_MODE; do
		read -r ${i} <<-EOF
		$( grep ^[[:space:]]*${i} /etc/dcc/dcc_conf | sed s/.*=// )
	EOF
	done
	DCC_RUNDIR="${DCC_RUNDIR:-/var/run/dcc}"
	if [ ! -d "${DCC_RUNDIR}" ]; then
		checkpath -q -d -o root:root -m 0755 "${DCC_RUNDIR}" || return 1
	fi
}

start() {
	checkconfig || return 1
	local atleastone="${DCCD_ENABLE}${GREY_ENABLE}${DCCM_ENABLE}${DCCIFD_ENABLE}"
	atleastone=$( echo ${atleastone} | tr -d 'off' )
	if [ -z "${atleastone}" ]; then
		eend 1 "At least one service should be 'on' in /etc/dcc/dcc_conf"
		return 1
	fi

	if [ "${DCCD_ENABLE}" = "on" ] && [ -x "${DCC_LIBEXEC}/start-dccd" ]; then
		ebegin "Starting dccd"
		${DCC_LIBEXEC}/start-dccd >/dev/null 2>&1
		eend ${?}
	fi

	if [ "${GREY_ENABLE}" = "on" ] && [ -x "${DCC_LIBEXEC}/start-grey" ]; then
		ebegin "Starting grey"
		${DCC_LIBEXEC}/start-grey >/dev/null 2>&1
		eend ${?}
	fi

	if [ "${DCCM_ENABLE}" = "on" ] && [ -x "${DCC_LIBEXEC}/start-dccm" ]; then
		ebegin "Starting dccm"
		${DCC_LIBEXEC}/start-dccm >/dev/null 2>&1
		eend ${?}
		for ((dccmtimeout=0 ; dccmtimeout <= 20 ; dccmtimeout++)); do
			if [ -S "${DCC_RUNDIR}/dccm" ] || [ -r "${DCC_RUNDIR}/dccm" ]; then
				break
			else
				sleep 1
			fi
		done
		chown ${SOCKET_USER:-milter}:${SOCKET_GROUP:-milter} ${DCC_RUNDIR}/dccm 1>/dev/null 2>&1
		chmod ${SOCKET_MODE:-664} ${DCC_RUNDIR}/dccm 1>/dev/null 2>&1
		sed -i -e "s:^\-::" ${DCC_RUNDIR}/dccm.pid 1>/dev/null 2>&1 || return 1
	fi

	if [ "${DCCIFD_ENABLE}" = "on" ] && [ -x "${DCC_LIBEXEC}/start-dccifd" ]; then
		ebegin "Starting dccif"
		${DCC_LIBEXEC}/start-dccifd >/dev/null 2>&1
		eend ${?}
	fi
}

stop() {
	checkconfig || return 1

	if [ -r "${DCC_RUNDIR}/dccifd.pid" ]; then
		ebegin "Stopping dccif"
		kill -15 $(< ${DCC_RUNDIR}/dccifd.pid) 2>/dev/null
		eend ${?}
	fi

	if [ -r "${DCC_RUNDIR}/dccm.pid" ]; then
		ebegin "Stopping dccm"
		kill -15 $(< ${DCC_RUNDIR}/dccm.pid) 2>/dev/null
		eend ${?}
	fi

	if (pidof dccd >/dev/null 2>&1) && [ -x "${DCC_LIBEXEC}/stop-dccd" ]; then
		ebegin "Stopping dccd"
		${DCC_LIBEXEC}/stop-dccd >/dev/null 2>&1
		eend ${?}
	fi

	if (pidof dccd >/dev/null 2>&1) && [ -x "${DCC_LIBEXEC}/stop-dccd" ]; then
		ebegin "Stopping grey"
		${DCC_LIBEXEC}/stop-dccd -G >/dev/null 2>&1
		eend ${?}
	fi
}






^ permalink raw reply	[flat|nested] 2+ messages in thread

* [gentoo-commits] gentoo-x86 commit in mail-filter/dcc/files: dcc.initd-1.3.140
@ 2013-01-01 18:03 Lars Wendler (polynomial-c)
  0 siblings, 0 replies; 2+ messages in thread
From: Lars Wendler (polynomial-c) @ 2013-01-01 18:03 UTC (permalink / raw
  To: gentoo-commits

polynomial-c    13/01/01 18:03:36

  Modified:             dcc.initd-1.3.140
  Log:
  Removed bashism in init script (bug #388723)
  
  (Portage version: 2.2.0_alpha149/cvs/Linux x86_64, signed Manifest commit with key 0x981CA6FC)

Revision  Changes    Path
1.2                  mail-filter/dcc/files/dcc.initd-1.3.140

file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/mail-filter/dcc/files/dcc.initd-1.3.140?rev=1.2&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/mail-filter/dcc/files/dcc.initd-1.3.140?rev=1.2&content-type=text/plain
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/mail-filter/dcc/files/dcc.initd-1.3.140?r1=1.1&r2=1.2

Index: dcc.initd-1.3.140
===================================================================
RCS file: /var/cvsroot/gentoo-x86/mail-filter/dcc/files/dcc.initd-1.3.140,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- dcc.initd-1.3.140	22 Oct 2011 22:57:48 -0000	1.1
+++ dcc.initd-1.3.140	1 Jan 2013 18:03:36 -0000	1.2
@@ -1,7 +1,7 @@
 #!/sbin/runscript
-# Copyright 1999-2011 Gentoo Foundation
+# Copyright 1999-2013 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/mail-filter/dcc/files/dcc.initd-1.3.140,v 1.1 2011/10/22 22:57:48 robbat2 Exp $
+# $Header: /var/cvsroot/gentoo-x86/mail-filter/dcc/files/dcc.initd-1.3.140,v 1.2 2013/01/01 18:03:36 polynomial-c Exp $
 
 depend() {
 	use logger
@@ -51,11 +51,13 @@
 		ebegin "Starting dccm"
 		${DCC_LIBEXEC}/start-dccm >/dev/null 2>&1
 		eend ${?}
-		for ((dccmtimeout=0 ; dccmtimeout <= 20 ; dccmtimeout++)); do
+		local dccmtimeout=0
+		while [ ${dcctimeout} -le 20 ] ; do
 			if [ -S "${DCC_RUNDIR}/dccm" ] || [ -r "${DCC_RUNDIR}/dccm" ]; then
 				break
 			else
 				sleep 1
+				dcctimeout=$(($dcctimeout + 1))
 			fi
 		done
 		chown ${SOCKET_USER:-milter}:${SOCKET_GROUP:-milter} ${DCC_RUNDIR}/dccm 1>/dev/null 2>&1





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-01-01 18:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-22 22:57 [gentoo-commits] gentoo-x86 commit in mail-filter/dcc/files: dcc.initd-1.3.140 Robin H. Johnson (robbat2)
  -- strict thread matches above, loose matches on Subject: below --
2013-01-01 18:03 Lars Wendler (polynomial-c)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox