Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
bee-files/scripts/update-nfs-utils.sh
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
executable file
111 lines (96 sloc)
3.08 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
# Note, you are doing this to a live nfs server, writes will be blocked | |
# for 90 seconds. | |
# | |
set -v | |
bee remove portmap-6.0-0.x86_64 | |
bee remove rpcinfo-1.0-0.x86_64 | |
bee update iana-etc-2.30-1 | |
bee install rpcbind-1.2.5-0.x86_64 | |
bee remove libnfsidmap-0.25-0.x86_64 | |
bee install keyutils-1.5.11-0.x86_64 | |
bee install libtirpc-1.1.4-0.x86_64 | |
bee update nfs-utils-2.3.3-0.x86_64 | |
# remove amd | |
# | |
# The service file is currently neither installed with bee nor | |
# part of mxtools, so just remove it. | |
# | |
bee remove am-utils-6.1.5-3.x86_64 | |
rm /etc/systemd/system/amd.service | |
# Remove statd.service | |
# This service is not required for nfsv4 | |
# The service file is currently neither installed with bee nor | |
# part of mxtools, so just remove it. | |
# | |
systemctl disable statd.service | |
rm /etc/systemd/system/statd.service | |
# Remove portmap.service dependencies from nis and nfsd service unit files. | |
# These files are currently neither installed with bee nor | |
# part of mxtools, so just replace. | |
# | |
# Also remove dependency on statd.service. | |
# | |
# 'portmap.service' is removed from Requires= and After= lines. | |
# | |
# We don't need new dependencies for rpcbind, because this is socket | |
# activated (if socket unit is enabled) and the service units order | |
# after sockets.target via DefaultDependencies. | |
# | |
# Additionally, for nfsd.serviced, we remove the '--descriptors 64' limit, which | |
# is to low for the mountd of nfs-utils 2.3 when serving ipv4,ipv6 and | |
# named sockets. | |
# | |
cat << '_EOF_' >/etc/systemd/system/nis.service | |
[Unit] | |
Description=Network information Service (NIS) | |
Requires=network.target | |
After=network.target | |
[Service] | |
ExecStartPre=/usr/bin/domainname molgen | |
ExecStart=/usr/sbin/ypbind -foreground | |
Restart=always | |
[Install] | |
WantedBy=multi-user.target | |
_EOF_ | |
cat << '_EOF_' >/etc/systemd/system/nfsd.service | |
[Unit] | |
Description=NFS Daemon | |
ConditionPathExists=/etc/exports | |
Requires=local-fs.target proc-fs-nfsd.mount var-lib-nfs-rpc_pipefs.mount | |
After=local-fs.target proc-fs-nfsd.mount var-lib-nfs-rpc_pipefs.mount | |
[Service] | |
ExecStartPre=/bin/mkdir -p /var/lib/nfs/v4recovery | |
ExecStartPre=/usr/sbin/exportfs -ra | |
ExecStart=/usr/sbin/rpc.mountd --foreground --manage-gids | |
ExecStartPost=/usr/sbin/rpc.nfsd -N 3 64 ; /usr/sbin/sm-notify | |
ExecReload=/usr/sbin/exportfs -ra | |
ExecStopPost=/usr/sbin/rpc.nfsd 0 ; /usr/sbin/exportfs -ua | |
Restart=always | |
[Install] | |
WantedBy=multi-user.target | |
_EOF_ | |
# | |
# Remove portmap unit file, enable rpcbind socket activation | |
# | |
systemctl disable portmap | |
rm /etc/systemd/system/portmap.service | |
systemctl enable rpcbind.socket | |
# on-disk changes done. | |
# | |
# Note, we can't just stop here and leave the old daemon running until | |
# reboot, because any new invocation of exportfs would create entries in | |
# /var/lib/nfs/etab with options, which the old mountd doesn't understand | |
# (nopnfs). | |
# | |
# This implies, we can't just push the changes around from the distmaster, | |
# but have to execute this script on every node. | |
# | |
systemctl daemon-reload | |
systemctl stop statd.service | |
systemctl stop nfsd.service | |
systemctl stop nis.service | |
systemctl stop portmap.service | |
systemctl start rpcbind.socket | |
systemctl start nis.service | |
systemctl start nfsd.service |