diff options
author | Eric Faurot <eric@cvs.openbsd.org> | 2016-09-04 09:33:50 +0000 |
---|---|---|
committer | Eric Faurot <eric@cvs.openbsd.org> | 2016-09-04 09:33:50 +0000 |
commit | 4d9e32ac302ab5c483fef4329bf679b3205660c9 (patch) | |
tree | 28f70ded5bcbdba8597e6bffae76e9b16d0d3633 /usr.sbin/smtpd | |
parent | 453a09da973208a1fb7eec249b4d31fa3702eb69 (diff) |
Remove the "smtpctl stop" command.
The daemon is stopped with kill(1).
ok gilles@
Diffstat (limited to 'usr.sbin/smtpd')
-rw-r--r-- | usr.sbin/smtpd/control.c | 20 | ||||
-rw-r--r-- | usr.sbin/smtpd/smtpctl.8 | 6 | ||||
-rw-r--r-- | usr.sbin/smtpd/smtpctl.c | 10 | ||||
-rw-r--r-- | usr.sbin/smtpd/smtpd.c | 7 | ||||
-rw-r--r-- | usr.sbin/smtpd/smtpd.h | 7 |
5 files changed, 9 insertions, 41 deletions
diff --git a/usr.sbin/smtpd/control.c b/usr.sbin/smtpd/control.c index c8f02479e37..d34b4ea0767 100644 --- a/usr.sbin/smtpd/control.c +++ b/usr.sbin/smtpd/control.c @@ -1,4 +1,4 @@ -/* $OpenBSD: control.c,v 1.114 2016/09/01 10:54:25 eric Exp $ */ +/* $OpenBSD: control.c,v 1.115 2016/09/04 09:33:49 eric Exp $ */ /* * Copyright (c) 2012 Gilles Chehade <gilles@poolp.org> @@ -485,7 +485,7 @@ control_dispatch_ext(struct mproc *p, struct imsg *imsg) switch (imsg->hdr.type) { case IMSG_CTL_SMTP_SESSION: - if (env->sc_flags & (SMTPD_SMTP_PAUSED | SMTPD_EXITING)) { + if (env->sc_flags & SMTPD_SMTP_PAUSED) { m_compose(p, IMSG_CTL_FAIL, 0, 0, -1, NULL, 0); return; } @@ -513,22 +513,6 @@ control_dispatch_ext(struct mproc *p, struct imsg *imsg) m_compose(p, IMSG_CTL_GET_STATS, 0, 0, -1, kvp, sizeof *kvp); return; - case IMSG_CTL_SHUTDOWN: - /* NEEDS_FIX */ - log_debug("debug: received shutdown request"); - - if (c->euid) - goto badcred; - - if (env->sc_flags & SMTPD_EXITING) { - m_compose(p, IMSG_CTL_FAIL, 0, 0, -1, NULL, 0); - return; - } - env->sc_flags |= SMTPD_EXITING; - m_compose(p, IMSG_CTL_OK, 0, 0, -1, NULL, 0); - m_compose(p_parent, IMSG_CTL_SHUTDOWN, 0, 0, -1, NULL, 0); - return; - case IMSG_CTL_VERBOSE: if (c->euid) goto badcred; diff --git a/usr.sbin/smtpd/smtpctl.8 b/usr.sbin/smtpd/smtpctl.8 index 42a599ae5ac..610011b7b5d 100644 --- a/usr.sbin/smtpd/smtpctl.8 +++ b/usr.sbin/smtpd/smtpctl.8 @@ -1,4 +1,4 @@ -.\" $OpenBSD: smtpctl.8,v 1.57 2016/06/14 22:40:48 millert Exp $ +.\" $OpenBSD: smtpctl.8,v 1.58 2016/09/04 09:33:49 eric Exp $ .\" .\" Copyright (c) 2006 Pierre-Yves Ritschard <pyr@openbsd.org> .\" Copyright (c) 2012 Gilles Chehade <gilles@poolp.org> @@ -15,7 +15,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: June 14 2016 $ +.Dd $Mdocdate: September 4 2016 $ .Dt SMTPCTL 8 .Os .Sh NAME @@ -245,8 +245,6 @@ Displays runtime statistics concerning .Xr smtpd 8 . .It Cm show status Shows if MTA, MDA and SMTP systems are currently running or paused. -.It Cm stop -Stop the server. .It Cm trace Ar subsystem Enables real-time tracing of .Ar subsystem . diff --git a/usr.sbin/smtpd/smtpctl.c b/usr.sbin/smtpd/smtpctl.c index 5febe339e4a..526b128bf8f 100644 --- a/usr.sbin/smtpd/smtpctl.c +++ b/usr.sbin/smtpd/smtpctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: smtpctl.c,v 1.150 2016/09/03 16:06:26 eric Exp $ */ +/* $OpenBSD: smtpctl.c,v 1.151 2016/09/04 09:33:49 eric Exp $ */ /* * Copyright (c) 2013 Eric Faurot <eric@openbsd.org> @@ -864,13 +864,6 @@ do_show_status(int argc, struct parameter *argv) } static int -do_stop(int argc, struct parameter *argv) -{ - srv_send(IMSG_CTL_SHUTDOWN, NULL, 0); - return srv_check_result(1); -} - -static int do_trace(int argc, struct parameter *argv) { int v; @@ -1080,7 +1073,6 @@ main(int argc, char **argv) cmd_install("show routes", do_show_routes); cmd_install("show stats", do_show_stats); cmd_install("show status", do_show_status); - cmd_install("stop", do_stop); cmd_install("trace <str>", do_trace); cmd_install("uncorrupt <msgid>", do_uncorrupt); cmd_install("unprofile <str>", do_unprofile); diff --git a/usr.sbin/smtpd/smtpd.c b/usr.sbin/smtpd/smtpd.c index 013915e987f..35f168135dc 100644 --- a/usr.sbin/smtpd/smtpd.c +++ b/usr.sbin/smtpd/smtpd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: smtpd.c,v 1.282 2016/09/01 10:54:25 eric Exp $ */ +/* $OpenBSD: smtpd.c,v 1.283 2016/09/04 09:33:49 eric Exp $ */ /* * Copyright (c) 2008 Gilles Chehade <gilles@poolp.org> @@ -257,10 +257,6 @@ parent_imsg(struct mproc *p, struct imsg *imsg) m_end(&m); profiling = v; return; - - case IMSG_CTL_SHUTDOWN: - parent_shutdown(0); - return; } } @@ -1752,7 +1748,6 @@ imsg_to_str(int type) CASE(IMSG_CTL_REMOVE); CASE(IMSG_CTL_SCHEDULE); CASE(IMSG_CTL_SHOW_STATUS); - CASE(IMSG_CTL_SHUTDOWN); CASE(IMSG_CTL_TRACE_DISABLE); CASE(IMSG_CTL_TRACE_ENABLE); CASE(IMSG_CTL_UPDATE_TABLE); diff --git a/usr.sbin/smtpd/smtpd.h b/usr.sbin/smtpd/smtpd.h index 0b6d3c5f371..10083bc3a33 100644 --- a/usr.sbin/smtpd/smtpd.h +++ b/usr.sbin/smtpd/smtpd.h @@ -1,4 +1,4 @@ -/* $OpenBSD: smtpd.h,v 1.522 2016/09/03 16:06:26 eric Exp $ */ +/* $OpenBSD: smtpd.h,v 1.523 2016/09/04 09:33:49 eric Exp $ */ /* * Copyright (c) 2008 Gilles Chehade <gilles@poolp.org> @@ -161,7 +161,7 @@ union lookup { * Bump IMSG_VERSION whenever a change is made to enum imsg_type. * This will ensure that we can never use a wrong version of smtpctl with smtpd. */ -#define IMSG_VERSION 15 +#define IMSG_VERSION 16 enum imsg_type { IMSG_NONE, @@ -195,7 +195,6 @@ enum imsg_type { IMSG_CTL_REMOVE, IMSG_CTL_SCHEDULE, IMSG_CTL_SHOW_STATUS, - IMSG_CTL_SHUTDOWN, IMSG_CTL_TRACE_DISABLE, IMSG_CTL_TRACE_ENABLE, IMSG_CTL_UPDATE_TABLE, @@ -572,7 +571,7 @@ struct smtpd { #define SMTPD_OPT_NOACTION 0x00000002 uint32_t sc_opts; -#define SMTPD_EXITING 0x00000001 +#define SMTPD_EXITING 0x00000001 /* unused */ #define SMTPD_MDA_PAUSED 0x00000002 #define SMTPD_MTA_PAUSED 0x00000004 #define SMTPD_SMTP_PAUSED 0x00000008 |