[packages/rpcbind] - use upstream systemd units (with patch); real life check wanted - use upstream make install

Jakub Bogusz qboosh at pld-linux.org
Wed Jul 18 16:44:01 CEST 2018


On Thu, Jun 14, 2018 at 12:18:27PM +0200, Andrzej Zawadzki wrote:
>    Hi!
>    Doesn't work :-(
>    [root at pld-template ~]# systemctl status nfslock
>    0M nfslock.service - NFS file locking service
>       Loaded: loaded (/lib/systemd/system/nfslock.service; enabled; vendor
>    preset: enabled)
>       Active: failed (Result: exit-code) since Thu 2018-06-14 10:42:18
>    CEST; 4min 6s ago
>      Process: 874 ExecStopPost=/sbin/sysctl -w fs.nfs.nlm_tcpport=0
>    fs.nfs.nlm_udpport=0 (code=exited, status=254)
>      Process: 815 ExecStart=/sbin/rpc.statd $STATDOPTIONS (code=exited,
>    status=1/FAILURE)
>      Process: 808 ExecStartPre=/usr/share/nfs-utils/nfslock.preconfig
>    (code=exited, status=0/SUCCESS)
>    cze 14 10:42:18 pld-template rpc.statd[826]: Failed to register (statd,
>    1, udp): svc_reg() err: RPC: Success
>    cze 14 10:42:18 pld-template rpc.statd[826]: Failed to register (statd,
>    1, tcp): svc_reg() err: RPC: Success
>    cze 14 10:42:18 pld-template rpc.statd[826]: Failed to register (statd,
>    1, udp6): svc_reg() err: RPC: Success
>    cze 14 10:42:18 pld-template rpc.statd[826]: Failed to register (statd,
>    1, tcp6): svc_reg() err: RPC: Success
>    cze 14 10:42:18 pld-template rpc.statd[826]: failed to create RPC
>    listeners, exiting

Any ideas on the cause?

>    cze 14 10:42:18 pld-template systemd[1]: nfslock.service: Control
>    process exited, code=exited status=1
>    cze 14 10:42:18 pld-template sysctl[874]: sysctl: cannot stat
>    /proc/sys/fs/nfs/nlm_tcpport: No such file or directory
>    cze 14 10:42:18 pld-template sysctl[874]: sysctl: cannot stat
>    /proc/sys/fs/nfs/nlm_udpport: No such file or directory

Some module not loaded?

>    cze 14 10:42:18 pld-template systemd[1]: nfslock.service: Failed with
>    result 'exit-code'.
>    cze 14 10:42:18 pld-template systemd[1]: Failed to start NFS file
>    locking service.
>    After downgrade to auto/th/rpcbind-0.2.3-1 everything works.
>    On 11.04.2018 19:50, qboosh wrote:
> 
> commit 743aa2864e361cc9aabb9e1365975d257d2ff599
> Author: Jakub Bogusz [1]<qboosh at pld-linux.org>
> Date:   Wed Apr 11 19:50:57 2018 +0200
> 
>     - use upstream systemd units (with patch); real life check wanted
>     - use upstream make install
> 
>  rpcbind-systemd.patch | 29 +++++++++++++++++++++++++++++
>  rpcbind.service       | 13 -------------
>  rpcbind.socket        |  8 --------
>  rpcbind.spec          | 23 ++++++++++-------------
>  4 files changed, 39 insertions(+), 34 deletions(-)
> ---
> diff --git a/rpcbind.spec b/rpcbind.spec
> index 5493666..544fe5a 100644
> --- a/rpcbind.spec
> +++ b/rpcbind.spec
> @@ -9,12 +9,11 @@ Source0:      [2]http://downloads.sourceforge.net/rpcbind/%{na
> me}-%{version}.tar.bz2
>  # Source0-md5: cf10cd41ed8228fc54c316191c1f07fe
>  Source1:       %{name}.init
>  Source2:       %{name}.sysconfig
> -Source3:       %{name}.service
> -Source4:       %{name}.socket
>  Patch0:                %{name}-libwrap.patch
>  Patch1:                %{name}-syslog.patch
>  Patch2:                %{name}-sunrpc.patch
>  Patch3:                %{name}-nss.h.patch
> +Patch4:                %{name}-systemd.patch
>  Patch6:                %{name}-tcp-addrs.patch
>  # [3]http://nfsv4.bullopensource.org/doc/tirpc_rpcbind.php
>  URL:           [4]http://sourceforge.net/projects/rpcbind/
> @@ -57,6 +56,7 @@ wywol/ania RPC na serwerze na tej maszynie.
>  %patch1 -p1
>  %patch2 -p1
>  %patch3 -p1
> +%patch4 -p1
>  %patch6 -p1
> 
>  %build
> @@ -65,29 +65,26 @@ wywol/ania RPC na serwerze na tej maszynie.
>  %{__autoconf}
>  %{__automake}
>  %configure \
> +       --bindir=/sbin \
>         --enable-libwrap \
>         --enable-warmstarts \
>         --with-statedir=/var/lib/rpcbind \
>         --with-rpcuser=rpc \
> -       --with-systemdsystemunitdir=%{%systemdunitdir}
> +       --with-systemdsystemunitdir=%{systemdunitdir}
>  %{__make}
> 
>  %install
>  rm -rf $RPM_BUILD_ROOT
> -install -d $RPM_BUILD_ROOT{/sbin,%{_sbindir},/etc/{sysconfig,rc.d/init.d}} \
> -       $RPM_BUILD_ROOT{%{_mandir}/man8,%{_var}/lib/%{name},%{systemdunitdir}}
> +install -d $RPM_BUILD_ROOT{/sbin,%{_sbindir},/etc/{sysconfig,rc.d/init.d},/var/
> lib/rpcbind}
> 
> -install rpcbind $RPM_BUILD_ROOT/sbin
> -install rpcinfo $RPM_BUILD_ROOT%{_sbindir}
> +%{__make} install \
> +       DESTDIR=$RPM_BUILD_ROOT
> 
> -install man/{rpcbind,rpcinfo}.8 $RPM_BUILD_ROOT%{_mandir}/man8
> +%{__mv} $RPM_BUILD_ROOT/sbin/rpcinfo $RPM_BUILD_ROOT%{_sbindir}
> 
>  install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/rpcbind
>  install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/rpcbind
> 
> -install %{SOURCE3} $RPM_BUILD_ROOT%{systemdunitdir}/rpcbind.service
> -install %{SOURCE4} $RPM_BUILD_ROOT%{systemdunitdir}/rpcbind.socket
> -
>  %clean
>  rm -rf $RPM_BUILD_ROOT
> 
> @@ -115,8 +112,8 @@ fi
>  %triggerpostun -- %{name} < 0.2.0-5
>  if [ -f /etc/sysconfig/rpcbind ]; then
>         . /etc/sysconfig/rpcbind
> -       [ "$RPCBIND_VERBOSE" == "no" ] || RPCBIND_OPTIONS="-l"
> -       [ "$RPCBIND_INSECURE" == "yes" ] && RPCBIND_OPTIONS="$RPCBIND_OPTIONS -i
> "
> +       [ "$RPCBIND_VERBOSE" = "no" ] || RPCBIND_OPTIONS="-l"
> +       [ "$RPCBIND_INSECURE" = "yes" ] && RPCBIND_OPTIONS="$RPCBIND_OPTIONS -i"
>         for a in $RPCBIND_ADDRESSES ; do
>                 RPCBIND_OPTIONS="$RPCBIND_OPTIONS -h $a"
>         done
> diff --git a/rpcbind-systemd.patch b/rpcbind-systemd.patch
> new file mode 100644
> index 0000000..c38ca9c
> --- /dev/null
> +++ b/rpcbind-systemd.patch
> @@ -0,0 +1,29 @@
> +--- rpcbind-0.2.4/systemd/rpcbind.service.in.orig      2016-11-28 21:47:28.0000
> 00000 +0100
> ++++ rpcbind-0.2.4/systemd/rpcbind.service.in   2018-04-11 19:41:46.466605338 +0
> 200
> +@@ -6,12 +6,13 @@
> + # Make sure we use the IP addresses listed for
> + # rpcbind.socket, no matter how this unit is started.
> + Wants=rpcbind.socket
> +-After=rpcbind.socket
> ++After=rpcbind.socket syslog.target network.target
> +
> + [Service]
> + Type=notify
> +-# distro can provide a drop-in adding EnvironmentFile=-/??? if needed.
> ++EnvironmentFile=-/etc/sysconfig/rpcbind
> + ExecStart=@_bindir@/rpcbind $RPCBIND_OPTIONS -w -f
> +
> + [Install]
> + WantedBy=multi-user.target
> ++Also=rpcbind.socket
> +--- rpcbind-0.2.4/systemd/rpcbind.socket.orig  2016-11-28 21:47:28.000000000 +0
> 100
> ++++ rpcbind-0.2.4/systemd/rpcbind.socket       2018-04-11 19:43:27.366604185 +0
> 200
> +@@ -5,7 +5,7 @@
> + Before=rpcbind.target
> +
> + [Socket]
> +-ListenStream=/run/rpcbind.sock
> ++ListenStream=/var/run/rpcbind.sock
> +
> + # RPC netconfig can't handle ipv6/ipv4 dual sockets
> + BindIPv6Only=ipv6-only
> diff --git a/rpcbind.service b/rpcbind.service
> deleted file mode 100644
> index fab7898..0000000
> --- a/rpcbind.service
> +++ /dev/null
> @@ -1,13 +0,0 @@
> -[Unit]
> -Description=RPC bind service
> -Requires=rpcbind.socket
> -After=syslog.target network.target
> -
> -[Service]
> -Type=forking
> -EnvironmentFile=-/etc/sysconfig/rpcbind
> -ExecStart=/sbin/rpcbind -w $RPCBIND_OPTIONS
> -
> -[Install]
> -WantedBy=multi-user.target
> -Also=rpcbind.socket
> diff --git a/rpcbind.socket b/rpcbind.socket
> deleted file mode 100644
> index d63c1d9..0000000
> --- a/rpcbind.socket
> +++ /dev/null
> @@ -1,8 +0,0 @@
> -[Unit]
> -Description=RPCbind Server Activation Socket
> -
> -[Socket]
> -ListenStream=/var/run/rpcbind.sock
> -
> -[Install]
> -WantedBy=sockets.target
> ================================================================
> 
> ---- gitweb:
> 
> [5]http://git.pld-linux.org/gitweb.cgi/packages/rpcbind.git/commitdiff/743aa2864
> e361cc9aabb9e1365975d257d2ff599
> 
> _______________________________________________
> pld-cvs-commit mailing list
> [6]pld-cvs-commit at lists.pld-linux.org
> [7]http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit
> 
> References
> 
>    1. mailto:qboosh at pld-linux.org
>    2. http://downloads.sourceforge.net/rpcbind/%
>    3. http://nfsv4.bullopensource.org/doc/tirpc_rpcbind.php
>    4. http://sourceforge.net/projects/rpcbind/
>    5. http://git.pld-linux.org/gitweb.cgi/packages/rpcbind.git/commitdiff/743aa2864e361cc9aabb9e1365975d257d2ff599
>    6. mailto:pld-cvs-commit at lists.pld-linux.org
>    7. http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit
> _______________________________________________
> pld-devel-en mailing list
> pld-devel-en at lists.pld-linux.org
> http://lists.pld-linux.org/mailman/listinfo/pld-devel-en

-- 
Jakub Bogusz    http://qboosh.pl/


More information about the pld-devel-en mailing list