Bug#939153: nfs-utils: Fix LSB init output
Source: nfs-utils
Source-Version: 1:1.3.4-2.5
Severity: wishlist
Tags: patch
Hi!
The attached patch fixes the LSB init script to have more consistent
output.
Thanks,
Guillem
From b6e07cae38198643828a4e4008eda6edd25d9be0 Mon Sep 17 00:00:00 2001
From: Guillem Jover <guillem@debian.org>
Date: Sun, 1 Sep 2019 00:07:45 +0200
Subject: [PATCH] Fix LSB init script output
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
For the exporting/unexporting action use log_action_*_msg instead
of log_*_msg, so that we switch from this output:
start → Exporting directories for NFS kernel daemon....
stop → Unexporting directories for NFS kernel daemon....
to:
start → Exporting directories for NFS kernel daemon...done.
stop → Unexporting directories for NFS kernel daemon...done.
which is confusing, given that there are three dots for the initial
action plus the final dot for completion.
Remove trailing dot from log_warning_msg calls, to switch from stuff
like:
Not starting NFS kernel daemon: no exports. ... (warning).
to:
Not starting NFS kernel daemon: no exports ... (warning).
where the trailing dot is not misplaced anymore.
Use status_of_proc instead of an ad-hoc implementation.
---
debian/nfs-kernel-server.init | 26 ++++++++++----------------
1 file changed, 10 insertions(+), 16 deletions(-)
diff --git a/debian/nfs-kernel-server.init b/debian/nfs-kernel-server.init
index e0c51d6..88ee869 100644
--- a/debian/nfs-kernel-server.init
+++ b/debian/nfs-kernel-server.init
@@ -72,19 +72,19 @@ case "$1" in
# See if our running kernel supports the NFS kernel server
if ! grep -E -qs "[[:space:]]nfsd\$" /proc/filesystems; then
- log_warning_msg "Not starting $DESC: no support in current kernel."
+ log_warning_msg "Not starting $DESC: no support in current kernel"
exit 0
fi
do_mount nfsd $PROCNFSD_MOUNTPOINT || NEED_SVCGSSD=no
- log_begin_msg "Exporting directories for $DESC..."
+ log_action_begin_msg "Exporting directories for $DESC"
$PREFIX/sbin/exportfs -r
RET=$?
if [ $RET != 0 ]; then
- log_end_msg $RET
+ log_action_end_msg $RET
exit $RET
fi
- log_end_msg 0
+ log_action_end_msg 0
log_daemon_msg "Starting $DESC"
log_progress_msg "nfsd"
@@ -142,7 +142,7 @@ case "$1" in
log_end_msg 0
else
- log_warning_msg "Not starting $DESC: no exports."
+ log_warning_msg "Not starting $DESC: no exports"
fi
;;
@@ -180,14 +180,14 @@ case "$1" in
log_end_msg 0
- log_begin_msg "Unexporting directories for $DESC..."
+ log_action_begin_msg "Unexporting directories for $DESC"
$PREFIX/sbin/exportfs -au
RET=$?
if [ $RET != 0 ]; then
- log_end_msg $RET
+ log_action_end_msg $RET
exit $RET
fi
- log_end_msg 0
+ log_action_end_msg 0
if mountpoint -q $PROCNFSD_MOUNTPOINT
then
@@ -196,14 +196,8 @@ case "$1" in
;;
status)
- if pidof nfsd >/dev/null
- then
- echo "nfsd running"
- exit 0
- else
- echo "nfsd not running"
- exit 3
- fi
+ status_of_proc nfsd nfsd
+ exit $?
;;
reload | force-reload)
--
2.23.0.187.g17f5b7556c
Reply to: