New upstream release.
This commit is contained in:
parent
7debc62333
commit
a76d6fdae6
1
.gitignore
vendored
1
.gitignore
vendored
@ -12,3 +12,4 @@ LVM2.2.02.73.tgz
|
||||
/LVM2.2.02.83.tgz
|
||||
/LVM2.2.02.84.tgz
|
||||
/LVM2.2.02.86.tgz
|
||||
/LVM2.2.02.87.tgz
|
||||
|
@ -1,7 +0,0 @@
|
||||
-----BEGIN PGP SIGNATURE-----
|
||||
Version: GnuPG v1.2.1 (GNU/Linux)
|
||||
|
||||
iD8DBQBOF2CSIoGRwVZ+LBcRAgPPAJ9j86CkFVmMQCgmqk/uSvPZ3setVACgtTWI
|
||||
5xp0pXLF6lsI+IQquIz1CWk=
|
||||
=rB0U
|
||||
-----END PGP SIGNATURE-----
|
7
LVM2.2.02.87.tgz.asc
Normal file
7
LVM2.2.02.87.tgz.asc
Normal file
@ -0,0 +1,7 @@
|
||||
-----BEGIN PGP SIGNATURE-----
|
||||
Version: GnuPG v1.2.1 (GNU/Linux)
|
||||
|
||||
iD8DBQBORI13IoGRwVZ+LBcRAshdAKCG/UOS7n0xA83p9jsZb8ka8PoqygCg35hg
|
||||
5GrcluMg1WIlTvYRs71X124=
|
||||
=EBP2
|
||||
-----END PGP SIGNATURE-----
|
16
lvm2-2_02_88-do-not-remove-makefile-on-clean.patch
Normal file
16
lvm2-2_02_88-do-not-remove-makefile-on-clean.patch
Normal file
@ -0,0 +1,16 @@
|
||||
make.tmpl.in | 2 +-
|
||||
1 files changed, 1 insertions(+), 1 deletions(-)
|
||||
|
||||
diff --git a/make.tmpl.in b/make.tmpl.in
|
||||
index a9d5235..3a21b24 100644
|
||||
--- a/make.tmpl.in
|
||||
+++ b/make.tmpl.in
|
||||
@@ -364,7 +364,7 @@ cleandir:
|
||||
$(RM) $(OBJECTS) $(TARGETS) $(CLEAN_TARGETS) $(CLEAN_CFLOW) $(LDDEPS) \
|
||||
$(POTFILES) $(SOURCES:%.c=%.d) $(SOURCES:%.c=%.gcno) $(SOURCES:%.c=%.gcda) \
|
||||
$(SOURCES2:%.c=%.o) $(SOURCES2:%.c=%.d) $(SOURCES2:%.c=%.gcno) $(SOURCES2:%.c=%.gcda) \
|
||||
- .exported_symbols_generated Makefile core
|
||||
+ .exported_symbols_generated core
|
||||
|
||||
clean: $(SUBDIRS.clean) cleandir
|
||||
|
@ -1,91 +0,0 @@
|
||||
WHATS_NEW | 4 ++++
|
||||
WHATS_NEW_DM | 4 ++++
|
||||
scripts/dm_event_systemd_red_hat.service.in | 14 ++++++++++++++
|
||||
scripts/dm_event_systemd_red_hat.socket | 11 +++++++++++
|
||||
scripts/lvm2_monitoring_systemd_red_hat.service.in | 17 +++++++++++++++++
|
||||
5 files changed, 50 insertions(+), 0 deletions(-)
|
||||
|
||||
diff --git a/WHATS_NEW b/WHATS_NEW
|
||||
index ddb04ad..f8bb79e 100644
|
||||
--- a/WHATS_NEW
|
||||
+++ b/WHATS_NEW
|
||||
@@ -1,3 +1,7 @@
|
||||
+Version 2.02.87 -
|
||||
+===============================
|
||||
+ Add systemd unit file to provide lvm2 monitoring.
|
||||
+
|
||||
Version 2.02.86 - 8th July 2011
|
||||
===============================
|
||||
Remove unnecessary warning in pvcreate for MD linear devices.
|
||||
diff --git a/WHATS_NEW_DM b/WHATS_NEW_DM
|
||||
index 5e4aeaf..b6a5360 100644
|
||||
--- a/WHATS_NEW_DM
|
||||
+++ b/WHATS_NEW_DM
|
||||
@@ -1,3 +1,7 @@
|
||||
+Version 1.02.66 -
|
||||
+===============================
|
||||
+ Add systemd unit files for dmeventd.
|
||||
+
|
||||
Version 1.02.65 - 8th July 2011
|
||||
===============================
|
||||
Remove dev name prefix from dmsetup line output if exactly one dev requested.
|
||||
diff --git a/scripts/dm_event_systemd_red_hat.service.in b/scripts/dm_event_systemd_red_hat.service.in
|
||||
new file mode 100644
|
||||
index 0000000..32295d3
|
||||
--- /dev/null
|
||||
+++ b/scripts/dm_event_systemd_red_hat.service.in
|
||||
@@ -0,0 +1,14 @@
|
||||
+[Unit]
|
||||
+Description=Device-mapper event daemon
|
||||
+After=fedora-storage-init.service fedora-storage-init-late.service
|
||||
+Before=local-fs.target
|
||||
+DefaultDependencies=no
|
||||
+
|
||||
+[Service]
|
||||
+Type=forking
|
||||
+ExecStart=@sbindir@/dmeventd
|
||||
+PIDFile=@DMEVENTD_PIDFILE@
|
||||
+OOMScoreAdjust=-1000
|
||||
+
|
||||
+[Install]
|
||||
+WantedBy=sysinit.target
|
||||
diff --git a/scripts/dm_event_systemd_red_hat.socket b/scripts/dm_event_systemd_red_hat.socket
|
||||
new file mode 100644
|
||||
index 0000000..c580555
|
||||
--- /dev/null
|
||||
+++ b/scripts/dm_event_systemd_red_hat.socket
|
||||
@@ -0,0 +1,11 @@
|
||||
+[Unit]
|
||||
+Description=Device-mapper event daemon FIFOs
|
||||
+DefaultDependencies=no
|
||||
+
|
||||
+[Socket]
|
||||
+ListenFIFO=/var/run/dmeventd-server
|
||||
+ListenFIFO=/var/run/dmeventd-client
|
||||
+SocketMode=0600
|
||||
+
|
||||
+[Install]
|
||||
+WantedBy=sockets.target
|
||||
diff --git a/scripts/lvm2_monitoring_systemd_red_hat.service.in b/scripts/lvm2_monitoring_systemd_red_hat.service.in
|
||||
new file mode 100644
|
||||
index 0000000..4715416
|
||||
--- /dev/null
|
||||
+++ b/scripts/lvm2_monitoring_systemd_red_hat.service.in
|
||||
@@ -0,0 +1,17 @@
|
||||
+[Unit]
|
||||
+Description=Monitoring of LVM2 mirrors, snapshots etc. using dmeventd or progress polling
|
||||
+Requires=dm-event.socket
|
||||
+After=fedora-storage-init.service fedora-storage-init-late.service
|
||||
+Before=local-fs.target
|
||||
+DefaultDependencies=no
|
||||
+Conflicts=shutdown.target
|
||||
+
|
||||
+[Service]
|
||||
+Type=oneshot
|
||||
+ExecStart=@sbindir@/lvm vgchange --monitor y
|
||||
+ExecStop=@sbindir@/lvm vgchange --monitor n
|
||||
+RemainAfterExit=yes
|
||||
+
|
||||
+[Install]
|
||||
+WantedBy=sysinit.target
|
||||
+Also=dm-event.socket
|
@ -1,35 +0,0 @@
|
||||
configure | 6 +++++-
|
||||
1 files changed, 5 insertions(+), 1 deletions(-)
|
||||
|
||||
diff --git a/configure b/configure
|
||||
index 8e3b243..aac4f26 100755
|
||||
--- a/configure
|
||||
+++ b/configure
|
||||
@@ -603,6 +603,7 @@ kernelvsn
|
||||
missingkernel
|
||||
kerneldir
|
||||
interface
|
||||
+DMEVENTD_PIDFILE
|
||||
WRITE_INSTALL
|
||||
UDEV_SYNC
|
||||
UDEV_RULES
|
||||
@@ -10380,8 +10381,9 @@ LVM_LIBAPI=`echo "$VER" | $AWK -F '[()]' '{print $2}'`
|
||||
|
||||
|
||||
|
||||
+
|
||||
################################################################################
|
||||
-ac_config_files="$ac_config_files Makefile make.tmpl daemons/Makefile daemons/clvmd/Makefile daemons/cmirrord/Makefile daemons/dmeventd/Makefile daemons/dmeventd/libdevmapper-event.pc daemons/dmeventd/plugins/Makefile daemons/dmeventd/plugins/lvm2/Makefile daemons/dmeventd/plugins/mirror/Makefile daemons/dmeventd/plugins/snapshot/Makefile doc/Makefile doc/example.conf include/.symlinks include/Makefile lib/Makefile lib/format1/Makefile lib/format_pool/Makefile lib/locking/Makefile lib/mirror/Makefile lib/replicator/Makefile lib/misc/lvm-version.h lib/snapshot/Makefile libdm/Makefile libdm/libdevmapper.pc liblvm/Makefile liblvm/liblvm2app.pc man/Makefile po/Makefile scripts/clvmd_init_red_hat scripts/cmirrord_init_red_hat scripts/lvm2_monitoring_init_red_hat scripts/Makefile test/Makefile test/api/Makefile tools/Makefile udev/Makefile unit-tests/datastruct/Makefile unit-tests/regex/Makefile unit-tests/mm/Makefile"
|
||||
+ac_config_files="$ac_config_files Makefile make.tmpl daemons/Makefile daemons/clvmd/Makefile daemons/cmirrord/Makefile daemons/dmeventd/Makefile daemons/dmeventd/libdevmapper-event.pc daemons/dmeventd/plugins/Makefile daemons/dmeventd/plugins/lvm2/Makefile daemons/dmeventd/plugins/mirror/Makefile daemons/dmeventd/plugins/snapshot/Makefile doc/Makefile doc/example.conf include/.symlinks include/Makefile lib/Makefile lib/format1/Makefile lib/format_pool/Makefile lib/locking/Makefile lib/mirror/Makefile lib/replicator/Makefile lib/misc/lvm-version.h lib/snapshot/Makefile libdm/Makefile libdm/libdevmapper.pc liblvm/Makefile liblvm/liblvm2app.pc man/Makefile po/Makefile scripts/clvmd_init_red_hat scripts/cmirrord_init_red_hat scripts/lvm2_monitoring_init_red_hat scripts/dm_event_systemd_red_hat.service scripts/lvm2_monitoring_systemd_red_hat.service scripts/Makefile test/Makefile test/api/Makefile tools/Makefile udev/Makefile unit-tests/datastruct/Makefile unit-tests/regex/Makefile unit-tests/mm/Makefile"
|
||||
|
||||
cat >confcache <<\_ACEOF
|
||||
# This file is a shell script that caches the results of configure
|
||||
@@ -11102,6 +11104,8 @@ do
|
||||
"scripts/clvmd_init_red_hat") CONFIG_FILES="$CONFIG_FILES scripts/clvmd_init_red_hat" ;;
|
||||
"scripts/cmirrord_init_red_hat") CONFIG_FILES="$CONFIG_FILES scripts/cmirrord_init_red_hat" ;;
|
||||
"scripts/lvm2_monitoring_init_red_hat") CONFIG_FILES="$CONFIG_FILES scripts/lvm2_monitoring_init_red_hat" ;;
|
||||
+ "scripts/dm_event_systemd_red_hat.service") CONFIG_FILES="$CONFIG_FILES scripts/dm_event_systemd_red_hat.service" ;;
|
||||
+ "scripts/lvm2_monitoring_systemd_red_hat.service") CONFIG_FILES="$CONFIG_FILES scripts/lvm2_monitoring_systemd_red_hat.service" ;;
|
||||
"scripts/Makefile") CONFIG_FILES="$CONFIG_FILES scripts/Makefile" ;;
|
||||
"test/Makefile") CONFIG_FILES="$CONFIG_FILES test/Makefile" ;;
|
||||
"test/api/Makefile") CONFIG_FILES="$CONFIG_FILES test/api/Makefile" ;;
|
@ -1,28 +0,0 @@
|
||||
WHATS_NEW | 1 +
|
||||
lib/config/defaults.h | 2 +-
|
||||
2 files changed, 2 insertions(+), 1 deletions(-)
|
||||
|
||||
diff --git a/WHATS_NEW b/WHATS_NEW
|
||||
index f8bb79e..b40abd9 100644
|
||||
--- a/WHATS_NEW
|
||||
+++ b/WHATS_NEW
|
||||
@@ -1,5 +1,6 @@
|
||||
Version 2.02.87 -
|
||||
===============================
|
||||
+ Change DEFAULT_UDEV_SYNC to 1 so udev_sync is used even without any config.
|
||||
Add systemd unit file to provide lvm2 monitoring.
|
||||
|
||||
Version 2.02.86 - 8th July 2011
|
||||
diff --git a/lib/config/defaults.h b/lib/config/defaults.h
|
||||
index afd8dc1..7793d32 100644
|
||||
--- a/lib/config/defaults.h
|
||||
+++ b/lib/config/defaults.h
|
||||
@@ -77,7 +77,7 @@
|
||||
#define DEFAULT_LABELSECTOR UINT64_C(1)
|
||||
#define DEFAULT_READ_AHEAD "auto"
|
||||
#define DEFAULT_UDEV_RULES 1
|
||||
-#define DEFAULT_UDEV_SYNC 0
|
||||
+#define DEFAULT_UDEV_SYNC 1
|
||||
#define DEFAULT_VERIFY_UDEV_OPERATIONS 0
|
||||
#define DEFAULT_ACTIVATION_CHECKS 0
|
||||
#define DEFAULT_EXTENT_SIZE 4096 /* In KB */
|
@ -1,116 +0,0 @@
|
||||
WHATS_NEW_DM | 1 +
|
||||
daemons/dmeventd/dmeventd.c | 61 +++++++++++++++++++++++++++++-------------
|
||||
2 files changed, 43 insertions(+), 19 deletions(-)
|
||||
|
||||
diff --git a/WHATS_NEW_DM b/WHATS_NEW_DM
|
||||
index b6a5360..868a469 100644
|
||||
--- a/WHATS_NEW_DM
|
||||
+++ b/WHATS_NEW_DM
|
||||
@@ -1,5 +1,6 @@
|
||||
Version 1.02.66 -
|
||||
===============================
|
||||
+ Add support for new oom killer adjustment interface (oom_score_adj).
|
||||
Add systemd unit files for dmeventd.
|
||||
|
||||
Version 1.02.65 - 8th July 2011
|
||||
diff --git a/daemons/dmeventd/dmeventd.c b/daemons/dmeventd/dmeventd.c
|
||||
index 1a91cb8..a6956cb 100644
|
||||
--- a/daemons/dmeventd/dmeventd.c
|
||||
+++ b/daemons/dmeventd/dmeventd.c
|
||||
@@ -41,11 +41,19 @@
|
||||
#ifdef linux
|
||||
# include <malloc.h>
|
||||
|
||||
-# define OOM_ADJ_FILE "/proc/self/oom_adj"
|
||||
+/*
|
||||
+ * Kernel version 2.6.36 and higher has
|
||||
+ * new OOM killer adjustment interface.
|
||||
+ */
|
||||
+# define OOM_ADJ_FILE_OLD "/proc/self/oom_adj"
|
||||
+# define OOM_ADJ_FILE "/proc/self/oom_score_adj"
|
||||
|
||||
/* From linux/oom.h */
|
||||
+/* Old interface */
|
||||
# define OOM_DISABLE (-17)
|
||||
# define OOM_ADJUST_MIN (-16)
|
||||
+/* New interface */
|
||||
+# define OOM_SCORE_ADJ_MIN (-1000)
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1594,33 +1602,48 @@ static void _exit_handler(int sig __attribute__((unused)))
|
||||
}
|
||||
|
||||
#ifdef linux
|
||||
+static int _set_oom_adj(const char *oom_adj_path, int val)
|
||||
+{
|
||||
+ FILE *fp;
|
||||
+
|
||||
+ if (!(fp = fopen(oom_adj_path, "w"))) {
|
||||
+ perror("oom_adj: fopen failed");
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
+ fprintf(fp, "%i", val);
|
||||
+
|
||||
+ if (dm_fclose(fp))
|
||||
+ perror("oom_adj: fclose failed");
|
||||
+
|
||||
+ return 1;
|
||||
+}
|
||||
+
|
||||
/*
|
||||
* Protection against OOM killer if kernel supports it
|
||||
*/
|
||||
-static int _set_oom_adj(int val)
|
||||
+static int _protect_against_oom_killer()
|
||||
{
|
||||
- FILE *fp;
|
||||
-
|
||||
struct stat st;
|
||||
|
||||
if (stat(OOM_ADJ_FILE, &st) == -1) {
|
||||
- if (errno == ENOENT)
|
||||
- perror(OOM_ADJ_FILE " not found");
|
||||
- else
|
||||
+ if (errno != ENOENT)
|
||||
perror(OOM_ADJ_FILE ": stat failed");
|
||||
- return 1;
|
||||
- }
|
||||
|
||||
- if (!(fp = fopen(OOM_ADJ_FILE, "w"))) {
|
||||
- perror(OOM_ADJ_FILE ": fopen failed");
|
||||
- return 0;
|
||||
- }
|
||||
+ /* Try old oom_adj interface as a fallback */
|
||||
+ if (stat(OOM_ADJ_FILE_OLD, &st) == -1) {
|
||||
+ if (errno == ENOENT)
|
||||
+ perror(OOM_ADJ_FILE_OLD " not found");
|
||||
+ else
|
||||
+ perror(OOM_ADJ_FILE_OLD ": stat failed");
|
||||
+ return 1;
|
||||
+ }
|
||||
|
||||
- fprintf(fp, "%i", val);
|
||||
- if (dm_fclose(fp))
|
||||
- perror(OOM_ADJ_FILE ": fclose failed");
|
||||
+ return _set_oom_adj(OOM_ADJ_FILE_OLD, OOM_DISABLE) ||
|
||||
+ _set_oom_adj(OOM_ADJ_FILE_OLD, OOM_ADJUST_MIN);
|
||||
+ }
|
||||
|
||||
- return 1;
|
||||
+ return _set_oom_adj(OOM_ADJ_FILE, OOM_SCORE_ADJ_MIN);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1829,8 +1852,8 @@ int main(int argc, char *argv[])
|
||||
signal(SIGQUIT, &_exit_handler);
|
||||
|
||||
#ifdef linux
|
||||
- if (!_set_oom_adj(OOM_DISABLE) && !_set_oom_adj(OOM_ADJUST_MIN))
|
||||
- syslog(LOG_ERR, "Failed to set oom_adj to protect against OOM killer");
|
||||
+ if (!_protect_against_oom_killer())
|
||||
+ syslog(LOG_ERR, "Failed to protect against OOM killer");
|
||||
#endif
|
||||
|
||||
_init_thread_signals();
|
@ -1,71 +0,0 @@
|
||||
Makefile.in | 3 +++
|
||||
WHATS_NEW | 1 +
|
||||
configure.in | 3 +++
|
||||
make.tmpl.in | 1 +
|
||||
scripts/Makefile.in | 9 ++++++++-
|
||||
5 files changed, 16 insertions(+), 1 deletions(-)
|
||||
|
||||
diff --git a/Makefile.in b/Makefile.in
|
||||
index f7e34f4..38c41a3 100644
|
||||
--- a/Makefile.in
|
||||
+++ b/Makefile.in
|
||||
@@ -92,6 +92,9 @@ install_system_dirs:
|
||||
install_initscripts:
|
||||
$(MAKE) -C scripts install_initscripts
|
||||
|
||||
+install_systemd_units:
|
||||
+ $(MAKE) -C scripts install_systemd_units
|
||||
+
|
||||
LCOV_TRACES = libdm.info lib.info tools.info \
|
||||
daemons/dmeventd.info daemons/clvmd.info
|
||||
CLEAN_TARGETS += $(LCOV_TRACES)
|
||||
diff --git a/configure.in b/configure.in
|
||||
index 60796ad..d54d7d8 100644
|
||||
--- a/configure.in
|
||||
+++ b/configure.in
|
||||
@@ -1371,6 +1371,7 @@ AC_SUBST(UDEV_PC)
|
||||
AC_SUBST(UDEV_RULES)
|
||||
AC_SUBST(UDEV_SYNC)
|
||||
AC_SUBST(WRITE_INSTALL)
|
||||
+AC_SUBST(DMEVENTD_PIDFILE)
|
||||
AC_SUBST(interface)
|
||||
AC_SUBST(kerneldir)
|
||||
AC_SUBST(missingkernel)
|
||||
@@ -1417,6 +1418,8 @@ po/Makefile
|
||||
scripts/clvmd_init_red_hat
|
||||
scripts/cmirrord_init_red_hat
|
||||
scripts/lvm2_monitoring_init_red_hat
|
||||
+scripts/dm_event_systemd_red_hat.service
|
||||
+scripts/lvm2_monitoring_systemd_red_hat.service
|
||||
scripts/Makefile
|
||||
test/Makefile
|
||||
test/api/Makefile
|
||||
diff --git a/make.tmpl.in b/make.tmpl.in
|
||||
index cd8ae35..f003149 100644
|
||||
--- a/make.tmpl.in
|
||||
+++ b/make.tmpl.in
|
||||
@@ -65,6 +65,7 @@ staticdir = $(DESTDIR)@STATICDIR@
|
||||
udevdir = $(DESTDIR)@udevdir@
|
||||
pkgconfigdir = $(usrlibdir)/pkgconfig
|
||||
initdir = $(DESTDIR)@sysconfdir@/rc.d/init.d
|
||||
+systemd_dir = $(DESTDIR)/lib/systemd/system
|
||||
ocf_scriptdir = $(DESTDIR)@OCFDIR@
|
||||
|
||||
USRLIB_RELPATH = $(shell echo $(abspath $(usrlibdir) $(libdir)) | \
|
||||
diff --git a/scripts/Makefile.in b/scripts/Makefile.in
|
||||
index 5293cc3..7262fbb 100644
|
||||
--- a/scripts/Makefile.in
|
||||
+++ b/scripts/Makefile.in
|
||||
@@ -53,4 +53,11 @@ ifeq ("@BUILD_CMIRRORD@", "yes")
|
||||
$(INSTALL_SCRIPT) cmirrord_init_red_hat $(initdir)/cmirrord
|
||||
endif
|
||||
|
||||
-DISTCLEAN_TARGETS += clvmd_init_red_hat cmirrord_init_red_hat lvm2_monitoring_init_red_hat
|
||||
+install_systemd_units:
|
||||
+ $(INSTALL_DIR) $(systemd_dir)
|
||||
+ $(INSTALL_DATA) dm_event_systemd_red_hat.socket $(systemd_dir)/dm-event.socket
|
||||
+ $(INSTALL_DATA) dm_event_systemd_red_hat.service $(systemd_dir)/dm-event.service
|
||||
+ $(INSTALL_DATA) lvm2_monitoring_systemd_red_hat.service $(systemd_dir)/lvm2-monitor.service
|
||||
+
|
||||
+DISTCLEAN_TARGETS += clvmd_init_red_hat cmirrord_init_red_hat lvm2_monitoring_init_red_hat \
|
||||
+ dm_event_systemd_red_hat.service lvm2_monitoring_systemd_red_hat.service
|
@ -1,167 +0,0 @@
|
||||
WHATS_NEW_DM | 1 +
|
||||
daemons/dmeventd/dmeventd.c | 95 +++++++++++++++++++++++++++++++++++++++++--
|
||||
2 files changed, 92 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/WHATS_NEW_DM b/WHATS_NEW_DM
|
||||
index 868a469..d09a50c 100644
|
||||
--- a/WHATS_NEW_DM
|
||||
+++ b/WHATS_NEW_DM
|
||||
@@ -1,5 +1,6 @@
|
||||
Version 1.02.66 -
|
||||
===============================
|
||||
+ Add support for systemd file descriptor handover to dmeventd.
|
||||
Add support for new oom killer adjustment interface (oom_score_adj).
|
||||
Add systemd unit files for dmeventd.
|
||||
|
||||
diff --git a/daemons/dmeventd/dmeventd.c b/daemons/dmeventd/dmeventd.c
|
||||
index a6956cb..ec514ee 100644
|
||||
--- a/daemons/dmeventd/dmeventd.c
|
||||
+++ b/daemons/dmeventd/dmeventd.c
|
||||
@@ -55,6 +55,13 @@
|
||||
/* New interface */
|
||||
# define OOM_SCORE_ADJ_MIN (-1000)
|
||||
|
||||
+/* Systemd on-demand activation support */
|
||||
+# define SD_LISTEN_PID_ENV_VAR_NAME "LISTEN_PID"
|
||||
+# define SD_LISTEN_FDS_ENV_VAR_NAME "LISTEN_FDS"
|
||||
+# define SD_LISTEN_FDS_START 3
|
||||
+# define SD_FD_FIFO_SERVER SD_LISTEN_FDS_START
|
||||
+# define SD_FD_FIFO_CLIENT (SD_LISTEN_FDS_START + 1)
|
||||
+
|
||||
#endif
|
||||
|
||||
/* FIXME We use syslog for now, because multilog is not yet implemented */
|
||||
@@ -104,6 +111,7 @@ static pthread_mutex_t _global_mutex;
|
||||
#define THREAD_STACK_SIZE (300*1024)
|
||||
|
||||
int dmeventd_debug = 0;
|
||||
+static int _systemd_activation = 0;
|
||||
static int _foreground = 0;
|
||||
static int _restart = 0;
|
||||
static char **_initial_registrations = 0;
|
||||
@@ -1710,8 +1718,13 @@ static void _daemonize(void)
|
||||
else
|
||||
fd = rlim.rlim_cur;
|
||||
|
||||
- for (--fd; fd >= 0; fd--)
|
||||
+ for (--fd; fd >= 0; fd--) {
|
||||
+ /* Do not close fds preloaded by systemd! */
|
||||
+ if (_systemd_activation &&
|
||||
+ (fd == SD_FD_FIFO_SERVER || fd == SD_FD_FIFO_CLIENT))
|
||||
+ continue;
|
||||
close(fd);
|
||||
+ }
|
||||
|
||||
if ((open("/dev/null", O_RDONLY) < 0) ||
|
||||
(open("/dev/null", O_WRONLY) < 0) ||
|
||||
@@ -1780,6 +1793,76 @@ static void restart(void)
|
||||
fini_fifos(&fifos);
|
||||
}
|
||||
|
||||
+static int _handle_preloaded_fifo(int fd, const char *path)
|
||||
+{
|
||||
+ struct stat st_fd, st_path;
|
||||
+ int flags;
|
||||
+
|
||||
+ if ((flags = fcntl(fd, F_GETFD)) < 0)
|
||||
+ return 0;
|
||||
+
|
||||
+ if (flags & FD_CLOEXEC)
|
||||
+ return 0;
|
||||
+
|
||||
+ if (fstat(fd, &st_fd) < 0 || !S_ISFIFO(st_fd.st_mode))
|
||||
+ return 0;
|
||||
+
|
||||
+ if (stat(path, &st_path) < 0 ||
|
||||
+ st_path.st_dev != st_fd.st_dev ||
|
||||
+ st_path.st_ino != st_fd.st_ino)
|
||||
+ return 0;
|
||||
+
|
||||
+ if (fcntl(fd, F_SETFD, flags | FD_CLOEXEC) < 0)
|
||||
+ return 0;
|
||||
+
|
||||
+ return 1;
|
||||
+}
|
||||
+
|
||||
+static int _systemd_handover(struct dm_event_fifos *fifos)
|
||||
+{
|
||||
+ const char *e;
|
||||
+ char *p;
|
||||
+ unsigned long env_pid, env_listen_fds;
|
||||
+ int r = 0;
|
||||
+
|
||||
+ memset(fifos, 0, sizeof(*fifos));
|
||||
+
|
||||
+ /* LISTEN_PID must be equal to our PID! */
|
||||
+ if (!(e = getenv(SD_LISTEN_PID_ENV_VAR_NAME)))
|
||||
+ goto out;
|
||||
+
|
||||
+ errno = 0;
|
||||
+ env_pid = strtoul(e, &p, 10);
|
||||
+ if (errno || !p || *p || env_pid <= 0 ||
|
||||
+ getpid() != (pid_t) env_pid)
|
||||
+ goto out;
|
||||
+
|
||||
+ /* LISTEN_FDS must be 2 and the fds must be FIFOSs! */
|
||||
+ if (!(e = getenv(SD_LISTEN_FDS_ENV_VAR_NAME)))
|
||||
+ goto out;
|
||||
+
|
||||
+ errno = 0;
|
||||
+ env_listen_fds = strtoul(e, &p, 10);
|
||||
+ if (errno || !p || *p || env_listen_fds != 2)
|
||||
+ goto out;
|
||||
+
|
||||
+ /* Check and handle the FIFOs passed in */
|
||||
+ r = (_handle_preloaded_fifo(SD_FD_FIFO_SERVER, DM_EVENT_FIFO_SERVER) &&
|
||||
+ _handle_preloaded_fifo(SD_FD_FIFO_CLIENT, DM_EVENT_FIFO_CLIENT));
|
||||
+
|
||||
+ if (r) {
|
||||
+ fifos->server = SD_FD_FIFO_SERVER;
|
||||
+ fifos->server_path = DM_EVENT_FIFO_SERVER;
|
||||
+ fifos->client = SD_FD_FIFO_CLIENT;
|
||||
+ fifos->client_path = DM_EVENT_FIFO_CLIENT;
|
||||
+ }
|
||||
+
|
||||
+out:
|
||||
+ unsetenv(SD_LISTEN_PID_ENV_VAR_NAME);
|
||||
+ unsetenv(SD_LISTEN_FDS_ENV_VAR_NAME);
|
||||
+ return r;
|
||||
+}
|
||||
+
|
||||
static void usage(char *prog, FILE *file)
|
||||
{
|
||||
fprintf(file, "Usage:\n"
|
||||
@@ -1834,6 +1917,8 @@ int main(int argc, char *argv[])
|
||||
if (_restart)
|
||||
restart();
|
||||
|
||||
+ _systemd_activation = _systemd_handover(&fifos);
|
||||
+
|
||||
if (!_foreground)
|
||||
_daemonize();
|
||||
|
||||
@@ -1852,7 +1937,8 @@ int main(int argc, char *argv[])
|
||||
signal(SIGQUIT, &_exit_handler);
|
||||
|
||||
#ifdef linux
|
||||
- if (!_protect_against_oom_killer())
|
||||
+ /* Systemd has adjusted oom killer for us already */
|
||||
+ if (!_systemd_activation && !_protect_against_oom_killer())
|
||||
syslog(LOG_ERR, "Failed to protect against OOM killer");
|
||||
#endif
|
||||
|
||||
@@ -1863,11 +1949,12 @@ int main(int argc, char *argv[])
|
||||
//multilog_init_verbose(std_syslog, _LOG_DEBUG);
|
||||
//multilog_async(1);
|
||||
|
||||
- _init_fifos(&fifos);
|
||||
+ if (!_systemd_activation)
|
||||
+ _init_fifos(&fifos);
|
||||
|
||||
pthread_mutex_init(&_global_mutex, NULL);
|
||||
|
||||
- if (_open_fifos(&fifos))
|
||||
+ if (!_systemd_activation && _open_fifos(&fifos))
|
||||
exit(EXIT_FIFO_FAILURE);
|
||||
|
||||
/* Signal parent, letting them know we are ready to go. */
|
43
lvm2.spec
43
lvm2.spec
@ -1,4 +1,4 @@
|
||||
%define device_mapper_version 1.02.65
|
||||
%define device_mapper_version 1.02.66
|
||||
%define enable_cluster 1
|
||||
|
||||
%if "%{fedora}" == "12"
|
||||
@ -38,8 +38,8 @@
|
||||
|
||||
Summary: Userland logical volume management tools
|
||||
Name: lvm2
|
||||
Version: 2.02.86
|
||||
Release: 5%{?dist}
|
||||
Version: 2.02.87
|
||||
Release: 1%{?dist}
|
||||
License: GPLv2
|
||||
Group: System Environment/Base
|
||||
URL: http://sources.redhat.com/lvm2
|
||||
@ -48,12 +48,7 @@ Source0: ftp://sources.redhat.com/pub/lvm2/LVM2.%{version}.tgz
|
||||
Source1: %{name}-tmpfiles.conf
|
||||
%endif
|
||||
Patch0: lvm2-set-default-preferred_names.patch
|
||||
Patch1: lvm2-add-systemd-units.patch
|
||||
Patch2: lvm2-systemd-conf-make-support.patch
|
||||
Patch3: lvm2-autoreconf.patch
|
||||
Patch4: lvm2-new-oom-adj-interface.patch
|
||||
Patch5: lvm2-systemd-fds-handover.patch
|
||||
Patch6: lvm2-fix-default_udev_sync.patch
|
||||
Patch1: lvm2-2_02_88-do-not-remove-makefile-on-clean.patch
|
||||
|
||||
BuildRequires: libselinux-devel >= 1.30.19-4, libsepol-devel
|
||||
BuildRequires: ncurses-devel
|
||||
@ -93,12 +88,7 @@ or more physical volumes and creating one or more logical volumes
|
||||
%prep
|
||||
%setup -q -n LVM2.%{version}
|
||||
%patch0 -p1 -b preferred_names
|
||||
%patch1 -p1 -b .systemd_units
|
||||
%patch2 -p1 -b .systemd_conf_make
|
||||
%patch3 -p1 -b .autoreconf
|
||||
%patch4 -p1 -b .oom_adj
|
||||
%patch5 -p1 -b .systemd_fds
|
||||
%patch6 -p1 -b .default_udev_sync
|
||||
%patch1 -p1 -b .clean
|
||||
|
||||
%build
|
||||
%define _exec_prefix ""
|
||||
@ -327,8 +317,10 @@ This package contains shared lvm2 libraries for applications.
|
||||
%dir %{_libdir}/device-mapper
|
||||
%{_libdir}/device-mapper/libdevmapper-event-lvm2mirror.so
|
||||
%{_libdir}/device-mapper/libdevmapper-event-lvm2snapshot.so
|
||||
%{_libdir}/device-mapper/libdevmapper-event-lvm2raid.so
|
||||
%{_libdir}/libdevmapper-event-lvm2mirror.so
|
||||
%{_libdir}/libdevmapper-event-lvm2snapshot.so
|
||||
%{_libdir}/libdevmapper-event-lvm2raid.so
|
||||
|
||||
##############################################################################
|
||||
# Cluster subpackage
|
||||
@ -595,6 +587,27 @@ the device-mapper event library.
|
||||
/usr%{_libdir}/pkgconfig/devmapper-event.pc
|
||||
|
||||
%changelog
|
||||
* Fri Aug 12 2011 Peter Rajnoha <prajnoha@redhat.com> - 2.02.87-1
|
||||
- Cache and share generated VG structs to improve performance.
|
||||
- Suppress locking error messages in monitoring init scripts.
|
||||
- Add global/detect_internal_vg_cache_corruption to lvm.conf.
|
||||
- If pipe in clvmd fails return busy instead of using uninitialised descriptors.
|
||||
- Initialise clvmd locks before lvm context to avoid open descriptor leaks.
|
||||
- Suppress low-level locking errors and warnings while using --sysinit.
|
||||
- Add test for fcntl error in singlenode client code.
|
||||
- Compare file size (as well as timestamp) to detect changed config file.
|
||||
- Change DEFAULT_UDEV_SYNC to 1 so udev_sync is used if there is no config file.
|
||||
- Update udev rules to skip DM flags decoding for removed devices.
|
||||
- Remove device name prefix from dmsetup line output if -j & -m or -u supplied.
|
||||
- Add new segtype 'raid' for MD RAID 1/4/5/6 support with dmeventd plugin.
|
||||
- Add ability to reduce the number of mirrors in raid1 arrays to lvconvert.
|
||||
- Add support for systemd file descriptor handover in dmeventd.
|
||||
- Add systemd unit file to provide lvm2 monitoring.
|
||||
- Add systemd unit files for dmeventd.
|
||||
- Use new oom killer adjustment interface (oom_score_adj) when available.
|
||||
- Fix read-only identical table reload supression.
|
||||
- Remove --force option from lvrename manpage.
|
||||
|
||||
* Wed Aug 03 2011 Peter Rajnoha <prajnoha@redhat.com> - 2.02.86-5
|
||||
- Change DEFAULT_UDEV_SYNC to 1 so udev_sync is used even without any config.
|
||||
|
||||
|
2
sources
2
sources
@ -1 +1 @@
|
||||
3b42dec4d15ad106302a35149082a20e LVM2.2.02.86.tgz
|
||||
4c36c7f216edfe65a6193d2adc389ecd LVM2.2.02.87.tgz
|
||||
|
Loading…
Reference in New Issue
Block a user