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

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