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

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