Commit Diff


commit - e1e04caa4f847162936a6908d3bc02a3dbdfac6d
commit + 0ac785a6fa007acdc8ecb4f697981c574ab1b710
blob - 909444b4e3654bbe28fee801345db97287ba5e2b
blob + 3d6c516a2ec48ced96f74b8d55ac85c4551d4582
--- ChangeLog
+++ ChangeLog
@@ -1,10 +1,6 @@
 2022-09-10  Omar Polo  <op@omarpolo.com>
 
 	* parse.y (string): retire the deprecated `mime' and `map' config options
-
-2022-09-08  Omar Polo  <op@omarpolo.com>
-
-	* gmid.c (main): change the flags to be consisent with other OpenBSD daemons
 
 2022-09-07  Omar Polo  <op@omarpolo.com>
 
blob - ce216f97c97bb85ccccf9af6c4d280428f2e48fe
blob + 3090f38922fbd70adce47469c361d69764a00f7d
--- contrib/gmid.service
+++ contrib/gmid.service
@@ -8,7 +8,7 @@ Wants=network-online.target
 Type=simple
 User=gmid
 Group=nobody
-ExecStart=/usr/local/bin/gmid -d -f /etc/gmid.conf
+ExecStart=/usr/local/bin/gmid -f -c /etc/gmid.conf
 ExecStop=/bin/kill -TERM $MAINPID
 ExecReload=/bin/kill -HUP $MAINPID
 Restart=on-failure
blob - 91cbbbc7d2c808bc1fa9a6a57a518c7e22f9e288
blob + f1581ce87ac48875c3afa110ac2757d7e4bc2b16
--- gmid.8
+++ gmid.8
@@ -20,9 +20,9 @@
 .Sh SYNOPSIS
 .Nm
 .Bk -words
-.Op Fl dhnVv
+.Op Fl fhnVv
+.Op Fl c Ar config
 .Op Fl D Ar macro Ns = Ns Ar value
-.Op Fl f Ar config
 .Op Fl P Ar pidfile
 .Ek
 .Sh DESCRIPTION
@@ -38,6 +38,10 @@ rereads the configuration file when it receives
 .Pp
 The options are as follows:
 .Bl -tag -width 14m
+.It Fl c Ar config
+Specifies the configuration file.
+The default is
+.Pa /etc/gmid.conf .
 .It Fl D Ar macro Ns = Ns Ar value
 Define
 .Ar macro
@@ -47,13 +51,8 @@ on the command line.
 Overrides the definition of
 .Ar macro
 in the config file if present.
-.It Fl d
-Debug mode.
-Do not daemonize and log to stderr.
-.It Fl f Ar config
-Specifies the configuration file.
-The default is
-.Pa /etc/gmid.conf .
+.It Fl f
+Stays and logs on the foreground.
 .It Fl h , Fl -help
 Print the usage and exit.
 .It Fl n
blob - c7f3ed30ad9bd89825f289194b305268e8c706b2
blob + 82a42cae8e2132bd67b4a1fcf29c9d9d91a6ecb6
--- gmid.c
+++ gmid.c
@@ -30,7 +30,7 @@
 
 #include "log.h"
 
-static const char	*opts = "D:df:hnP:Vv";
+static const char	*opts = "c:D:fhnP:Vv";
 
 static const struct option longopts[] = {
 	{"help",	no_argument,		NULL,	'h'},
@@ -288,7 +288,7 @@ usage(void)
 {
 	fprintf(stderr,
 	    "Version: " GMID_STRING "\n"
-	    "Usage: %s [-dhnVv] [-D macro=value] [-f config] [-P pidfile]\n",
+	    "Usage: %s [-fnv] [-c config] [-D macro=value] [-P pidfile]\n",
 	    getprogname());
 }
 
@@ -385,17 +385,17 @@ main(int argc, char **argv)
 
 	while ((ch = getopt_long(argc, argv, opts, longopts, NULL)) != -1) {
 		switch (ch) {
+		case 'c':
+			config_path = absolutify_path(optarg);
+			break;
 		case 'D':
 			if (cmdline_symset(optarg) == -1)
 				fatalx("could not parse macro definition: %s",
 				    optarg);
 			break;
-		case 'd':
+		case 'f':
 			conf.foreground = 1;
 			break;
-		case 'f':
-			config_path = absolutify_path(optarg);
-			break;
 		case 'h':
 			usage();
 			return 0;
blob - 668ef2816d519b2cd8b16e088ec74f9ea853401d
blob + b4a693451274ebff51b056d1bfc5cac4b1ab3866
--- regress/lib.sh
+++ regress/lib.sh
@@ -93,8 +93,8 @@ EOF
 }
 
 checkconf() {
-	if ! $gmid -n -f reg.conf >/dev/null 2>&1; then
-		$gmid -n -f reg.conf
+	if ! $gmid -n -c reg.conf >/dev/null 2>&1; then
+		$gmid -n -c reg.conf
 	fi
 }
 
@@ -159,7 +159,7 @@ run() {
 		return
 	fi
 
-	$gmid -P gmid.pid -f reg.conf
+	$gmid -P gmid.pid -c reg.conf
 
 	# give gmid time to bind the port, otherwise we end up
 	# executing gg when gmid isn't ready yet.