Package nfs-utils: Added check for OK/FAIL
authoruniverse II <universeii@gmx.de>
Fri, 26 Feb 2016 11:16:13 +0000 (12:16 +0100)
committerPeter Korsgaard <peter@korsgaard.com>
Sun, 3 Jul 2016 14:04:34 +0000 (16:04 +0200)
Removed unconditional 'done' output when starting
and stopping the daemons. Instead check return value
of daemon and print out OK or FAIL.

Signed-off-by: Andreas Ehmanns <universeII@gmx.de>
Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Reviewed-by: Maxime Hadjinlian <maxime.hadjinlian@gmail.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
package/nfs-utils/S60nfs

index 5639b8f7e2e51d99671b2d0e2d5a886d32cc422c..7a49c798007277680fbec0910015ed6ab32ed043 100755 (executable)
@@ -25,20 +25,20 @@ start() {
        # Start daemons.
        printf "Starting NFS statd: "
        rpc.statd
+       [ $? = 0 ] && echo "OK" || echo "FAIL"
        touch /var/lock/subsys/nfslock
-       echo "done"
 
        printf "Starting NFS services: "
        /usr/sbin/exportfs -r
-       echo "done"
+       [ $? = 0 ] && echo "OK" || echo "FAIL"
 
        printf "Starting NFS daemon: "
        rpc.nfsd ${NR_THREADS}
-       echo "done"
+       [ $? = 0 ] && echo "OK" || echo "FAIL"
 
        printf "Starting NFS mountd: "
        rpc.mountd
-       echo "done"
+       [ $? = 0 ] && echo "OK" || echo "FAIL"
        touch /var/lock/subsys/nfs
 }
 
@@ -46,21 +46,21 @@ stop() {
        # Stop daemons.
        printf "Shutting down NFS mountd: "
        killall -q rpc.mountd
-       echo "done"
+       [ $? = 0 ] && echo "OK" || echo "FAIL"
 
        printf "Shutting down NFS daemon: "
        kill -9 `pidof nfsd` 2>/dev/null
-       echo "done"
+       [ $? = 0 ] && echo "OK" || echo "FAIL"
 
        printf "Shutting down NFS services: "
        /usr/sbin/exportfs -au
        rm -f /var/lock/subsys/nfs
        killall -q rpc.statd
-       echo "done"
+       [ $? = 0 ] && echo "OK" || echo "FAIL"
 
        printf "Stopping NFS statd: "
        killall -q rpc.statd
-       echo "done"
+       [ $? = 0 ] && echo "OK" || echo "FAIL"
        rm -f /var/lock/subsys/nfslock
 }