diff options
author | Ondrej Kozina <okozina@redhat.com> | 2015-04-01 10:51:23 +0200 |
---|---|---|
committer | Ondrej Kozina <okozina@redhat.com> | 2015-05-07 15:50:28 +0200 |
commit | 71016ab2a855a96d7de86ab1d8e40a999690d49b (patch) | |
tree | da1573441ecf5518f00e9e51042829b4cb812b72 | |
parent | 132b1ebff112a5c297a9de6be0e3e585e8d2f4f6 (diff) | |
download | lvm2-71016ab2a855a96d7de86ab1d8e40a999690d49b.tar.gz |
lvmpolld: kill all children during shutdown
-rw-r--r-- | daemons/lvmpolld/lvmpolld-data-utils.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/daemons/lvmpolld/lvmpolld-data-utils.c b/daemons/lvmpolld/lvmpolld-data-utils.c index 1499e3f59..326139a85 100644 --- a/daemons/lvmpolld/lvmpolld-data-utils.c +++ b/daemons/lvmpolld/lvmpolld-data-utils.c @@ -13,6 +13,8 @@ */ #include <fcntl.h> +#include <signal.h> +#include <sys/types.h> #include <unistd.h> #include "config-util.h" @@ -352,6 +354,12 @@ void lvmpolld_thread_data_destroy(void *thread_private) if (data->pdlv) { pdst_lock(data->pdlv->pdst); + /* + * FIXME: skip this step if lvmpolld is activated + * by systemd. + */ + if (!pdlv_get_polling_finished(data->pdlv)) + kill(data->pdlv->cmd_pid, SIGTERM); pdlv_set_polling_finished(data->pdlv, 1); pdst_locked_dec(data->pdlv->pdst); pdst_unlock(data->pdlv->pdst); |