diff options
author | Darren Tucker <dtucker@zip.com.au> | 2013-09-22 19:02:40 +1000 |
---|---|---|
committer | Darren Tucker <dtucker@zip.com.au> | 2013-09-22 19:02:40 +1000 |
commit | f2bf36c3eb4d969f85ec8aa342e9aecb61cc8bb1 (patch) | |
tree | 82909c895d0e5a21182e280f4deb9124ac157a25 | |
parent | e90a06ae570fd259a2f5ced873c7f17390f535a5 (diff) |
- (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-- | ChangeLog | 5 | ||||
-rw-r--r-- | platform.c | 10 | ||||
-rw-r--r-- | platform.h | 3 | ||||
-rw-r--r-- | sshd.c | 1 |
4 files changed, 17 insertions, 2 deletions
@@ -1,3 +1,8 @@ | |||
1 | 20130922 | ||
2 | - (dtucker) [platform.c platform.h sshd.c] bz#2156: restore Linux oom_adj | ||
3 | setting when handling SIGHUP to maintain behaviour over retart. Patch | ||
4 | from Matthew Ife. | ||
5 | |||
1 | 20130918 | 6 | 20130918 |
2 | - (dtucker) [sshd_config] Trailing whitespace; from jstjohn at purdue edu. | 7 | - (dtucker) [sshd_config] Trailing whitespace; from jstjohn at purdue edu. |
3 | 8 | ||
diff --git a/platform.c b/platform.c index 3262b2478..6d896c229 100644 --- a/platform.c +++ b/platform.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $Id: platform.c,v 1.19 2013/03/12 00:31:05 dtucker Exp $ */ | 1 | /* $Id: platform.c,v 1.20 2013/09/22 09:02:40 dtucker Exp $ */ |
2 | 2 | ||
3 | /* | 3 | /* |
4 | * Copyright (c) 2006 Darren Tucker. All rights reserved. | 4 | * Copyright (c) 2006 Darren Tucker. All rights reserved. |
@@ -55,6 +55,14 @@ platform_pre_fork(void) | |||
55 | } | 55 | } |
56 | 56 | ||
57 | void | 57 | void |
58 | platform_pre_restart(void) | ||
59 | { | ||
60 | #ifdef LINUX_OOM_ADJUST | ||
61 | oom_adjust_restore(); | ||
62 | #endif | ||
63 | } | ||
64 | |||
65 | void | ||
58 | platform_post_fork_parent(pid_t child_pid) | 66 | platform_post_fork_parent(pid_t child_pid) |
59 | { | 67 | { |
60 | #ifdef USE_SOLARIS_PROCESS_CONTRACTS | 68 | #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 @@ | |||
1 | /* $Id: platform.h,v 1.8 2013/03/12 00:31:05 dtucker Exp $ */ | 1 | /* $Id: platform.h,v 1.9 2013/09/22 09:02:40 dtucker Exp $ */ |
2 | 2 | ||
3 | /* | 3 | /* |
4 | * Copyright (c) 2006 Darren Tucker. All rights reserved. | 4 | * Copyright (c) 2006 Darren Tucker. All rights reserved. |
@@ -22,6 +22,7 @@ | |||
22 | 22 | ||
23 | void platform_pre_listen(void); | 23 | void platform_pre_listen(void); |
24 | void platform_pre_fork(void); | 24 | void platform_pre_fork(void); |
25 | void platform_pre_restart(void); | ||
25 | void platform_post_fork_parent(pid_t child_pid); | 26 | void platform_post_fork_parent(pid_t child_pid); |
26 | void platform_post_fork_child(void); | 27 | void platform_post_fork_child(void); |
27 | int platform_privileged_uidswap(void); | 28 | int platform_privileged_uidswap(void); |
@@ -315,6 +315,7 @@ static void | |||
315 | sighup_restart(void) | 315 | sighup_restart(void) |
316 | { | 316 | { |
317 | logit("Received SIGHUP; restarting."); | 317 | logit("Received SIGHUP; restarting."); |
318 | platform_pre_restart(); | ||
318 | close_listen_socks(); | 319 | close_listen_socks(); |
319 | close_startup_pipes(); | 320 | close_startup_pipes(); |
320 | alarm(0); /* alarm timer persists across exec */ | 321 | alarm(0); /* alarm timer persists across exec */ |