nfs-utils: update to 1.2.5, systemd switch.
This commit is contained in:
parent
e33dc307e6
commit
2c06ac51b7
16 changed files with 196 additions and 76 deletions
13
srcpkgs/nfs-utils/files/exportfs.service
Normal file
13
srcpkgs/nfs-utils/files/exportfs.service
Normal 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
|
14
srcpkgs/nfs-utils/files/idmapd.conf
Normal file
14
srcpkgs/nfs-utils/files/idmapd.conf
Normal 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
|
|
@ -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
|
|
||||||
}
|
|
3
srcpkgs/nfs-utils/files/nfs-utils.tmpfiles.d
Normal file
3
srcpkgs/nfs-utils/files/nfs-utils.tmpfiles.d
Normal 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 -
|
|
@ -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 $?
|
|
||||||
}
|
|
13
srcpkgs/nfs-utils/files/nfsd.service
Normal file
13
srcpkgs/nfs-utils/files/nfsd.service
Normal 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
|
|
@ -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
|
|
||||||
}
|
|
11
srcpkgs/nfs-utils/files/rpc-gssd.service
Normal file
11
srcpkgs/nfs-utils/files/rpc-gssd.service
Normal 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
|
11
srcpkgs/nfs-utils/files/rpc-idmapd.service
Normal file
11
srcpkgs/nfs-utils/files/rpc-idmapd.service
Normal 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
|
11
srcpkgs/nfs-utils/files/rpc-mountd.service
Normal file
11
srcpkgs/nfs-utils/files/rpc-mountd.service
Normal 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
|
11
srcpkgs/nfs-utils/files/rpc-statd.service
Normal file
11
srcpkgs/nfs-utils/files/rpc-statd.service
Normal 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
|
11
srcpkgs/nfs-utils/files/rpc-svcgssd.service
Normal file
11
srcpkgs/nfs-utils/files/rpc-svcgssd.service
Normal 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
|
7
srcpkgs/nfs-utils/files/var-lib-nfs-rpc_pipefs.mount
Normal file
7
srcpkgs/nfs-utils/files/var-lib-nfs-rpc_pipefs.mount
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
[Unit]
|
||||||
|
Description=RPC pipe filesystem
|
||||||
|
|
||||||
|
[Mount]
|
||||||
|
What=rpc_pipefs
|
||||||
|
Where=/var/lib/nfs/rpc_pipefs
|
||||||
|
Type=rpc_pipefs
|
11
srcpkgs/nfs-utils/nfs-utils.rshlibs
Normal file
11
srcpkgs/nfs-utils/nfs-utils.rshlibs
Normal 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
|
39
srcpkgs/nfs-utils/patches/nfs-utils-1.1.4-mtab-sym.patch
Normal file
39
srcpkgs/nfs-utils/patches/nfs-utils-1.1.4-mtab-sym.patch
Normal 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+");
|
|
@ -1,36 +1,55 @@
|
||||||
# Template file for 'nfs-utils'
|
# Template file for 'nfs-utils'
|
||||||
pkgname=nfs-utils
|
pkgname=nfs-utils
|
||||||
version=1.2.0
|
version=1.2.5
|
||||||
revision=1
|
homepage="http://nfs.sourceforge.net"
|
||||||
distfiles="http://downloads.sf.net/nfs/$pkgname-$version.tar.bz2"
|
distfiles="http://downloads.sf.net/nfs/$pkgname-$version.tar.bz2"
|
||||||
build_style=gnu-configure
|
build_style=gnu-configure
|
||||||
configure_args="--with-statduser=nobody --disable-gss --disable-nfsv4
|
configure_args="--with-statduser=nobody --enable-gss --enable-nfsv4
|
||||||
--enable-nfsv3 --with-statedir=/var/lib/nfs --enable-mount"
|
--with-statedir=/var/lib/nfs --enable-libmount-mount
|
||||||
|
--without-tcp-wrappers --enable-ipv6"
|
||||||
short_desc="Network File System utilities"
|
short_desc="Network File System utilities"
|
||||||
maintainer="Juan RP <xtraeme@gmail.com>"
|
maintainer="Juan RP <xtraeme@gmail.com>"
|
||||||
checksum=cb39468b3acd0bf3870cde4bbb06fe01a88e7cf0c81cff87fa7794cab871a1d1
|
license="GPL-2"
|
||||||
|
checksum=3595ed4f6ee5c13514540861ad5e89907aa4fd6897bfa99577515233e4745a9b
|
||||||
long_desc="
|
long_desc="
|
||||||
The $pkgname package provides a daemon for the kernel NFS server and
|
The $pkgname package provides a daemon for the kernel NFS server and
|
||||||
related tools, which provides a much higher level of performance than the
|
related tools, which provides a much higher level of performance than the
|
||||||
traditional Linux NFS server used by most users."
|
traditional Linux NFS server used by most users."
|
||||||
|
|
||||||
openrc_services="
|
conf_files="/etc/exports /etc/idmapd.conf"
|
||||||
mountd default false
|
|
||||||
nfsd default false
|
|
||||||
nfslock default false"
|
|
||||||
conf_files="/etc/exports"
|
|
||||||
|
|
||||||
Add_dependency full glibc
|
# systemd services
|
||||||
Add_dependency full portmap
|
systemd_services="
|
||||||
Add_dependency full libblkid
|
exportfs.service on
|
||||||
Add_dependency build tcp_wrappers
|
nfsd.service on
|
||||||
Add_dependency run tcp_wrappers-libs
|
rpc-gssd.service on
|
||||||
|
rpc-idmapd.service on
|
||||||
|
rpc-mountd.service on
|
||||||
|
rpc-statd.service on
|
||||||
|
rpc-svcgssd.service on"
|
||||||
|
|
||||||
post_install()
|
Add_dependency run rpcbind
|
||||||
{
|
|
||||||
# Install the OpenRC services.
|
Add_dependency build coreutils # install --mode
|
||||||
for f in mountd nfsd nfslock; do
|
Add_dependency build pkg-config
|
||||||
install -D -m755 ${FILESDIR}/${f}.rc ${DESTDIR}/etc/init.d/${f}
|
Add_dependency build libblkid-devel
|
||||||
done
|
Add_dependency build libmount-devel
|
||||||
install -D -m644 ${FILESDIR}/exports ${DESTDIR}/etc/exports
|
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
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue