Index: /branches/fc15-dev/server/common/patches/openafs-systemd-crond.patch
===================================================================
--- /branches/fc15-dev/server/common/patches/openafs-systemd-crond.patch	(revision 2011)
+++ /branches/fc15-dev/server/common/patches/openafs-systemd-crond.patch	(revision 2011)
@@ -0,0 +1,17 @@
+diff --git a/src/packaging/RedHat/openafs-client.service b/src/packaging/RedHat/openafs-client.service
+index bc95057..9627280 100644
+--- a/src/packaging/RedHat/openafs-client.service
++++ b/src/packaging/RedHat/openafs-client.service
+@@ -1,5 +1,6 @@
+ [Unit]
+ Description=OpenAFS Client Service
++Before=crond.service
+ After=syslog.target network.target
+ 
+ [Service]
+@@ -15,4 +16,4 @@ ExecStop=/sbin/rmmod openafs
+ KillMode=none
+ 
+ [Install]
+-WantedBy=multi-user.target
++WantedBy=multi-user.target crond.service
Index: /branches/fc15-dev/server/common/patches/openafs-systemd.patch
===================================================================
--- /branches/fc15-dev/server/common/patches/openafs-systemd.patch	(revision 2011)
+++ /branches/fc15-dev/server/common/patches/openafs-systemd.patch	(revision 2011)
@@ -0,0 +1,51 @@
+diff --git a/src/packaging/RedHat/openafs-client.modules b/src/packaging/RedHat/openafs-client.modules
+new file mode 100644
+index 0000000..055d117
+--- /dev/null
++++ b/src/packaging/RedHat/openafs-client.modules
+@@ -0,0 +1,4 @@
++#!/bin/sh
++
++# Load the OpenAFS kernel module at boot
++exec /sbin/modprobe openafs
+diff --git a/src/packaging/RedHat/openafs-client.service b/src/packaging/RedHat/openafs-client.service
+new file mode 100644
+index 0000000..bc95057
+--- /dev/null
++++ b/src/packaging/RedHat/openafs-client.service
+@@ -0,0 +1,18 @@
++[Unit]
++Description=OpenAFS Client Service
++After=syslog.target network.target
++
++[Service]
++Type=forking
++EnvironmentFile=/etc/sysconfig/openafs
++ExecStartPre=/bin/sed -n 'w/usr/vice/etc/CellServDB' /usr/vice/etc/CellServDB.local /usr/vice/etc/CellServDB.dist
++ExecStartPre=/bin/chmod 0644 /usr/vice/etc/CellServDB
++ExecStartPre=/sbin/modprobe openafs
++ExecStart=/usr/vice/etc/afsd $AFSD_ARGS
++ExecStop=/bin/umount /afs
++ExecStop=/usr/vice/etc/afsd -shutdown
++ExecStop=/sbin/rmmod openafs
++KillMode=none
++
++[Install]
++WantedBy=multi-user.target
+diff --git a/src/packaging/RedHat/openafs-server.service b/src/packaging/RedHat/openafs-server.service
+new file mode 100644
+index 0000000..2d34bb0
+--- /dev/null
++++ b/src/packaging/RedHat/openafs-server.service
+@@ -0,0 +1,11 @@
++[Unit]
++Description=OpenAFS Server Service
++After=syslog.target network.target
++
++[Service]
++EnvironmentFile=-/etc/sysconfig/openafs
++ExecStart=/usr/afs/bin/bosserver $BOSSERVER_ARGS
++ExecStop=/usr/bin/bos shutdown localhost -wait -localauth
++
++[Install]
++WantedBy=multi-user.target
Index: /branches/fc15-dev/server/fedora/specs/openafs-systemd.spec.patch
===================================================================
--- /branches/fc15-dev/server/fedora/specs/openafs-systemd.spec.patch	(revision 2011)
+++ /branches/fc15-dev/server/fedora/specs/openafs-systemd.spec.patch	(revision 2011)
@@ -0,0 +1,202 @@
+--- rpmbuild/SPECS/openafs.spec.orig	2011-10-17 23:46:35.000000000 -0400
++++ rpmbuild/SPECS/openafs.spec	2011-10-17 23:48:41.000000000 -0400
+@@ -224,7 +224,7 @@
+ BuildRoot: %{_tmppath}/%{name}-%{version}-root
+ Packager: OpenAFS Gatekeepers <openafs-gatekeepers@openafs.org>
+ Group: Networking/Filesystems
+-BuildRequires: %{?kdepend:%{kdepend}, } pam-devel, ncurses-devel, flex, bison
++BuildRequires: %{?kdepend:%{kdepend}, } pam-devel, ncurses-devel, flex, bison, systemd-units
+ %if 0%{?fedora}
+ BuildRequires: perl-devel perl-ExtUtils-Embed
+ %endif
+@@ -323,6 +323,12 @@
+ %package client
+ Provides: scripts-openafs-client
+ Requires: binutils, openafs = %{version}
++%if 0%{?fedora} >= 15
++Requires: systemd-units
++Requires(post): systemd-units, systemd-sysv
++Requires(preun): systemd-units
++Requires(postun): systemd-units
++%endif
+ 
+ %if %{fedorakmod}
+ Requires: %{name}-kmod >= %{version}
+@@ -347,6 +353,12 @@
+ Requires: openafs = %{version}
+ Summary: OpenAFS Filesystem Server
+ Group: Networking/Filesystems
++%if 0%{?fedora} >= 15
++Requires: systemd-units
++Requires(post): systemd-units, systemd-sysv
++Requires(preun): systemd-units
++Requires(postun): systemd-units
++%endif
+ 
+ %description server
+ The AFS distributed filesystem.  AFS is a distributed filesystem
+@@ -999,7 +1011,12 @@
+ mkdir -p $RPM_BUILD_ROOT%{_sbindir}
+ mkdir -p $RPM_BUILD_ROOT%{_libdir}
+ mkdir -p $RPM_BUILD_ROOT/etc/sysconfig
++%if 0%{?fedora} < 15
+ mkdir -p $RPM_BUILD_ROOT%{initdir}
++%else
++mkdir -p $RPM_BUILD_ROOT%{_unitdir}
++mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/modules
++%endif
+ mkdir -p $RPM_BUILD_ROOT/etc/openafs
+ mkdir -p $RPM_BUILD_ROOT%{pamdir}
+ mkdir -p $RPM_BUILD_ROOT%{_prefix}/afs/etc
+@@ -1029,8 +1046,14 @@
+ 
+ # Copy root.client config files
+ install -m 755 src/packaging/RedHat/openafs.sysconfig $RPM_BUILD_ROOT/etc/sysconfig/openafs
++%if 0%{?fedora} < 15
+ install -m 755 src/packaging/RedHat/openafs-client.init $RPM_BUILD_ROOT%{initdir}/openafs-client
+ install -m 755 src/packaging/RedHat/openafs-server.init $RPM_BUILD_ROOT%{initdir}/openafs-server
++%else
++install -m 755 src/packaging/RedHat/openafs-client.service $RPM_BUILD_ROOT%{_unitdir}/openafs-client.service
++install -m 755 src/packaging/RedHat/openafs-client.modules $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/modules/openafs-client.modules
++install -m 755 src/packaging/RedHat/openafs-server.service $RPM_BUILD_ROOT%{_unitdir}/openafs-server.service
++%endif
+ 
+ # Copy PAM modules
+ install -m 755 ${sysname}/dest/lib/pam* $RPM_BUILD_ROOT%{pamdir}
+@@ -1310,7 +1333,14 @@
+ fi
+ 
+ %post client
++%if 0%{?fedora} < 15
+ chkconfig --add openafs-client
++%else
++if [ $1 -eq 1 ] ; then 
++    # Initial installation 
++    /bin/systemctl daemon-reload >/dev/null 2>&1 || :
++fi
++%endif
+ if [ ! -d /afs ]; then
+ 	mkdir /afs
+ 	chown root.root /afs
+@@ -1327,10 +1357,17 @@
+ 
+ %post server
+ #on an upgrade, don't enable if we were disabled
++%if 0%{?fedora} < 15
+ if [ $1 = 1 ] ; then
+   chkconfig --add openafs-server
+ fi
+ %{initdir}/openafs-server condrestart
++%else
++if [ $1 -eq 1 ] ; then 
++    # Initial installation 
++    /bin/systemctl daemon-reload >/dev/null 2>&1 || :
++fi
++%endif
+ 
+ %if %{build_authlibs}
+ %post authlibs
+@@ -1346,16 +1383,45 @@
+ fi
+ 
+ %preun client
++%if 0%{?fedora} < 15
+ if [ $1 = 0 ] ; then
+         %{initdir}/openafs-client stop
+         chkconfig --del openafs-client
+ fi
++%else
++if [ $1 -eq 0 ] ; then
++    	# Package removal, not upgrade
++    	/bin/systemctl --no-reload disable openafs-client.service > /dev/null 2>&1 || :
++    	/bin/systemctl stop openafs-client.service > /dev/null 2>&1 || :
++fi
++%endif
+ 
+ %preun server
++%if 0%{?fedora} < 15
+ if [ $1 = 0 ] ; then
+         %{initdir}/openafs-server stop
+         chkconfig --del openafs-server
+ fi
++%else
++if [ $1 -eq 0 ] ; then
++    	/bin/systemctl --no-reload disable openafs-server.service > /dev/null 2>&1 || :
++    	/bin/systemctl stop openafs-server.service > /dev/null 2>&1 || :
++fi
++%endif
++
++%postun client
++/bin/systemctl daemon-reload >/dev/null 2>&1 || :
++if [ $1 -ge 1 ] ; then
++    # Package upgrade, not uninstall
++    /bin/systemctl try-restart openafs-client.service >/dev/null 2>&1 || :
++fi
++
++%postun server
++/bin/systemctl daemon-reload >/dev/null 2>&1 || :
++if [ $1 -ge 1 ] ; then
++    # Package upgrade, not uninstall
++    /bin/systemctl try-restart openafs-server.service >/dev/null 2>&1 || :
++fi
+ 
+ %if %{build_dkmspkg}
+ %post -n dkms-%{name}
+@@ -1413,6 +1479,32 @@
+ %endif
+ %endif
+ 
++%triggerun -- openafs-client < 1.6.0-1
++# Save the current service runlevel info
++# User must manually run systemd-sysv-convert --apply httpd
++# to migrate them to systemd targets
++/usr/bin/systemd-sysv-convert --save openafs-client >/dev/null 2>&1 ||:
++
++# If the package is allowed to autostart:
++/bin/systemctl --no-reload enable openafs-client.service >/dev/null 2>&1 ||:
++
++# Run these because the SysV package being removed won't do them
++/sbin/chkconfig --del openafs-client >/dev/null 2>&1 || :
++/bin/systemctl try-restart openafs-client.service >/dev/null 2>&1 || : 
++
++%triggerun -- openafs-server < 1.6.0-1
++# Save the current service runlevel info
++# User must manually run systemd-sysv-convert --apply httpd
++# to migrate them to systemd targets
++/usr/bin/systemd-sysv-convert --save openafs-server >/dev/null 2>&1 ||:
++
++# If the package is allowed to autostart:
++/bin/systemctl --no-reload enable openafs-server.service >/dev/null 2>&1 ||:
++
++# Run these because the SysV package being removed won't do them
++/sbin/chkconfig --del openafs-server >/dev/null 2>&1 || :
++/bin/systemctl try-restart openafs-server.service >/dev/null 2>&1 || : 
++
+ ##############################################################################
+ ###
+ ### file lists
+@@ -1450,7 +1542,12 @@
+ %{pamdir}/pam_afs.krb.so
+ %{pamdir}/pam_afs.so.1
+ %{pamdir}/pam_afs.so
++%if 0%{?fedora} < 15
+ %{initdir}/openafs-client
++%else
++%{_unitdir}/openafs-client.service
++%{_sysconfdir}/sysconfig/modules/openafs-client.modules
++%endif
+ %{_mandir}/man1/cmdebug.*
+ %{_mandir}/man1/copyauth.*
+ %{_mandir}/man1/up.*
+@@ -1498,7 +1595,11 @@
+ %{_sbindir}/vldb_check
+ %{_sbindir}/vldb_convert
+ %{_sbindir}/voldump
++%if 0%{?fedora} < 15
+ %{initdir}/openafs-server
++%else
++%{_unitdir}/openafs-server.service
++%endif
+ %{_mandir}/man5/AuthLog.*
+ %{_mandir}/man5/BackupLog.*
+ %{_mandir}/man5/BosConfig.*
Index: /branches/fc15-dev/server/fedora/specs/openafs.spec.patch
===================================================================
--- /branches/fc15-dev/server/fedora/specs/openafs.spec.patch	(revision 2010)
+++ /branches/fc15-dev/server/fedora/specs/openafs.spec.patch	(revision 2011)
@@ -5,10 +5,10 @@
  # for beta/rc releases make pkgrel 0.<tag>
  # for real releases make pkgrel 1 (or more for extra releases)
--%define pkgrel 0.pre7
-+%define pkgrel 0.pre7.99.scripts.%{scriptsversion}
+-%define pkgrel 1
++%define pkgrel 1.99.scripts.%{scriptsversion}
  
  %{!?fedorakmod: %define fedorakmod 1}
  %{!?build_dkmspkg: %define build_dkmspkg 1}
-@@ -247,6 +247,9 @@
+@@ -247,6 +247,11 @@
  %endif
  ExclusiveArch: %{ix86} x86_64 ia64 s390 s390x sparc64 ppc ppc64
@@ -16,4 +16,6 @@
 +Patch1000: openafs-scripts.patch
 +Patch1001: openafs-localcsdb.patch
++Patch1002: openafs-systemd.patch
++Patch1003: openafs-systemd-crond.patch
 +
  #    http://dl.openafs.org/dl/openafs/candidate/%{afsvers}/...
@@ -77,5 +79,5 @@
  %else
  
-@@ -680,6 +689,10 @@
+@@ -680,6 +689,12 @@
  #%setup -q -n %{srcdir}
  %setup -q -b 1 -n %{srcdir}
@@ -84,9 +86,11 @@
 +%patch1000 -p1 -b .scripts
 +%patch1001 -p1 -b .localcsdb
++%patch1002 -p1 -b .systemd
++%patch1003 -p1 -b .systemd-crond
 +
  ##############################################################################
  #
  # building
-@@ -1215,6 +1228,13 @@
+@@ -1215,6 +1230,13 @@
  rm -f $RPM_BUILD_ROOT%{_libdir}/libafsrpc.so
  rm -f $RPM_BUILD_ROOT%{_libdir}/libafsauthent.so.*
