public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] gentoo-x86 commit in app-antivirus/clamav/files: clamd.initd-r5
@ 2013-04-01 12:51 Eray Aslan (eras)
  0 siblings, 0 replies; 2+ messages in thread
From: Eray Aslan (eras) @ 2013-04-01 12:51 UTC (permalink / raw
  To: gentoo-commits

eras        13/04/01 12:51:54

  Added:                clamd.initd-r5
  Log:
  Hopefully fix log file permission - bug #463208
  
  (Portage version: 2.2.0_alpha170/cvs/Linux x86_64, signed Manifest commit with key 0x77F1F175586A3B1F)

Revision  Changes    Path
1.1                  app-antivirus/clamav/files/clamd.initd-r5

file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-antivirus/clamav/files/clamd.initd-r5?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-antivirus/clamav/files/clamd.initd-r5?rev=1.1&content-type=text/plain

Index: clamd.initd-r5
===================================================================
#!/sbin/runscript
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/app-antivirus/clamav/files/clamd.initd-r5,v 1.1 2013/04/01 12:51:53 eras Exp $

daemon_clamd="/usr/sbin/clamd"
daemon_freshclam="/usr/bin/freshclam"
daemon_milter="/usr/sbin/clamav-milter"

extra_commands="logfix"

depend() {
	use net
	provide antivirus
}

get_config() {
	clamconf | sed 's/["=]//g' | \
	awk "{
	if(\$0==\"Config file: $1.conf\") S=1
	if(S==1&&\$0==\"\") {
		print \"$3\"
		exit
	}
	if(S==1&&\$1~\"^$2\$\") {
		print \$2!=\"disabled\"?\$2:\"$3\"
		exit
	}
	}"
}

start() {
	# populate variables and fix log file permissions
	logfix

	if [ "${START_CLAMD}" = "yes" ]; then
		checkpath --quiet --mode 755 \
			--owner "${clamd_user}":"${clamd_user}" \
			--directory `dirname ${clamd_socket}`
		if [ -S "${clamd_socket}" ]; then
			rm -f ${clamd_socket}
		fi
		ebegin "Starting clamd"
		start-stop-daemon --start --quiet \
			--nicelevel ${CLAMD_NICELEVEL:-0} \
			--exec ${daemon_clamd}
		eend $? "Failed to start clamd"
	fi

	if [ "${START_FRESHCLAM}" = "yes" ]; then
		ebegin "Starting freshclam"
		start-stop-daemon --start --quiet \
			--nicelevel ${FRESHCLAM_NICELEVEL:-0} \
			--exec ${daemon_freshclam} -- -d
		retcode=$?
		if [ ${retcode} = 1 ]; then
			eend 0
			einfo "Virus databases are already up to date."
		else
			eend ${retcode} "Failed to start freshclam"
		fi
	fi

	if [ "${START_MILTER}" = "yes" ]; then
		if [ -z "${MILTER_CONF_FILE}" ]; then
			MILTER_CONF_FILE="/etc/clamav-milter.conf"
		fi

		ebegin "Starting clamav-milter"
		start-stop-daemon --start --quiet \
			--nicelevel ${MILTER_NICELEVEL:-0} \
			--exec ${daemon_milter} -- -c ${MILTER_CONF_FILE}
		eend $? "Failed to start clamav-milter"
	fi
}

stop() {
	if [ "${START_CLAMD}" = "yes" ]; then
		ebegin "Stopping clamd"
		start-stop-daemon --stop --quiet --name clamd
		eend $? "Failed to stop clamd"
	fi
	if [ "${START_FRESHCLAM}" = "yes" ]; then
		ebegin "Stopping freshclam"
		start-stop-daemon --stop --quiet --name freshclam
		eend $? "Failed to stop freshclam"
	fi
	if [ "${START_MILTER}" = "yes" ]; then
		ebegin "Stopping clamav-milter"
		start-stop-daemon --stop --quiet --name clamav-milter
		eend $? "Failed to stop clamav-milter"
	fi
}

logfix() {
	clamd_socket=$(get_config clamd LocalSocket /var/run/clamav/clamd.sock)
	clamd_user=$(get_config clamd User clamav)
	freshclam_user=$(get_config freshclam DatabaseOwner clamav)

	if [ "${START_CLAMD}" = "yes" ]; then
		# fix clamd log permissions
		# (might be clobbered by logrotate or something)
		local logfile=$(get_config clamd LogFile)
		if [ -n "${logfile}" ]; then
			checkpath --quiet \
				--owner "${clamd_user}":"${clamd_user}" \
				--mode 640 \
				--file ${logfile}
		fi
	fi

	if [ "${START_FRESHCLAM}" = "yes" ]; then
		# fix freshclam log permissions
		# (might be clobbered by logrotate or something)
		local logfile=$(get_config freshclam UpdateLogFile)
		if [ -n "${logfile}" ]; then
			checkpath --quiet \
				--owner "${freshclam_user}":"${freshclam_user}" \
				--mode 640 \
				--file ${logfile}
		fi
	fi
}





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

* [gentoo-commits] gentoo-x86 commit in app-antivirus/clamav/files: clamd.initd-r5
@ 2013-04-16  5:52 Eray Aslan (eras)
  0 siblings, 0 replies; 2+ messages in thread
From: Eray Aslan (eras) @ 2013-04-16  5:52 UTC (permalink / raw
  To: gentoo-commits

eras        13/04/16 05:52:39

  Modified:             clamd.initd-r5
  Log:
  Check pid file directory before starting freshclam - bug #333783
  
  (Portage version: 2.2.0_alpha173/cvs/Linux x86_64, signed Manifest commit with key 0x77F1F175586A3B1F)

Revision  Changes    Path
1.2                  app-antivirus/clamav/files/clamd.initd-r5

file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-antivirus/clamav/files/clamd.initd-r5?rev=1.2&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-antivirus/clamav/files/clamd.initd-r5?rev=1.2&content-type=text/plain
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-antivirus/clamav/files/clamd.initd-r5?r1=1.1&r2=1.2

Index: clamd.initd-r5
===================================================================
RCS file: /var/cvsroot/gentoo-x86/app-antivirus/clamav/files/clamd.initd-r5,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- clamd.initd-r5	1 Apr 2013 12:51:53 -0000	1.1
+++ clamd.initd-r5	16 Apr 2013 05:52:39 -0000	1.2
@@ -1,7 +1,7 @@
 #!/sbin/runscript
 # Copyright 1999-2013 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/app-antivirus/clamav/files/clamd.initd-r5,v 1.1 2013/04/01 12:51:53 eras Exp $
+# $Header: /var/cvsroot/gentoo-x86/app-antivirus/clamav/files/clamd.initd-r5,v 1.2 2013/04/16 05:52:39 eras Exp $
 
 daemon_clamd="/usr/sbin/clamd"
 daemon_freshclam="/usr/bin/freshclam"
@@ -48,6 +48,9 @@
 	fi
 
 	if [ "${START_FRESHCLAM}" = "yes" ]; then
+		checkpath --quiet --mode 755 \
+			--owner "${clamd_user}":"${clamd_user}" \
+			--directory `dirname ${clamd_socket}`
 		ebegin "Starting freshclam"
 		start-stop-daemon --start --quiet \
 			--nicelevel ${FRESHCLAM_NICELEVEL:-0} \
@@ -93,7 +96,7 @@
 }
 
 logfix() {
-	clamd_socket=$(get_config clamd LocalSocket /var/run/clamav/clamd.sock)
+	clamd_socket=$(get_config clamd LocalSocket /run/clamav/clamd.sock)
 	clamd_user=$(get_config clamd User clamav)
 	freshclam_user=$(get_config freshclam DatabaseOwner clamav)
 





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

end of thread, other threads:[~2013-04-16  5:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-01 12:51 [gentoo-commits] gentoo-x86 commit in app-antivirus/clamav/files: clamd.initd-r5 Eray Aslan (eras)
  -- strict thread matches above, loose matches on Subject: below --
2013-04-16  5:52 Eray Aslan (eras)

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