doveadm-master.c revision 7237f2f0a577413e12662228ee2039425fd2f5b0
/* Copyright (c) 2010-2016 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "str.h"
#include "istream.h"
#include "write-full.h"
#include "doveadm.h"
#include <unistd.h>
#include <fcntl.h>
#include <signal.h>
#define MASTER_PID_FILE_NAME "master.pid"
{
char buf[32];
int fd;
bool found;
if (fd == -1) {
return FALSE;
}
if (ret <= 0) {
if (ret == 0)
else
} else {
ret--;
else {
}
}
i_close_fd(&fd);
return found;
}
void doveadm_master_send_signal(int signo)
{
const char *pidfile_path;
unsigned int i;
/* wait for a while for the process to die */
usleep(1000);
for (i = 0; i < 30; i++) {
i_error("kill() failed: %m");
break;
}
usleep(100000);
}
}
}
{
}
{
}
{
const char *path;
if (fd == -1)
const char *str =
}
{
const char *line;
if (argc == 1)
for (int i = 1; i < argc; i++) {
}
alarm(5);
} else if (line[0] == '-') {
} else if (line[0] != '+') {
i_error("Unexpected input from %s: %s",
}
alarm(0);
}
struct doveadm_cmd_ver2 doveadm_cmd_stop_ver2 = {
.name = "stop",
.usage = "",
};
struct doveadm_cmd_ver2 doveadm_cmd_reload_ver2 = {
.old_cmd = cmd_reload,
.name = "reload",
.usage = "",
};
struct doveadm_cmd_ver2 doveadm_cmd_service_stop_ver2 = {
.name = "service stop",
.usage = "<service> [<service> [...]]",
};