Hello community, here is the log from the commit of package amavisd-new for openSUSE:12.1:Update:Test checked in at 2012-01-05 17:46:03 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:12.1:Update:Test/amavisd-new (Old) and /work/SRC/openSUSE:12.1:Update:Test/.amavisd-new.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "amavisd-new", Maintainer is "varkoly@suse.com" Changes: -------- --- /work/SRC/openSUSE:12.1:Update:Test/amavisd-new/amavisd-new.changes 2012-01-05 17:46:02.000000000 +0100 +++ /work/SRC/openSUSE:12.1:Update:Test/.amavisd-new.new/amavisd-new.changes 2012-01-05 17:46:04.000000000 +0100 @@ -1,0 +2,10 @@ +Wed Jan 4 14:47:42 UTC 2012 - varkoly@suse.com + +- bnc#706257 - amavis failed to start during boot, however it is active + +------------------------------------------------------------------- +Fri Nov 4 06:23:56 UTC 2011 - varkoly@suse.com + +- Add systemd scripts + +------------------------------------------------------------------- New: ---- amavisd-milter.sh amavisd.service ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ amavisd-new.spec ++++++ --- /var/tmp/diff_new_pack.HK0Pmf/_old 2012-01-05 17:46:04.000000000 +0100 +++ /var/tmp/diff_new_pack.HK0Pmf/_new 2012-01-05 17:46:04.000000000 +0100 @@ -1,7 +1,7 @@ # # spec file for package amavisd-new # -# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -15,16 +15,15 @@ # Please submit bugfixes or comments via http://bugs.opensuse.org/ # - - Name: amavisd-new Summary: High-Performance E-Mail Virus Scanner -Version: 2.7.0 -Release: 1 -License: GPLv2+ +License: GPL-2.0+ Group: Productivity/Networking/Security +Version: 2.7.0 +Release: 0 Url: http://www.ijs.si/software/amavisd/ -BuildRequires: sendmail sendmail-devel +BuildRequires: sendmail +BuildRequires: sendmail-devel Requires: gzip bzip2 unarj zoo sharutils file Requires: perl-Compress-Zlib perl-Convert-UUlib perl-IO-stringy Requires: perl-MIME-tools perl-MailTools perl-Archive-Tar perl-Unix-Syslog @@ -34,6 +33,10 @@ %if 0%{?suse_version} < 1120 Requires: lha %endif +%if 0%{?suse_version} > 1140 +BuildRequires: systemd +%{?systemd_requires} +%endif Recommends: unrar Recommends: clamav perl-spamassassin Recommends: perl-DBI @@ -51,6 +54,8 @@ Source2: rc.amavis Source3: amavisd-new-rpmlintrc Source4: amavisd-milter.tar.bz2 +Source5: amavisd.service +Source6: amavisd-milter.sh Patch1: activate_virus_scanner.diff BuildRoot: %{_tmppath}/%{name}-%{version}-build %define avspool /var/spool/amavis @@ -74,7 +79,6 @@ %package docs Summary: Documentation for the High-Performance E-Mail Virus Scanner Group: Documentation/Other -License: GPLv2+ Recommends: %{name} = %{version} %description docs @@ -131,6 +135,9 @@ ln -s ../../etc/init.d/amavis $RPM_BUILD_ROOT/%{_sbindir}/rcamavis install -m 644 LDAP.schema $RPM_BUILD_ROOT/etc/openldap/schema/amavisd-new.schema install -m 644 JpegTester.pm $RPM_BUILD_ROOT/%{perl_vendorlib}/JpegTester.pm +mkdir -p $RPM_BUILD_ROOT/lib/systemd/system +install -m 644 %{S:5} $RPM_BUILD_ROOT/lib/systemd/system/ +install -m 755 %{S:6} $RPM_BUILD_ROOT/usr/sbin/ cd amavisd-milter make install DESTDIR="$RPM_BUILD_ROOT" @@ -180,6 +187,10 @@ /var/adm/fillup-templates/sysconfig.amavis %{_sbindir}/* %{perl_vendorlib}/JpegTester.pm +%if 0%{?suse_version} >= 1140 +%config /lib/systemd/system/amavisd.service +/usr/sbin/amavisd-milter.sh +%endif %defattr(0750,%{avuser},%{avgroup}) %dir %{avspool} %dir %{avspool}/tmp ++++++ amavisd-milter.sh ++++++ #!/bin/bash . /etc/sysconfig/amavis AMAVIS_MILTER_BIN=/usr/sbin/amavisd-milter AMAVIS_MILTER_SOCK=local:/var/run/amavis/amavis-milter.sock case "$1" in start) if [ "$AMAVIS_SENDMAIL_MILTER" = "yes" ]; then startproc -u vscan $AMAVIS_MILTER_BIN -p $AMAVIS_MILTER_SOCK > /dev/null 2>&1 fi ;; stop) if [ "$AMAVIS_SENDMAIL_MILTER" = "yes" ]; then killproc -TERM $AMAVIS_MILTER_BIN fi ;; esac exit 0 ++++++ amavisd.service ++++++ # This file is part of package amavisd. # # Copyright (c) 2011 SuSE LINUX Products GmbH, Germany. # Author: Werner Fink # Please send feedback to http://www.suse.de/feedback # # Description: # # Used to start the amavisd # Amavisd-new is a high-performance interface between mailer (MTA) and # content checkers: virus scanners or SpamAssassin. It talks to the MTA # via (E)SMTP, LMTP, or by using helper programs. # [Unit] Description=Amavisd-new Virus Scanner interfac Requires=var-run.mount nss-lookup.target network.target remote-fs.target syslog.target time-sync.target After=var-run.mount nss-lookup.target network.target remote-fs.target syslog.target time-sync.target Wants=named.service clamd.service After=named.service clamd.service Before=mail-transfer-agent.target Conflicts= [Service] Type=forking PIDFile=/var/spool/amavis/amavisd.pid ExecStartPre=-/bin/echo 'Starting virus-scanner (amavisd-new):' EnvironmentFile=-/etc/sysconfig/amavisd ExecStartPre=/usr/sbin/amavisd-milter.sh start ExecStart=/usr/sbin/amavisd start ExecStartPost= ExecStartPost= ExecReload=/usr/sbin/postfix reload ExecReload=/usr/sbin/postfix flush ExecStop=/usr/sbin/amavisd stop ExecStopPost=/usr/sbin/amavisd-milter.sh stop [Install] WantedBy=multi-user.target ++++++ rc.amavis ++++++ --- /var/tmp/diff_new_pack.HK0Pmf/_old 2012-01-05 17:46:04.000000000 +0100 +++ /var/tmp/diff_new_pack.HK0Pmf/_new 2012-01-05 17:46:04.000000000 +0100 @@ -28,6 +28,38 @@ AMAVIS_PID=/var/spool/amavis/amavisd.pid AMAVIS_MILTER_SOCK=local:/var/run/amavis/amavis-milter.sock +# it's like checkproc, but works for scripts too: +checkproc_script() +{ + if [ "${1}" = "-p" ]; then + if [ -z "${2}" -o -z "${3}" ]; then + return 101 + fi + CHECK_PID=`cat "${2}"`; + if [ -e /proc/"${CHECK_PID}" ]; then + CHECK_EXE="${3}"; + FOUND=`cat /proc/"${CHECK_PID}"/cmdline | grep "${CHECK_EXE}"` + if [ -n "${FOUND}" ]; then + return 0; + else + return 1; + fi + else + return 3; + fi + elif [ -z "${2}" ]; then + CHECK_EXE="${1}"; + FOUND=`ps auxwww | grep "${CHECK_EXE}"` + if [ -n "${FOUND}" ]; then + return 0; + else + return 7; + fi + fi + + return 101; +} + # Check for missing binaries (stale symlinks should not happen) # Note: Special treatment of stop for LSB conformance test -x $AMAVISD_BIN || { echo "$AMAVIS_BIN not installed"; @@ -60,7 +92,7 @@ start) # ZMI 20100428 check for stale pid file if test -f $AMAVIS_PID ; then - checkproc -p $AMAVIS_PID amavisd + checkproc_script -p $AMAVIS_PID $AMAVISD_BIN if test $? -ge 1 ; then # pid file is stale, remove it echo -n "(stale amavisd pid file $AMAVIS_PID found, removing. Did amavisd crash?)" @@ -69,7 +101,7 @@ fi echo -n "Starting virus-scanner (amavisd-new): " $AMAVISD_BIN start - if ! checkproc amavisd; then + if ! checkproc_script $AMAVISD_BIN; then rc_failed 7 fi rc_status -v @@ -82,7 +114,7 @@ ;; stop) echo -n "Shutting down virus-scanner (amavisd-new): " - if checkproc amavisd; then + if checkproc_script $AMAVISD_BIN; then rc_reset $AMAVISD_BIN stop else @@ -117,12 +149,12 @@ ;; status) echo -n "Checking for service amavis (amavisd-new): " - checkproc -p $AMAVIS_PID amavisd + checkproc_script -p $AMAVIS_PID $AMAVISD_BIN rc_status -v if [ "$AMAVIS_SENDMAIL_MILTER" == "yes" ]; then rc_reset echo -n "Checking for service amavis-milter: " - checkproc $AMAVIS_MILTER_BIN + checkproc_script $AMAVIS_MILTER_BIN rc_status -v fi ;; -- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org