simple daemon.
-/* $OpenBSD: dvmrpd.c,v 1.25 2016/09/02 16:20:34 benno Exp $ */
+/* $OpenBSD: dvmrpd.c,v 1.26 2021/01/19 12:26:38 claudio Exp $ */
/*
* Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org>
size_t len;
conffile = CONF_FILE;
- dvmrpd_process = PROC_MAIN;
- log_procname = log_procnames[dvmrpd_process];
+ log_procname = "parent";
log_init(1); /* log to stderr until daemonized */
log_verbose(1);
-/* $OpenBSD: dvmrpd.h,v 1.23 2021/01/19 11:46:10 claudio Exp $ */
+/* $OpenBSD: dvmrpd.h,v 1.24 2021/01/19 12:26:38 claudio Exp $ */
/*
* Copyright (c) 2004, 2005, 2006 Esben Norby <norby@openbsd.org>
#define MAXVIFS 32 /* XXX */
-static const char * const log_procnames[] = {
- "parent",
- "dvmrpe",
- "rde"
-};
-
struct imsgev {
struct imsgbuf ibuf;
void (*handler)(int, short, void *);
};
/* dvmrp_conf */
-enum {
- PROC_MAIN,
- PROC_DVMRP_ENGINE,
- PROC_RDE_ENGINE
-} dvmrpd_process;
-
struct dvmrpd_conf {
struct event ev;
struct event report_timer;
-/* $OpenBSD: dvmrpe.c,v 1.21 2021/01/19 12:23:30 claudio Exp $ */
+/* $OpenBSD: dvmrpe.c,v 1.22 2021/01/19 12:26:38 claudio Exp $ */
/*
* Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org>
fatal("chdir(\"/\")");
setproctitle("dvmrp engine");
- dvmrpd_process = PROC_DVMRP_ENGINE;
- log_procname = log_procnames[dvmrpd_process];
+ log_procname = "dvmrpe";
if (setgroups(1, &pw->pw_gid) ||
setresgid(pw->pw_gid, pw->pw_gid, pw->pw_gid) ||
-/* $OpenBSD: rde.c,v 1.29 2016/09/02 16:20:34 benno Exp $ */
+/* $OpenBSD: rde.c,v 1.30 2021/01/19 12:26:38 claudio Exp $ */
/*
* Copyright (c) 2004, 2005 Claudio Jeker <claudio@openbsd.org>
fatal("chdir(\"/\")");
setproctitle("route decision engine");
- dvmrpd_process = PROC_RDE_ENGINE;
- log_procname = log_procnames[dvmrpd_process];
+ log_procname = "rde";
if (setgroups(1, &pw->pw_gid) ||
setresgid(pw->pw_gid, pw->pw_gid, pw->pw_gid) ||