[Pkg-sysvinit-devel] Should 'shutdown -H' halt the system?

Petter Reinholdtsen pere at hungry.com
Sat Nov 12 10:37:08 UTC 2005


[Miquel van Smoorenburg]
> The idea is that -H is a modifier to -h. What should happen is this:
> 
> # shutdown -H now
> shutdown: -H flags needs -h
> shutdown: Usage: ......

Right.  Should shutdown keep running when -H is given without -h?  Is
this patch correct?

Index: src/shutdown.c
===================================================================
--- src/shutdown.c	(revisjon 100)
+++ src/shutdown.c	(arbeidskopi)
@@ -521,6 +521,12 @@
   		}
 	}
 
+	if (NULL != halttype && down_level[0] != '0') {
+		fprintf(stderr, "shutdown: -H and -P flags needs -h.\n");
+		usage();
+  		exit(1);
+	}
+
 	/* Do we need to use the shutdown.allow file ? */
 	if (useacl && (fp = fopen(SDALLOW, "r")) != NULL) {
 



More information about the Pkg-sysvinit-devel mailing list