1From 0aac3b8ee5b13e289b6969da51de384443286a5b Mon Sep 17 00:00:00 2001 2From: Khem Raj <raj.khem@gmail.com> 3Date: Thu, 31 Dec 2015 14:33:02 -0800 4Subject: [PATCH] Replace echo with printf builtin in nscd init script 5 6The nscd init script calls for #! /bin/bash interpreter 7since it uses bash specific extentions namely (translated strings) 8and echo -n command, replace echo with printf and 9switch the shell interpreter to #!/bin/sh. 10 11Upstream-Status: Pending 12Signed-off-by: Ross Burton <ross.burton@arm.com> 13Signed-off-by: Khem Raj <raj.khem@gmail.com> 14--- 15 nscd/nscd.init | 20 ++++++++++---------- 16 1 file changed, 10 insertions(+), 10 deletions(-) 17 18diff --git a/nscd/nscd.init b/nscd/nscd.init 19index a882da7d8b..857b541381 100644 20--- a/nscd/nscd.init 21+++ b/nscd/nscd.init 22@@ -1,4 +1,4 @@ 23-#!/bin/bash 24+#!/bin/sh 25 # 26 # nscd: Starts the Name Switch Cache Daemon 27 # 28@@ -49,16 +49,16 @@ prog=nscd 29 start () { 30 [ -d /var/run/nscd ] || mkdir /var/run/nscd 31 [ -d /var/db/nscd ] || mkdir /var/db/nscd 32- echo -n $"Starting $prog: " 33+ printf "Starting $prog: " 34 daemon /usr/sbin/nscd 35 RETVAL=$? 36- echo 37+ printf "\n" 38 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/nscd 39 return $RETVAL 40 } 41 42 stop () { 43- echo -n $"Stopping $prog: " 44+ printf "Stopping $prog: " 45 /usr/sbin/nscd -K 46 RETVAL=$? 47 if [ $RETVAL -eq 0 ]; then 48@@ -67,11 +67,11 @@ stop () { 49 # a non-privileged user 50 rm -f /var/run/nscd/nscd.pid 51 rm -f /var/run/nscd/socket 52- success $"$prog shutdown" 53+ success "$prog shutdown" 54 else 55- failure $"$prog shutdown" 56+ failure "$prog shutdown" 57 fi 58- echo 59+ printf "\n" 60 return $RETVAL 61 } 62 63@@ -103,13 +103,13 @@ case "$1" in 64 RETVAL=$? 65 ;; 66 force-reload | reload) 67- echo -n $"Reloading $prog: " 68+ printf "Reloading $prog: " 69 killproc /usr/sbin/nscd -HUP 70 RETVAL=$? 71- echo 72+ printf "\n" 73 ;; 74 *) 75- echo $"Usage: $0 {start|stop|status|restart|reload|condrestart}" 76+ printf "Usage: $0 {start|stop|status|restart|reload|condrestart}\n" 77 RETVAL=1 78 ;; 79 esac 80