diff --git a/argus.service b/argus.service new file mode 100644 index 0000000..43e4ee6 --- /dev/null +++ b/argus.service @@ -0,0 +1,12 @@ +[Unit] +Description=Argus generates network transaction audit records +After=syslog.target network.target + +[Service] +Type=forking +PIDFile=/var/run/argus.pid +ExecStart=/usr/sbin/argus -d + +[Install] +WantedBy=multi-user.target + diff --git a/argus.spec b/argus.spec index 9e39398..7c6a2cd 100644 --- a/argus.spec +++ b/argus.spec @@ -1,13 +1,13 @@ Name: argus Version: 2.0.6.fixes.1 -Release: 20%{?dist} +Release: 21%{?dist} Summary: Network transaction audit tool License: GPLv2+ Group: Applications/Internet Url: http://qosient.com/argus Source0: ftp://ftp.qosient.com/dev/argus-2.0/%{name}-%{version}.tar.gz Source1: ftp://ftp.qosient.com/dev/argus-2.0/%{name}-clients-%{version}.tar.gz -Source2: argus.init +Source2: argus.service Source3: README.fedora Patch0: argus-2.0.6.fixes.1-makefile.patch Patch1: argus-2.0.6.fixes.1-build.patch @@ -17,11 +17,10 @@ Patch2: argus-2.0.6.fixes.1-libpcap10.patch Patch3: argus-clients-2.0.6.fixes.1-makefile.patch Patch4: argus-clients-2.0.6.fixes.1-build.patch Patch5: argus-clients-2.0.6.fixes.1-print.patch -BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) -Requires(post): /sbin/chkconfig -Requires(preun): /sbin/chkconfig +Requires(post): systemd-sysv BuildRequires: cyrus-sasl-devel tcp_wrappers flex bison ncurses-devel BuildRequires: libpcap-devel +BuildRequires: systemd-units %package clients Summary: Client tools for argus network audit @@ -58,7 +57,6 @@ pushd %{name}-clients-%{version} popd %install -%{__rm} -rf %{buildroot} %{__make} DESTDIR=%{buildroot} install pushd %{name}-clients-%{version} %{__make} DESTDIR=%{buildroot} install @@ -69,7 +67,7 @@ popd %{__rm} -rf %{buildroot}/%{_bindir}/ragraph %{__install} -d -m 0755 %{buildroot}/%{_localstatedir}/lib/argus/archive %{__install} -D -m 0644 support/Config/argus.conf %{buildroot}/%{_sysconfdir}/argus.conf -%{__install} -D -m 0755 %{SOURCE2} %{buildroot}/%{_initrddir}/argus +%{__install} -D -m 0755 %{SOURCE2} %{buildroot}/%{_unitdir}/argus.service # fix up argus.conf to a good default %{__sed} -i 's|var/log/argus|var/lib/argus|' %{buildroot}/%{_sysconfdir}/argus.conf %{__sed} -i 's|#ARGUS_BIND_IP|ARGUS_BIND_IP|' %{buildroot}/%{_sysconfdir}/argus.conf @@ -77,34 +75,21 @@ popd # avoid unwanted dependencies when using these as docs (main package): find support -type f -exec chmod a-x '{}' \; -%clean -%{__rm} -rf %{buildroot} +%triggerun -- argus < 2.0.6.fixes.1-21 +# Save the current service runlevel info +# User must manually run systemd-sysv-convert --apply argus +# to migrate them to systemd targets +/usr/bin/systemd-sysv-convert --save argus >/dev/null 2>&1 ||: -%post -# only post-install -if [ $1 -le 1 ]; then - /sbin/chkconfig --add argus -fi - -%preun -# only pre-erase -if [ $1 -eq 0 ]; then - /sbin/service argus stop >/dev/null 2>&1 - /sbin/chkconfig --del argus -fi - -%postun -# only postun-upgrade -if [ $1 -ge 1 ]; then - /sbin/service argus condrestart >/dev/null 2>&1 -fi +# Run these because the SysV package being removed won't do them +/sbin/chkconfig --del argus >/dev/null 2>&1 || : +/bin/systemctl try-restart argus.service >/dev/null 2>&1 || : %files -%defattr(-,root,root) %doc support doc/CHANGES doc/FAQ doc/HOW-TO doc/html bin/argusbug %doc COPYING CREDITS INSTALL README VERSION %config(noreplace) %{_sysconfdir}/argus.conf -%{_initrddir}/argus +%{_unitdir}/argus.service %{_sbindir}/argus* %{_mandir}/man5/argus* %{_mandir}/man8/argus* @@ -127,6 +112,9 @@ fi %{_mandir}/man5/ra* %changelog +* Thu Sep 8 2011 Tom Callaway - 2.0.6.fixes.1-21 +- convert to systemd + * Mon Feb 07 2011 Fedora Release Engineering - 2.0.6.fixes.1-20 - Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild