From dac3c36feb75aac1a7989781dc63fdca4dd5407f Mon Sep 17 00:00:00 2001 From: Peter Rajnoha Date: Thu, 23 Feb 2012 13:31:49 +0000 Subject: [PATCH] Use DEFAULT_RUN_DIR instead of hardcoded value in lvmetad systemd units and add ExecStartPost=vgscan to actually run the first scan that will fill the metadata daemon with metadata information. --- configure | 3 ++- configure.in | 1 + scripts/Makefile.in | 3 ++- scripts/lvm2_lvmetad_systemd_red_hat.service.in | 3 ++- scripts/lvm2_lvmetad_systemd_red_hat.socket.in | 10 ++++++++++ 5 files changed, 17 insertions(+), 3 deletions(-) create mode 100644 scripts/lvm2_lvmetad_systemd_red_hat.socket.in diff --git a/configure b/configure index 644a9b75a..eeae42422 100755 --- a/configure +++ b/configure @@ -10426,7 +10426,7 @@ 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/common/Makefile daemons/dmeventd/Makefile daemons/dmeventd/libdevmapper-event.pc daemons/dmeventd/plugins/Makefile daemons/dmeventd/plugins/lvm2/Makefile daemons/dmeventd/plugins/raid/Makefile daemons/dmeventd/plugins/mirror/Makefile daemons/dmeventd/plugins/snapshot/Makefile daemons/dmeventd/plugins/thin/Makefile daemons/lvmetad/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/raid/Makefile lib/snapshot/Makefile lib/thin/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_lvmetad_systemd_red_hat.service scripts/lvm2_monitoring_init_red_hat scripts/dm_event_systemd_red_hat.service scripts/lvm2_monitoring_systemd_red_hat.service scripts/lvm2_tmpfiles_red_hat.conf scripts/Makefile test/Makefile test/api/Makefile test/unit/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/common/Makefile daemons/dmeventd/Makefile daemons/dmeventd/libdevmapper-event.pc daemons/dmeventd/plugins/Makefile daemons/dmeventd/plugins/lvm2/Makefile daemons/dmeventd/plugins/raid/Makefile daemons/dmeventd/plugins/mirror/Makefile daemons/dmeventd/plugins/snapshot/Makefile daemons/dmeventd/plugins/thin/Makefile daemons/lvmetad/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/raid/Makefile lib/snapshot/Makefile lib/thin/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_lvmetad_systemd_red_hat.socket scripts/lvm2_lvmetad_systemd_red_hat.service scripts/lvm2_monitoring_init_red_hat scripts/dm_event_systemd_red_hat.service scripts/lvm2_monitoring_systemd_red_hat.service scripts/lvm2_tmpfiles_red_hat.conf scripts/Makefile test/Makefile test/api/Makefile test/unit/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 @@ -11152,6 +11152,7 @@ do "po/Makefile") CONFIG_FILES="$CONFIG_FILES po/Makefile" ;; "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_lvmetad_systemd_red_hat.socket") CONFIG_FILES="$CONFIG_FILES scripts/lvm2_lvmetad_systemd_red_hat.socket" ;; "scripts/lvm2_lvmetad_systemd_red_hat.service") CONFIG_FILES="$CONFIG_FILES scripts/lvm2_lvmetad_systemd_red_hat.service" ;; "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" ;; diff --git a/configure.in b/configure.in index 1161c14b7..ca2d19eed 100644 --- a/configure.in +++ b/configure.in @@ -1528,6 +1528,7 @@ man/Makefile po/Makefile scripts/clvmd_init_red_hat scripts/cmirrord_init_red_hat +scripts/lvm2_lvmetad_systemd_red_hat.socket scripts/lvm2_lvmetad_systemd_red_hat.service scripts/lvm2_monitoring_init_red_hat scripts/dm_event_systemd_red_hat.service diff --git a/scripts/Makefile.in b/scripts/Makefile.in index 29d1aef87..5535e4f90 100644 --- a/scripts/Makefile.in +++ b/scripts/Makefile.in @@ -65,7 +65,7 @@ ifeq ("@BUILD_DMEVENTD@", "yes") endif ifeq ("@BUILD_LVMETAD@", "yes") $(INSTALL_DATA) lvm2_lvmetad_systemd_red_hat.socket $(systemd_dir)/lvm2-lvmetad.socket - $(INSTALL_DATA) lvm2_lvmetad_systemd_red_hat.service.in $(systemd_dir)/lvm2-lvmetad.service + $(INSTALL_DATA) lvm2_lvmetad_systemd_red_hat.service $(systemd_dir)/lvm2-lvmetad.service endif install_tmpfiles_configuration: @@ -74,4 +74,5 @@ install_tmpfiles_configuration: 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 \ + lvm2_lvmetad_systemd_red_hat.socket lvm2_lvmetad_systemd_red_hat.service \ lvm2_tmpfiles_red_hat.conf diff --git a/scripts/lvm2_lvmetad_systemd_red_hat.service.in b/scripts/lvm2_lvmetad_systemd_red_hat.service.in index f0f603ed5..09c46e14a 100644 --- a/scripts/lvm2_lvmetad_systemd_red_hat.service.in +++ b/scripts/lvm2_lvmetad_systemd_red_hat.service.in @@ -8,8 +8,9 @@ Conflicts=shutdown.target [Service] Type=forking ExecStart=@sbindir@/lvmetad +ExecStartPost=@sbindir@/vgscan ExecReload=@sbindir@/lvmetad -R -PIDFile=/var/run/lvm/lvmetad.pid +PIDFile=@DEFAULT_RUN_DIR@/lvmetad.pid [Install] WantedBy=sysinit.target diff --git a/scripts/lvm2_lvmetad_systemd_red_hat.socket.in b/scripts/lvm2_lvmetad_systemd_red_hat.socket.in new file mode 100644 index 000000000..ff62da7ba --- /dev/null +++ b/scripts/lvm2_lvmetad_systemd_red_hat.socket.in @@ -0,0 +1,10 @@ +[Unit] +Description=LVM2 metadata daemon socket +DefaultDependencies=no + +[Socket] +ListenStream=@DEFAULT_RUN_DIR@/lvmetad.sock +SocketMode=0600 + +[Install] +WantedBy=sockets.target