"%s: Service is already installed.", service_name);
exit(APEXIT_INIT);
}
- else
- {
- /* Install the service */
- rv = mpm_service_install(process->pool, inst_argc, inst_argv, 0);
- if (rv != APR_SUCCESS) {
- exit(rv);
- }
- /* Proceed to post_config in order to test the installed configuration */
- fprintf(stderr,"Testing httpd.conf....\n");
- fprintf(stderr,"Errors reported here must be corrected before the service can be started.\n");
- }
}
else if (running_as_service)
{
"No installed service named \"%s\".", service_name);
exit(APEXIT_INIT);
}
- else if (!strcasecmp(signal_arg, "config"))
- {
+
+ /* Track the args actually entered by the user.
+ * These will be used for the -k install parameters, as well as
+ * for the -k start service override arguments.
+ */
+ inst_argv = (const char * const *)mpm_new_argv->elts
+ + mpm_new_argv->nelts - inst_argc;
+
+ /* Now, do service install or reconfigure then proceed to
+ * post_config to test the installed configuration.
+ */
+ if (!strcasecmp(signal_arg, "config")) { /* -k config */
/* Reconfigure the service */
rv = mpm_service_install(process->pool, inst_argc, inst_argv, 1);
if (rv != APR_SUCCESS) {
exit(rv);
}
- /* Proceed to post_config in order to test the installed configuration */
+
fprintf(stderr,"Testing httpd.conf....\n");
- fprintf(stderr,"Errors reported here must be corrected before the service can be started.\n");
+ fprintf(stderr,"Errors reported here must be corrected before the "
+ "service can be started.\n");
+ }
+ else if (!strcasecmp(signal_arg, "install")) { /* -k install */
+ /* Install the service */
+ rv = mpm_service_install(process->pool, inst_argc, inst_argv, 0);
+ if (rv != APR_SUCCESS) {
+ exit(rv);
+ }
+
+ fprintf(stderr,"Testing httpd.conf....\n");
+ fprintf(stderr,"Errors reported here must be corrected before the "
+ "service can be started.\n");
}
-
- /* Track the args actually entered by the user.
- * These will be used for the -k install parameters, as well as
- * for the -k start service override arguments.
- */
- inst_argv = (const char * const *)mpm_new_argv->elts
- + mpm_new_argv->nelts - inst_argc;
process->argc = mpm_new_argv->nelts;
process->argv = (const char * const *) mpm_new_argv->elts;