/* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
#include <stdint.h>
#include <ap_config.h>
#include "ap_mpm.h"
#include <http_core.h>
#include <httpd.h>
#include <http_log.h>
#include <apr_version.h>
#include <apr_pools.h>
#include <apr_strings.h>
#include "unixd.h"
#include "scoreboard.h"
#include "mpm_common.h"
#include "systemd/sd-daemon.h"
#include <unistd.h>
#endif
static int shutdown_timer = 0;
static int shutdown_counter = 0;
static unsigned long bytes_served;
{
int rv;
ap_extended_status = 1;
"STATUS=Processing requests...\n"
if (rv < 0) {
"sd_notifyf returned an error %d", rv);
}
return OK;
}
{
int rv;
/* up_time in seconds */
if (rv < 0) {
"sd_notifyf returned an error %d", rv);
}
/* Shutdown httpd when nothing is sent for shutdown_timer seconds. */
/* mpm_common.c: INTERVAL_OF_WRITABLE_PROBES is 10 */
shutdown_counter += 10;
"STATUS=Stopped as result of IdleShutdown "
"timeout.");
if (rv < 0) {
"sd_notifyf returned an error %d", rv);
}
}
}
else {
shutdown_counter = 0;
}
return DECLINED;
}
{
/* We know the PID in this hook ... */
/* Used to update httpd's status line using sd_notifyf */
}
const char *arg)
{
return err;
}
return NULL;
}
{
"Number of seconds in idle-state after which httpd is shutdown"),
{NULL}
};
NULL,
NULL,
NULL,
NULL,
};