New subcommand: configtest.
authorAndre Noll <maan@tuebingen.mpg.de>
Sun, 15 Oct 2017 13:03:08 +0000 (15:03 +0200)
committerAndre Noll <maan@tuebingen.mpg.de>
Sat, 28 Oct 2017 09:26:31 +0000 (11:26 +0200)
Similar to the identically named subcommand of apache2ctl. This is
trivial to implement because we only need to describe the subcommand
in dss.suite and create a command handler which prints an OK message
and returns success. If the config file contains errors, we abort
earlier anyway.

dss.c
dss.suite

diff --git a/dss.c b/dss.c
index 3e626ab0113b1890277da115ea6c735dbdb690d7..e0b38a4d8bc2ed9f692878420424d8b680447c7c 100644 (file)
--- a/dss.c
+++ b/dss.c
@@ -1696,6 +1696,13 @@ static int com_ls(void)
 }
 EXPORT_CMD_HANDLER(ls);
 
+static int com_configtest(void)
+{
+       printf("Syntax Ok\n");
+       return 0;
+}
+EXPORT_CMD_HANDLER(configtest);
+
 static int setup_signal_handling(void)
 {
        int ret;
index e69cc28630c8a39359cba3aead33ab3b847011a8..394d7839347a9b312daf28568738051c3d9e795e 100644 (file)
--- a/dss.suite
+++ b/dss.suite
@@ -475,6 +475,14 @@ caption = Subcommands
 
                        Sending SIGHUP causes the running dss process to reload its config file.
                [/help]
+[subcommand configtest]
+       purpose = run a configuration file syntax test
+       [description]
+               This command checks the command line options and the configuration
+               file for syntactic correctness. It either reports "Syntax Ok" and
+               exits successfully or prints information about the first syntax error
+               detected and terminates with exit code 1.
+       [/description]
 
 [section copyright]
        Written by Andre Noll