/* WARNING: There is an implict assumption here that the
* executable resides in the ServerRoot!
*/
- ap_log_error(APLOG_MARK,APLOG_ERR, GetLastError(), NULL,
+ rv = GetLastError();
+ ap_log_error(APLOG_MARK,APLOG_ERR, rv, NULL,
"Failed to get the running module's file name");
exit(1);
}
rv = mpm_merge_service_args(process->pool, mpm_new_argv,
fixed_args);
if (rv != APR_SUCCESS) {
- ap_log_error(APLOG_MARK,APLOG_ERR, rv, server_conf,
+ ap_log_error(APLOG_MARK,APLOG_ERR, rv, NULL,
"%s: ConfigArgs are missing from the registry.",
display_name);
}
}
else
{
- ap_log_error(APLOG_MARK,APLOG_ERR, APR_BADARG, server_conf,
+ ap_log_error(APLOG_MARK,APLOG_ERR, APR_BADARG, NULL,
"%s: No installed service by that name.", display_name);
exit(1);
}
{
if (service_named == APR_SUCCESS)
{
- ap_log_error(APLOG_MARK,APLOG_ERR, APR_BADARG, server_conf,
+ ap_log_error(APLOG_MARK,APLOG_ERR, APR_BADARG, NULL,
"%s: Service is already installed.", display_name);
exit(1);
}
if (!strcasecmp(signal_arg, "runservice")
&& (osver.dwPlatformId == VER_PLATFORM_WIN32_NT)
&& (service_to_start_success != APR_SUCCESS)) {
- ap_log_error(APLOG_MARK,APLOG_ERR, service_to_start_success,
- server_conf, "%s: Unable to start the service manager.",
+ ap_log_error(APLOG_MARK,APLOG_ERR, service_to_start_success, NULL,
+ "%s: Unable to start the service manager.",
display_name);
exit(1);
}
*/
if (!strcasecmp(signal_arg, "install")) {
- mpm_service_install(ptemp, inst_argc, inst_argv);
- exit(rv);
+ rv = mpm_service_install(ptemp, inst_argc, inst_argv);
+ exit (rv);
}
if (!strcasecmp(signal_arg, "start")) {
rv = mpm_service_start(ptemp, inst_argc, inst_argv);
- exit(rv);
+ exit (rv);
}
if (!strcasecmp(signal_arg, "restart")) {
mpm_signal_service(ptemp, ap_pid_fname, 1);
- exit(0);
+ exit (rv);
}
// TODO: This Stinks - but we needed the ap_pid_fname entry from
const char *pidfile = ap_server_root_relative (pconf, ap_pid_fname);
if (pidfile != NULL && unlink(pidfile) == 0) {
- ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_INFO,APR_SUCCESS,
+ ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_INFO, APR_SUCCESS,
server_conf, "removed PID file %s (pid=%ld)",
pidfile, GetCurrentProcessId());
}
if(!(globdat.hServiceStatus = RegisterServiceCtrlHandler(argv[0], service_nt_ctrl)))
{
ap_log_error(APLOG_MARK, APLOG_ERR, GetLastError(), NULL,
- "Failure registering service handler");
+ "Failure registering service handler");
+ PulseEvent(globdat.signal_monitor);
return;
}
rv = GetLastError();
ap_log_error(APLOG_MARK, APLOG_ERR, rv, NULL,
"Error starting service control dispatcher");
- };
+ }
+
globdat.service_thread = 0;
return (rv);
}
if (!schService)
{
- ap_log_error(APLOG_MARK, APLOG_ERR, GetLastError(), NULL,
+ rv = GetLastError();
+ ap_log_error(APLOG_MARK, APLOG_ERR, rv, NULL,
"Failed to create WinNT Service Profile");
CloseServiceHandle(schSCManager);
return (rv);
/* we blast Services/us, not just the Services/us/Parameters branch */
ap_snprintf(key_name, sizeof(key_name), SERVICECONFIG, service_name);
- if (ap_registry_delete_key(key_name)) {
+ if (ap_registry_delete_key(key_name))
+ {
+ rv = GetLastError();
ap_log_error(APLOG_MARK, APLOG_ERR, rv, NULL,
"%s: Failed to remove the service config from the "
"registry.", display_name);
}
if (!readpid)
{
- ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL,
+ ap_log_error(APLOG_MARK, APLOG_ERR, 0, NULL,
"%s: could not retrieve pid from file %s",
display_name, pid_file);
return;
}
else
{
- ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL,
+ ap_log_error(APLOG_MARK, APLOG_ERR, 0, NULL,
"%s: could not retrieve pid from file %s",
display_name, pid_file);
return;