[arch-projects] [PATCH] Error on unknown daemon in DAEMONS array

Dan McGee dan at archlinux.org
Mon Jul 18 09:21:44 EDT 2011


We silently skip the starting of unknown entries in DAEMONS rather than
give any sort of feedback to the user.

Signed-off-by: Dan McGee <dan at archlinux.org>
---
 functions |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/functions b/functions
index 1cfcf28..56d1689 100644
--- a/functions
+++ b/functions
@@ -204,7 +204,11 @@ ck_autostart() {
 }
 
 start_daemon() {
-	have_daemon "$1" && /etc/rc.d/"$1" start
+	if [ have_daemon "$1" ]; then
+		/etc/rc.d/"$1" start
+	else
+		printf "${C_FAIL}Warning:${C_CLEAR} Daemon named \'$1\' was not found.\n"
+	fi
 }
 
 # Never use this function, it causes daemons to be stoped in the wrong order.
@@ -218,7 +222,11 @@ ck_depends() {
 
 start_daemon_bkgd() {
 	stat_bkgd "Starting $1"
-	have_daemon "$1" && (start_daemon "$1") &>/dev/null &
+	if [ have_daemon "$1" ]; then
+		(/etc/rc.d/"$1" start) &>/dev/null &
+	else
+		printf "${C_FAIL}Warning:${C_CLEAR} Daemon named \'$1\' was not found.\n"
+	fi
 }
 
 stop_daemon() {
-- 
1.7.6



More information about the arch-projects mailing list