nfs-utils: update to 1.2.5, systemd switch.

This commit is contained in:
Juan RP 2012-01-28 17:04:13 +01:00
parent e33dc307e6
commit 2c06ac51b7
16 changed files with 196 additions and 76 deletions

View file

@ -0,0 +1,13 @@
[Unit]
Description=Export filesystems over NFS
After=nfsd.service
Requires=nfsd.service
[Service]
ExecStart=/usr/sbin/exportfs -ar
ExecStop=/usr/sbin/exportfs -au
ExecReload=/usr/sbin/exportfs -ar
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target

View file

@ -0,0 +1,14 @@
[General]
Verbosity = 0
Pipefs-Directory = /var/lib/nfs/rpc_pipefs
Domain = localdomain
[Mapping]
Nobody-User = nobody
Nobody-Group = nobody
[Translation]
Method = nsswitch

View file

@ -1,13 +0,0 @@
#!/sbin/runscript
# Disable v1 and v2 by default.
: ${mountd_args:=--no-nfs-version 1 --no-nfs-version 2}
command=/usr/sbin/rpc.mountd
command_args=$mountd_args
name="RPC Mountd daemon"
depend()
{
need nfslock
}

View file

@ -0,0 +1,3 @@
d /var/lib/nfs/rpc_pipefs 0755 root root -
d /var/lib/nfs/v4recovery 0755 root root -
d /etc/exports.d 0750 root root -

View file

@ -1,30 +0,0 @@
#!/sbin/runscript
# By default start up 8 server threads.
: ${nfsd_args:=8}
command=/usr/sbin/rpc.nfsd
command_args=$nfsd_args
pidfile=/var/run/nfsd.pid
name="RPC Network File System daemon"
depend()
{
use procfs
need mountd
}
start_post()
{
echo $(pidof -o %PPID nfsd) > $pidfile
sm-notify ${smnotify_args}
}
stop()
{
# Unexport all directories before.
exportfs -au
ebegin "Stopping $name"
kill -9 $(cat $pidfile) && rm -f $pidfile
eend $?
}

View file

@ -0,0 +1,13 @@
[Unit]
Description=NFS server
After=rpcbind.service
Requires=rpcbind.service
[Service]
Type=oneshot
ExecStart=/usr/sbin/rpc.nfsd
ExecStop=/usr/sbin/rpc.nfsd 0
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target

View file

@ -1,11 +0,0 @@
#!/sbin/runscript
command=/usr/sbin/rpc.statd
command_args=$nfslock_args
pidfile=/var/run/rpc.statd.pid
name="RPC Statd daemon"
depend()
{
need portmap
}

View file

@ -0,0 +1,11 @@
[Unit]
Description=RPC GSS-API client-side daemon
After=rpcbind.service var-lib-nfs-rpc_pipefs.mount
Requires=rpcbind.service var-lib-nfs-rpc_pipefs.mount
[Service]
Type=forking
ExecStart=/usr/sbin/rpc.gssd
[Install]
WantedBy=multi-user.target

View file

@ -0,0 +1,11 @@
[Unit]
Description=NFSv4 ID-name mapping daemon
After=var-lib-nfs-rpc_pipefs.mount nfsd.service
Requires=var-lib-nfs-rpc_pipefs.mount
[Service]
Type=forking
ExecStart=/usr/sbin/rpc.idmapd
[Install]
WantedBy=multi-user.target

View file

@ -0,0 +1,11 @@
[Unit]
Description=NFSv2/3 Mount Daemon
After=rpcbind.service nfsd.service
Requires=rpcbind.service nfsd.service
[Service]
Type=forking
ExecStart=/usr/sbin/rpc.mount
[Install]
WantedBy=multi-user.target

View file

@ -0,0 +1,11 @@
[Unit]
Description=NFSv2/3 Network Status Monitor Daemon
After=rpcbind.service
Requires=rpcbind.service
[Service]
Type=forking
ExecStart=/usr/sbin/rpc.statd
[Install]
WantedBy=multi-user.target

View file

@ -0,0 +1,11 @@
[Unit]
Description=RPC GSS-API server-side daemon
After=rpcbind.service
Requires=rpcbind.service
[Service]
Type=forking
ExecStart=/usr/sbin/rpc.svcgssd
[Install]
WantedBy=multi-user.target

View file

@ -0,0 +1,7 @@
[Unit]
Description=RPC pipe filesystem
[Mount]
What=rpc_pipefs
Where=/var/lib/nfs/rpc_pipefs
Type=rpc_pipefs

View file

@ -0,0 +1,11 @@
libc.so.6
libblkid.so.1
libtirpc.so.1
libcap.so.2
libevent-2.0.so.5
libnfsidmap.so.0
libdevmapper.so.1.02
libgssglue.so.1
libkrb5.so.3
libcom_err.so.2
libmount.so.1

View file

@ -0,0 +1,39 @@
ripped from Debian
--- utils/mount/fstab.c
+++ utils/mount/fstab.c
@@ -57,7 +57,7 @@ mtab_does_not_exist(void) {
return var_mtab_does_not_exist;
}
-static int
+int
mtab_is_a_symlink(void) {
get_mtab_info();
return var_mtab_is_a_symlink;
--- utils/mount/fstab.h
+++ utils/mount/fstab.h
@@ -7,6 +7,7 @@
#define _PATH_FSTAB "/etc/fstab"
#endif
+int mtab_is_a_symlink(void);
int mtab_is_writable(void);
int mtab_does_not_exist(void);
void reset_mtab_info(void);
--- utils/mount/mount.c
+++ utils/mount/mount.c
@@ -230,6 +230,13 @@ create_mtab (void) {
int flags;
mntFILE *mfp;
+ /* Avoid writing if the mtab is a symlink to /proc/mounts, since
+ that would create a file /proc/mounts in case the proc filesystem
+ is not mounted, and the fchmod below would also fail. */
+ if (mtab_is_a_symlink()) {
+ return EX_SUCCESS;
+ }
+
lock_mtab();
mfp = nfs_setmntent (MOUNTED, "a+");

View file

@ -1,36 +1,55 @@
# Template file for 'nfs-utils'
pkgname=nfs-utils
version=1.2.0
revision=1
version=1.2.5
homepage="http://nfs.sourceforge.net"
distfiles="http://downloads.sf.net/nfs/$pkgname-$version.tar.bz2"
build_style=gnu-configure
configure_args="--with-statduser=nobody --disable-gss --disable-nfsv4
--enable-nfsv3 --with-statedir=/var/lib/nfs --enable-mount"
configure_args="--with-statduser=nobody --enable-gss --enable-nfsv4
--with-statedir=/var/lib/nfs --enable-libmount-mount
--without-tcp-wrappers --enable-ipv6"
short_desc="Network File System utilities"
maintainer="Juan RP <xtraeme@gmail.com>"
checksum=cb39468b3acd0bf3870cde4bbb06fe01a88e7cf0c81cff87fa7794cab871a1d1
license="GPL-2"
checksum=3595ed4f6ee5c13514540861ad5e89907aa4fd6897bfa99577515233e4745a9b
long_desc="
The $pkgname package provides a daemon for the kernel NFS server and
related tools, which provides a much higher level of performance than the
traditional Linux NFS server used by most users."
openrc_services="
mountd default false
nfsd default false
nfslock default false"
conf_files="/etc/exports"
conf_files="/etc/exports /etc/idmapd.conf"
Add_dependency full glibc
Add_dependency full portmap
Add_dependency full libblkid
Add_dependency build tcp_wrappers
Add_dependency run tcp_wrappers-libs
# systemd services
systemd_services="
exportfs.service on
nfsd.service on
rpc-gssd.service on
rpc-idmapd.service on
rpc-mountd.service on
rpc-statd.service on
rpc-svcgssd.service on"
post_install()
{
# Install the OpenRC services.
for f in mountd nfsd nfslock; do
install -D -m755 ${FILESDIR}/${f}.rc ${DESTDIR}/etc/init.d/${f}
done
install -D -m644 ${FILESDIR}/exports ${DESTDIR}/etc/exports
Add_dependency run rpcbind
Add_dependency build coreutils # install --mode
Add_dependency build pkg-config
Add_dependency build libblkid-devel
Add_dependency build libmount-devel
Add_dependency build libtirpc-devel
Add_dependency build librpcsecgss-devel
Add_dependency build libnfsidmap-devel
Add_dependency build libevent-devel
Add_dependency build device-mapper-devel
Add_dependency build libcap-devel
Add_dependency build mit-krb5-devel
post_install() {
# conffiles
vinstall ${FILESDIR}/exports 644 etc
vinstall ${FILESDIR}/idmapd.conf 644 etc
# systemd glue
vinstall ${FILESDIR}/${pkgname}.tmpfiles.d 644 \
usr/lib/tmpfiles.d ${pkgname}.conf
vmkdir lib/systemd/system
install -m644 ${FILESDIR}/*.{service,mount} \
${DESTDIR}/lib/systemd/system
}