Author: jjneely
Update of /cvs/free/rpms/openafs/devel
In directory old02.ovh.rpmfusion.lan:/tmp/cvs-serv14355
Modified Files:
openafs-1.6.1-systemd-execpoststart.patch openafs.spec
Added Files:
posthooks.sh setcrypt.sh sysnames.sh
Removed Files:
sysnames
Log Message:
* Wed Nov 08 2012 Jack Neely <jjneely(a)ncsu.edu> 0:1.6.1-8
- Implement a directory for sourced post init scripts. These
fine tune the AFS client's behavior after startup and live in
/etc/openafs/posthooks.d/
--- NEW FILE posthooks.sh ---
#!/bin/bash
# openafs-posthooks.sh
#
# Copyright 2012 NC State University
# Written by Jack Neely <jjneely(a)ncsu.edu>
#
# SDG
#
# This script runs as a ExecStartPost from the openafs-client.service
# systemd unit. It will source files in /etc/openafs/posthooks.d
# where an admin may place scripts to fine tune the OpenAFS client
# operations. Such as turning on encryption. The sysnames.sh script
# in that directory comes with this package.
HOOKS=/etc/openafs/posthooks.d
if [ -d $HOOKS ] ; then
for i in $HOOKS/*.sh ; do
if [ -r "$i" ]; then
. $i
fi
done
unset i
fi
--- NEW FILE setcrypt.sh ---
#!/bin/bash
# By default, turn on encryption of the AFS protocol
/usr/bin/fs setcrypt -crypt on
--- NEW FILE sysnames.sh ---
#!/bin/bash
# /usr/libexec/openafs/sysnames
# Set custom sysnames after starting the afsd service.
# Runs as "ExecStartPost" in openafs-client.service.
# Figure out what we are
_ARCH=`uname -i | sed 's/x86_64/amd64/'`
_KERN=`uname -r | sed 's/\([0-9]\+\)\.\([0-9]\+\)\..*/\1\2/'`
_DIST=""
for d in fedora centos redhat ; do
if [ -f "/etc/$d-release" ] ; then
_DIST=$d
break
fi
done
# What version of the distribution are we? Cut off the Client|Server
# mess from RHEL
_REL=`/bin/rpm -qf --qf '%{version}\n' /etc/${_DIST}-release | sed
's/\([0-9]\+\)[a-zA-Z]\+/\1/'`
# Sysname list. The order here is from specific to general, with a
# fallback to the compiled-in value from /usr/bin/sys. This will be
# used as the sysname search path.
SYSNAMELIST="${_ARCH}_${_DIST}_${_REL} ${_ARCH}_linux${_KERN} $(/usr/bin/sys)"
# Set the sysname
if [ -n "$SYSNAMELIST" ] ; then
_FLAG=0
_CMD=""
for SYSNAME in $SYSNAMELIST ; do
if [ $_FLAG == "1" ] ; then
_CMD="$_CMD -newsys $SYSNAME"
else
_FLAG=1
_CMD="/usr/bin/fs sysname $SYSNAME"
fi
done
fi
$_CMD > /dev/null
openafs-1.6.1-systemd-execpoststart.patch:
openafs-client.service | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Index: openafs-1.6.1-systemd-execpoststart.patch
===================================================================
RCS file: /cvs/free/rpms/openafs/devel/openafs-1.6.1-systemd-execpoststart.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- openafs-1.6.1-systemd-execpoststart.patch 9 Oct 2012 06:01:35 -0000 1.1
+++ openafs-1.6.1-systemd-execpoststart.patch 8 Nov 2012 19:26:04 -0000 1.2
@@ -1,27 +1,26 @@
-From a105ddc4136df2b0d8f6b143a5e46d353a5ea128 Mon Sep 17 00:00:00 2001
-From: Ken Dreyer <ktdreyer(a)ktdreyer.com>
-Date: Mon, 8 Oct 2012 21:01:52 -0600
-Subject: [PATCH 5/5] systemd: run "sysnames" script after starting afsd
+From 09090de0313776f114d626bbba8485f08a3e886a Mon Sep 17 00:00:00 2001
+From: Jack Neely <jjneely(a)ncsu.edu>
+Date: Wed, 7 Nov 2012 17:00:37 -0500
+Subject: [PATCH] systemd: Implement hooks for tuning the AFS client
-This helper script will set any custom sysnames on the client.
-
-Change-Id: Ibdb770fac20eb26b137bd02a71a52e0c801b039d
+This makes a generic way to modify the behavior of the AFS client
+similar to the old style afs_post_init bash function.
---
- src/packaging/RedHat/openafs-client.service | 1 +
- 1 file changed, 1 insertion(+)
+ src/packaging/RedHat/openafs-client.service | 1 +
+ 1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/src/packaging/RedHat/openafs-client.service
b/src/packaging/RedHat/openafs-client.service
-index 719aed77..aac1ca7 100644
+index a2348cb..29548ac 100644
--- a/src/packaging/RedHat/openafs-client.service
+++ b/src/packaging/RedHat/openafs-client.service
@@ -7,6 +7,7 @@ Type=forking
EnvironmentFile=/etc/sysconfig/openafs
ExecStartPre=/sbin/modprobe openafs
ExecStart=/usr/sbin/afsd $AFSD_ARGS $CACHE $OPTIONS $CONFDIR
-+ExecStartPost=/usr/libexec/openafs/sysnames
++ExecStartPost=/usr/libexec/openafs/posthooks.sh
ExecStop=/bin/umount /afs
ExecStop=/usr/sbin/afsd -shutdown
ExecStop=/sbin/rmmod libafs
--
-1.7.11.7
+1.7.1
Index: openafs.spec
===================================================================
RCS file: /cvs/free/rpms/openafs/devel/openafs.spec,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -r1.30 -r1.31
--- openafs.spec 7 Nov 2012 19:07:33 -0000 1.30
+++ openafs.spec 8 Nov 2012 19:26:04 -0000 1.31
@@ -13,7 +13,7 @@
Summary: Enterprise Network File System
Name: openafs
Version: 1.6.1
-Release: 7%{?dist}
+Release: 8%{?dist}
License: IBM
Group: System Environment/Daemons
URL:
http://www.openafs.org
@@ -25,8 +25,11 @@
Source14: afs.conf
# Similar to afs.conf, but for systemd.
Source15: afs.conf.systemd
-# Sysnames helper script
-Source16: sysnames
+# Handle AFS post init scriptlets for systemd
+Source16: posthooks.sh
+# Default post init scripts
+Source20: sysnames.sh
+Source21: setcrypt.sh
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: krb5-devel, pam-devel, ncurses-devel, flex, byacc, bison
@@ -207,7 +210,13 @@
popd
# install "sysnames" helper script
install -p -m 755 %{SOURCE16} \
- ${RPM_BUILD_ROOT}%{_libexecdir}/openafs/sysnames
+ ${RPM_BUILD_ROOT}%{_libexecdir}/openafs/posthooks.sh
+ install -d -m 755 \
+ ${RPM_BUILD_ROOT}%{_sysconfdir}/openafs/posthooks.d
+ install -p -m 644 %{SOURCE20} \
+ ${RPM_BUILD_ROOT}%{_sysconfdir}/openafs/posthooks.d/sysnames.sh
+ install -p -m 644 %{SOURCE21} \
+ ${RPM_BUILD_ROOT}%{_sysconfdir}/openafs/posthooks.d/setcrypt.sh
%else
# install legacy SysV init script
mkdir -p ${RPM_BUILD_ROOT}%{_sysconfdir}/rc.d/init.d
@@ -387,7 +396,8 @@
%config(noreplace) %{_sysconfdir}/openafs/cacheinfo
%if 0%{?_with_systemd}
%{_unitdir}/openafs-client.service
-%{_libexecdir}/openafs/sysnames
+%{_libexecdir}/openafs/posthooks.sh
+%{_sysconfdir}/openafs/posthooks.d/*.sh
%endif
%{_bindir}/afsio
%{_bindir}/cmdebug
@@ -455,6 +465,11 @@
%{_datadir}/openafs/C/afszcm.cat
%changelog
+* Wed Nov 08 2012 Jack Neely <jjneely(a)ncsu.edu> 0:1.6.1-8
+- Implement a directory for sourced post init scripts. These
+ fine tune the AFS client's behavior after startup and live in
+ /etc/openafs/posthooks.d/
+
* Wed Nov 07 2012 Jack Neely <jjneely(a)ncsu.edu> 0:1.6.1-7
- Fine tune the systemd version of /etc/sysconfig/openafs
to use -fakestat and have some options settable by the user.
--- sysnames DELETED ---