Blame SOURCES/0001-Revert-fcoemon-Correctly-handle-options-in-the-servi.patch

bf9e84
From 729135eea0ed39b3dfd57b7ea15f284e67af532f Mon Sep 17 00:00:00 2001
bf9e84
From: Chris Leech <cleech@redhat.com>
bf9e84
Date: Mon, 18 Jan 2021 13:37:39 -0800
bf9e84
Subject: [PATCH 1/1] Revert "fcoemon: Correctly handle options in the service
bf9e84
 file"
bf9e84
bf9e84
This reverts commit b06c3df0f0b06c1ad37b3bbf8bd602b24318aae6.
bf9e84
---
bf9e84
 doc/fcoemon.txt          |  6 +++---
bf9e84
 etc/systemd/fcoe.service |  4 ++--
bf9e84
 fcoemon.c                | 24 +++++++++---------------
bf9e84
 3 files changed, 14 insertions(+), 20 deletions(-)
bf9e84
bf9e84
diff --git a/doc/fcoemon.txt b/doc/fcoemon.txt
bf9e84
index ba70478d141..3bfb3581a1b 100644
bf9e84
--- a/doc/fcoemon.txt
bf9e84
+++ b/doc/fcoemon.txt
bf9e84
@@ -53,13 +53,13 @@ OPTIONS
bf9e84
 -------
bf9e84
 *-f*, *--foreground*::
bf9e84
 	Run *fcoemon* in the foreground.
bf9e84
-*-d*, *--debug=yes|no*::
bf9e84
-	Enable or disable debugging messages.
bf9e84
+*-d*, *--debug*::
bf9e84
+	Enable debugging messages.
bf9e84
 *-l*, *--legacy*::
bf9e84
 	Force fcoemon to use the legacy /sys/module/libfcoe/parameters/
bf9e84
 	interface. The default is to use the newer /sys/bus/fcoe/ interfaces
bf9e84
 	if they are available.
bf9e84
-*-s*, *--syslog=yes|no*::
bf9e84
+*-s*, *--syslog*::
bf9e84
 	Use syslogd for logging. The default behavior is to log to stdout
bf9e84
 	and stderr.
bf9e84
 *-h*, *--help*::
bf9e84
diff --git a/etc/systemd/fcoe.service b/etc/systemd/fcoe.service
bf9e84
index b1d95671573..5e5c8a2b67b 100644
bf9e84
--- a/etc/systemd/fcoe.service
bf9e84
+++ b/etc/systemd/fcoe.service
bf9e84
@@ -4,9 +4,9 @@ After=syslog.target network.target
bf9e84
 
bf9e84
 [Service]
bf9e84
 Type=simple
bf9e84
-EnvironmentFile=/etc/fcoe/config
bf9e84
+EnvironmentFile=/etc/sysconfig/fcoe
bf9e84
 ExecStartPre=/sbin/modprobe -qa $SUPPORTED_DRIVERS
bf9e84
-ExecStart=/usr/sbin/fcoemon --foreground --debug=$DEBUG --syslog=$SYSLOG
bf9e84
+ExecStart=/usr/sbin/fcoemon $FCOEMON_OPTS
bf9e84
 
bf9e84
 [Install]
bf9e84
 WantedBy=multi-user.target
bf9e84
diff --git a/fcoemon.c b/fcoemon.c
bf9e84
index 8c08bc5a032..0cc36fec304 100644
bf9e84
--- a/fcoemon.c
bf9e84
+++ b/fcoemon.c
bf9e84
@@ -335,9 +335,9 @@ static int fcoe_vid_from_ifname(const char *ifname);
bf9e84
  * Table for getopt_long(3).
bf9e84
  */
bf9e84
 static struct option fcm_options[] = {
bf9e84
-	{"debug", 1, NULL, 'd'},
bf9e84
+	{"debug", 0, NULL, 'd'},
bf9e84
 	{"legacy", 0, NULL, 'l'},
bf9e84
-	{"syslog", 1, NULL, 's'},
bf9e84
+	{"syslog", 0, NULL, 's'},
bf9e84
 	{"exec", 1, NULL, 'e'},
bf9e84
 	{"foreground", 0, NULL, 'f'},
bf9e84
 	{"version", 0, NULL, 'v'},
bf9e84
@@ -3271,9 +3271,9 @@ static void fcm_usage(void)
bf9e84
 {
bf9e84
 	printf("Usage: %s\n"
bf9e84
 	       "\t [-f|--foreground]\n"
bf9e84
-	       "\t [-d|--debug=yes|no]\n"
bf9e84
+	       "\t [-d|--debug]\n"
bf9e84
 	       "\t [-l|--legacy]\n"
bf9e84
-	       "\t [-s|--syslog=yes|no]\n"
bf9e84
+	       "\t [-s|--syslog]\n"
bf9e84
 	       "\t [-v|--version]\n"
bf9e84
 	       "\t [-h|--help]\n\n", progname);
bf9e84
 	exit(1);
bf9e84
@@ -3729,28 +3729,22 @@ int main(int argc, char **argv)
bf9e84
 	sa_log_flags = 0;
bf9e84
 	openlog(sa_log_prefix, LOG_CONS, LOG_DAEMON);
bf9e84
 
bf9e84
-	while ((c = getopt_long(argc, argv, "fd:hls:v",
bf9e84
+	while ((c = getopt_long(argc, argv, "fdhlsv",
bf9e84
 				fcm_options, NULL)) != -1) {
bf9e84
 		switch (c) {
bf9e84
 		case 'f':
bf9e84
 			fcm_fg = 1;
bf9e84
 			break;
bf9e84
 		case 'd':
bf9e84
-			if (!strncmp(optarg, "yes", 3) ||
bf9e84
-			    !strncmp(optarg, "YES", 3)) {
bf9e84
-				fcoe_config.debug = 1;
bf9e84
-				enable_debug_log(1);
bf9e84
-			}
bf9e84
+			fcoe_config.debug = 1;
bf9e84
+			enable_debug_log(1);
bf9e84
 			break;
bf9e84
 		case 'l':
bf9e84
 			force_legacy = true;
bf9e84
 			break;
bf9e84
 		case 's':
bf9e84
-			if (!strncmp(optarg, "yes", 3) ||
bf9e84
-			    !strncmp(optarg, "YES", 3)) {
bf9e84
-				fcoe_config.use_syslog = 1;
bf9e84
-				enable_syslog(1);
bf9e84
-			}
bf9e84
+			fcoe_config.use_syslog = 1;
bf9e84
+			enable_syslog(1);
bf9e84
 			break;
bf9e84
 		case 'v':
bf9e84
 			printf("%s\n", FCOE_UTILS_VERSION);
bf9e84
-- 
bf9e84
2.26.2
bf9e84