Index: ospfd.c
===================================================================
RCS file: /open/anoncvs/cvs/src/usr.sbin/ospfd/ospfd.c,v
retrieving revision 1.78
diff -u -r1.78 ospfd.c
--- ospfd.c     20 Aug 2011 11:16:09 -0000      1.78
+++ ospfd.c     1 Mar 2013 12:58:25 -0000
@@ -209,6 +209,11 @@
                        print_config(ospfd_conf);
                else
                        fprintf(stderr, "configuration OK\n");
+               if (parse_config(conffile, opts & ~OSPFD_OPT_NOACTION) == NULL)
+                 {
+                   kr_shutdown();
+                   exit(1);
+                 }
                kr_shutdown();
                exit(0);
        }

With this, it will complain the same as if you actually start the
daemon, and exit(1) if there is a show-stopper error when you test the
config with -n so you can act on the exit code.
sthen@ seemed to prefer rc.d/ospfd to act like netstart and
chown/chmod the config file into submission, which may be another
alternative.


-- 
May the most significant bit of your life be positive.

Reply via email to