device-mapper-multipath/0017-RH-fix-sigusr1.patch
Benjamin Marzinski d1207a7795 device-mapper-multipath-0.4.9-45
Updated to latest upstrem 0.4.9 code: multipath-tools-130222
  (git commit id: 67b82ad6fe280caa1770025a6bb8110b633fa136)
Refresh 0001-RH-dont_start_with_no_config.patch
Modify 0002-RH-multipath.rules.patch
Modify 0003-RH-Make-build-system-RH-Fedora-friendly.patch
Refresh 0004-RH-multipathd-blacklist-all-by-default.patch
Refresh 0005-RH-add-mpathconf.patch
Refresh 0006-RH-add-find-multipaths.patch
Add 0008-RH-revert-partition-changes.patch
Rename 0008-RH-RHEL5-style-partitions.patch to
       0009-RH-RHEL5-style-partitions.patch
Rename 0009-RH-dont-remove-map-on-enomem.patch to
       0010-RH-dont-remove-map-on-enomem.patch
Rename 0010-RH-deprecate-uid-gid-mode.patch to
       0011-RH-deprecate-uid-gid-mode.patch
Rename 0013-RH-kpartx-msg.patch to 0012-RH-kpartx-msg.patch
Rename 0035-RHBZ-883981-cleanup-rpmdiff-issues.patch to
       0013-RHBZ-883981-cleanup-rpmdiff-issues.patch
Rename 0039-RH-handle-other-sector-sizes.patch to
       0014-RH-handle-other-sector-sizes.patch
Rename 0040-RH-fix-output-buffer.patch to 0015-RH-fix-output-buffer.patch
Add 0016-RH-dont-print-ghost-messages.patch
Add 0017-RH-fix-sigusr1.patch
  * Actually this fixes a number of issues related to signals
Rename 0018-RH-remove-config-dups.patch to 0018-RH-fix-factorize.patch
  * just the part that isn't upstream
Add 0019-RH-fix-sockets.patch
  * makes abstract multipathd a cli sockets use the correct name.
Set find_multipaths in the default config
2013-03-02 17:03:30 -06:00

83 lines
2.0 KiB
Diff

---
libmultipath/log_pthread.c | 3 +++
multipathd/main.c | 12 +++++-------
2 files changed, 8 insertions(+), 7 deletions(-)
Index: multipath-tools-130222/multipathd/main.c
===================================================================
--- multipath-tools-130222.orig/multipathd/main.c
+++ multipath-tools-130222/multipathd/main.c
@@ -1473,7 +1473,9 @@ sighup (int sig)
if (running_state != DAEMON_RUNNING)
return;
+ lock(gvecs->lock);
reconfigure(gvecs);
+ unlock(gvecs->lock);
#ifdef _DEBUG_
dbg_free_final(NULL);
@@ -1487,16 +1489,9 @@ sigend (int sig)
}
static void
-sigusr1 (int sig)
-{
- condlog(3, "SIGUSR1 received");
-}
-
-static void
signal_init(void)
{
signal_set(SIGHUP, sighup);
- signal_set(SIGUSR1, sigusr1);
signal_set(SIGINT, sigend);
signal_set(SIGTERM, sigend);
signal(SIGPIPE, SIG_IGN);
@@ -1652,6 +1647,7 @@ child (void * param)
*/
running_state = DAEMON_CONFIGURE;
+ block_signal(SIGHUP, &set);
lock(vecs->lock);
if (configure(vecs, 1)) {
unlock(vecs->lock);
@@ -1659,6 +1655,7 @@ child (void * param)
exit(1);
}
unlock(vecs->lock);
+ pthread_sigmask(SIG_SETMASK, &set, NULL);
/*
* start threads
@@ -1691,6 +1688,7 @@ child (void * param)
*/
running_state = DAEMON_SHUTDOWN;
pthread_sigmask(SIG_UNBLOCK, &set, NULL);
+ block_signal(SIGUSR1, NULL);
block_signal(SIGHUP, NULL);
lock(vecs->lock);
if (conf->queue_without_daemon == QUE_NO_DAEMON_OFF)
Index: multipath-tools-130222/libmultipath/log_pthread.c
===================================================================
--- multipath-tools-130222.orig/libmultipath/log_pthread.c
+++ multipath-tools-130222/libmultipath/log_pthread.c
@@ -55,14 +55,17 @@ void log_safe (int prio, const char * fm
void log_thread_flush (void)
{
+ sigset_t old;
int empty;
do {
+ block_signal(SIGUSR1, &old);
pthread_mutex_lock(&logq_lock);
empty = log_dequeue(la->buff);
pthread_mutex_unlock(&logq_lock);
if (!empty)
log_syslog(la->buff);
+ pthread_sigmask(SIG_SETMASK, &old, NULL);
} while (empty == 0);
}