Ejemplo n.º 1
0
void service_restart(struct service *svc)
{
    if (svc->flags & SVC_RUNNING) {
        /* Stop, wait, then start the service. */
        service_stop_or_reset(svc, SVC_RESTART);
    } else if (!(svc->flags & SVC_RESTARTING)) {
        /* Just start the service since it's not running. */
        service_start(svc, NULL);
    } /* else: Service is restarting anyways. */
}
void service_stop(struct service *svc)
{
    service_stop_or_reset(svc, SVC_DISABLED);
}
void service_reset(struct service *svc)
{
    service_stop_or_reset(svc, SVC_RESET);
}