fcoeplumb reads the /etc/fcoe/config file to determine if it
should use 'echo' or syslogd for logging. However, it was only
ever using echo.

This patch removes the config file reading and only uses 'echo'.
If we need to add syslog support we can do that later.

Signed-off-by: Robert Love <[email protected]>
---

 fcoemon.c    |    8 ++++++--
 fcoeplumb.in |   16 +++++-----------
 2 files changed, 11 insertions(+), 13 deletions(-)

diff --git a/fcoemon.c b/fcoemon.c
index 2bf2335..6e38049 100644
--- a/fcoemon.c
+++ b/fcoemon.c
@@ -1743,7 +1743,7 @@ ignore_event:
 static void
 fcm_dcbd_setup(struct fcm_fcoe *ff, enum fcoeadm_action action)
 {
-       char *op;
+       char *op, *debug, *syslog;
        char *qos_arg;
        char qos[64];
        u_int32_t mask;
@@ -1803,8 +1803,12 @@ fcm_dcbd_setup(struct fcm_fcoe *ff, enum fcoeadm_action 
action)
                                        fcm_dcbd_cmd, ff->ff_name, op,
                                        qos_arg, qos);
 
+               if (fcm_use_syslog)
+                       syslog = "--syslog";
+
                execlp(fcm_dcbd_cmd, fcm_dcbd_cmd, ff->ff_name,
-                      op, qos_arg, qos, (char *)NULL);
+                      op, qos_arg, qos, syslog, (char *)NULL);
+
                FCM_LOG_ERR(errno, "exec '%s' failed", fcm_dcbd_cmd);
                exit(1);
        }
diff --git a/fcoeplumb.in b/fcoeplumb.in
index 69707c3..d3f6c53 100755
--- a/fcoeplumb.in
+++ b/fcoeplumb.in
@@ -22,7 +22,7 @@ cmdname=`basename $0`
 usage()
 {
        echo usage: $cmdname \
-               '<ethX> [--reset | --enable | --disable] [--debug]' \
+               '<ethX> [--reset | --enable | --disable] [--debug] [--syslog]' \
                '[--qos <pri>[,<pri>]...]]' >&2
        exit 1
 }
@@ -50,17 +50,9 @@ sysconfd...@sysconfdir@
 # make sure there's a sane path to find basic commands and system tools (tc)
 PATH=$PATH:/sbin:/usr/sbin:/bin:/usr/bin
 FCOEADM=${sbindir}/fcoeadm     # command to create/destroy FCoE instances
-LOGGER="logger -s -t fcoeplumb"
 CONFIG_DIR=${sysconfdir}/fcoe
 DEBUG_LOGGING=
-
-. $CONFIG_DIR/config
-if [ "$USE_SYSLOG" != "YES" ]; then
-       LOGGER="echo"
-else
-       USE_SYSLOG="yes"
-fi
-
+LOGGER="echo"
 
 find_multiq_qdisc()
 {
@@ -251,7 +243,9 @@ do
                ;;
        --debug)
                DEBUG_LOGGING=1
-               LOGGER="logger -t fcoeplumb -s"
+               ;;
+        --syslog)
+               LOGGER="logger -s -t fcoeplumb"
                ;;
        --qos | -q)
                [ "$#" -lt 2 ] && usage

_______________________________________________
devel mailing list
[email protected]
http://www.open-fcoe.org/mailman/listinfo/devel

Reply via email to