From a750c1bfaad6887953db2c834456b4a0ed73e37e Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sun, 24 Aug 2014 00:56:59 +0200 Subject: if the system is awesome enough to have sigupdate defined, use it instead of sigusr1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/libmdsserver/macros.h | 9 +++++++++ src/mds-base.c | 4 ++-- src/mds.c | 4 ++-- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/libmdsserver/macros.h b/src/libmdsserver/macros.h index 215c51a..04be98a 100644 --- a/src/libmdsserver/macros.h +++ b/src/libmdsserver/macros.h @@ -373,5 +373,14 @@ #endif +/** + * The user wants the program to re-exec. + * into an updated binary + */ +#ifndef SIGUPDATE +# define SIGUPDATE SIGUSR1 +#endif + + #endif diff --git a/src/mds-base.c b/src/mds-base.c index b2d1935..f676e66 100644 --- a/src/mds-base.c +++ b/src/mds-base.c @@ -595,8 +595,8 @@ static void commit_suicide(int signo) */ int trap_signals(void) { - /* Make the server update without all slaves dying on SIGUSR1. */ - fail_if (xsigaction(SIGUSR1, received_reexec) < 0); + /* Make the server update without all slaves dying on SIGUPDATE. */ + fail_if (xsigaction(SIGUPDATE, received_reexec) < 0); /* Implement clean exit on SIGTERM. */ fail_if (xsigaction(SIGTERM, received_terminate) < 0); diff --git a/src/mds.c b/src/mds.c index 36d3465..cc6adfd 100644 --- a/src/mds.c +++ b/src/mds.c @@ -99,8 +99,8 @@ int main(int argc_, char** argv_) exit_if (geteuid() != ROOT_USER_UID, eprint("the effective user is not root, cannot continue.");); - /* Set up to ignore SIGUSR1, used in mds for re-exec, but we cannot re-exec. */ - if (xsigaction(SIGUSR1, SIG_IGN) < 0) + /* Set up to ignore SIGUPDATE, used in mds for re-exec, but we cannot re-exec. */ + if (xsigaction(SIGUPDATE, SIG_IGN) < 0) perror(*argv); /* Set up to ignore SIGDANGER. */ -- cgit v1.2.3-70-g09d2