summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@zip.com.au>2013-09-22 11:02:40 +0200
committerDarren Tucker <dtucker@zip.com.au>2013-09-22 11:02:40 +0200
commitf2bf36c3eb4d969f85ec8aa342e9aecb61cc8bb1 (patch)
tree82909c895d0e5a21182e280f4deb9124ac157a25
parent - (dtucker) [sshd_config] Trailing whitespace; from jstjohn at purdue edu. (diff)
downloadopenssh-f2bf36c3eb4d969f85ec8aa342e9aecb61cc8bb1.tar.xz
openssh-f2bf36c3eb4d969f85ec8aa342e9aecb61cc8bb1.zip
- (dtucker) [platform.c platform.h sshd.c] bz#2156: restore Linux oom_adj
setting when handling SIGHUP to maintain behaviour over retart. Patch from Matthew Ife.
-rw-r--r--ChangeLog5
-rw-r--r--platform.c10
-rw-r--r--platform.h3
-rw-r--r--sshd.c1
4 files changed, 17 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index df8249779..c7a7146fd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+20130922
+ - (dtucker) [platform.c platform.h sshd.c] bz#2156: restore Linux oom_adj
+ setting when handling SIGHUP to maintain behaviour over retart. Patch
+ from Matthew Ife.
+
20130918
- (dtucker) [sshd_config] Trailing whitespace; from jstjohn at purdue edu.
diff --git a/platform.c b/platform.c
index 3262b2478..6d896c229 100644
--- a/platform.c
+++ b/platform.c
@@ -1,4 +1,4 @@
-/* $Id: platform.c,v 1.19 2013/03/12 00:31:05 dtucker Exp $ */
+/* $Id: platform.c,v 1.20 2013/09/22 09:02:40 dtucker Exp $ */
/*
* Copyright (c) 2006 Darren Tucker. All rights reserved.
@@ -55,6 +55,14 @@ platform_pre_fork(void)
}
void
+platform_pre_restart(void)
+{
+#ifdef LINUX_OOM_ADJUST
+ oom_adjust_restore();
+#endif
+}
+
+void
platform_post_fork_parent(pid_t child_pid)
{
#ifdef USE_SOLARIS_PROCESS_CONTRACTS
diff --git a/platform.h b/platform.h
index 19f6bfdd3..1c7a45d8f 100644
--- a/platform.h
+++ b/platform.h
@@ -1,4 +1,4 @@
-/* $Id: platform.h,v 1.8 2013/03/12 00:31:05 dtucker Exp $ */
+/* $Id: platform.h,v 1.9 2013/09/22 09:02:40 dtucker Exp $ */
/*
* Copyright (c) 2006 Darren Tucker. All rights reserved.
@@ -22,6 +22,7 @@
void platform_pre_listen(void);
void platform_pre_fork(void);
+void platform_pre_restart(void);
void platform_post_fork_parent(pid_t child_pid);
void platform_post_fork_child(void);
int platform_privileged_uidswap(void);
diff --git a/sshd.c b/sshd.c
index 3efe170e0..7e3b60f9f 100644
--- a/sshd.c
+++ b/sshd.c
@@ -315,6 +315,7 @@ static void
sighup_restart(void)
{
logit("Received SIGHUP; restarting.");
+ platform_pre_restart();
close_listen_socks();
close_startup_pipes();
alarm(0); /* alarm timer persists across exec */