1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00
Commit Graph

176 Commits

Author SHA1 Message Date
Peter Rajnoha
9952331d5d make: fix make in scripts dir for --disable-applib 2012-08-01 15:48:53 +02:00
Peter Rajnoha
e309586aeb systemd: O_CLOEXEC not needed in activation generator
O_CLOEXEC not actually needed, this is just a simple program,
it is not supposed to fork/exec anywhere and anytime in the future.
2012-08-01 08:57:12 +02:00
Peter Rajnoha
c6cc871df8 make: use proper libs to make scripts subdir 2012-08-01 08:42:49 +02:00
Peter Rajnoha
fa68466e90 systemd: integrate lvm2 activation generator with conf+make 2012-07-31 16:46:24 +02:00
Peter Rajnoha
d3e67ba8ca systemd: add lvm2 activation generator
The lvm2 activation generator generates systemd units conditionally
based on the global/use_lvmetad lvm.conf setting.

If use_lvmetad=0, the lvm2-activation-early.service and lvm2-activation.service
units will be generated. These units are responsible for direct volume activation
by calling "vgchange -aay --sysinit" (this is actually the original on-boot
activation as it was used before). If use_lvmetad=1, no units will be generated
as we're relying on autoactivation.

Important thing to note is that the lvm2-activation units normally bring
in the udev-settle ("storage-wait") service that waits for udev to settle
(with block devices). We don't need this if lvmetad is used in conjunction
with autoactivation feature... but systemd units can't be enabled or disabled
(or dependencies added/removed) dynamically based on external configuration.

Therefore, we need the unit generator which adds support for such situations:
the units as a whole either exist or not based on the external configuration.
2012-07-31 16:20:24 +02:00
Peter Rajnoha
9161308252 systemd: ensure monitoring is handled after lvmetad
Monitoring is handled using "vgchange --monitor" call. Ensure that lvmetad is up
and running at the time of this call to prevent any fallback to direct scan
within the vgchange. The same applies for shutdown sequence but the other way
round - switch monitoring off and lvmetad afterwards.
2012-07-26 11:30:27 +02:00
Peter Rajnoha
d84e1ae5f2 systemd: add doc reference in dm-event.socket 2012-06-29 13:54:35 +02:00
Peter Rajnoha
2d5adc5823 initscript: call vgchange -aay instead of -aly
The clmvd init script called "vgchange -aly" before to activate
all VGs in cluster environment. This activated all VGs, no matter
if it was clustered or not.

Auto activation for clustered VGs is not supported yet so the behaviour
of -aay is still the same as before for clustered VGs. However, for
non-clustered VGs, we need to check with the activation/auto_activation_volume_list
whether the VG/LV should be activated on boot or not.
2012-06-28 09:44:07 -04:00
Peter Rajnoha
9a96f930a7 configure: run directory configuration cleanup
There were several hard-coded values for run directory around the code.
Also, some tools are DM specific only, others are LVM specific and there
was no distinction made here before. With this patch applied, we have
this cleaned up a bit (subsystem in brackets, defaults in parentheses):

          [common] configurable PID_DIR     (/var/run)

 lvm      [lvm]    configurable RUN_DIR     (/var/run/lvm)
                   configurable locking dir (/var/lock/lvm)

 clvmd    [lvm]    configurable pid file    (PID_DIR/clvmd.pid)
                   socket                   (RUN_DIR/clvmd.sock)

 lvmetad  [lvm]    configurable pid file    (PID_DIR/lvmetad.pid)
                   socket                   (RUN_DIR/lvmetad.socket)

 dm       [dm]     configurable DM_RUN_DIR  (/var/run)

 cmirrord [dm]     configurable pid file    (PID_DIR/cmirrord.pid)

 dmeventd [dm]     configurable pid file    (PID_DIR/dmeventd.pid)
                   server fifo              (DM_RUN_DIR/dmeventd-server)
                   client fifo              (DM_RUN_DIR/dmeventd-client)

The changes briefly:
  - added configure --with-default-pid-dir
  - added configure --with-default-dm-run-dir
  - added configure --with-lvmetad-pidfile
  - by default, using one common pid directory for everything
    (only lvmetad was not following this before)
2012-06-27 12:11:47 +02:00
Peter Rajnoha
e77803edc9 systemd: Add Documentation references
These documentation references show up in "systemctl status" output.
2012-06-20 14:23:50 +02:00
Alasdair G Kergon
a2a37f8fee More .gitignore files for an in-source-tree build.
Tell git to ignore files generated by a build inside the source tree.
2012-06-08 16:34:43 +01:00
Alasdair G Kergon
d644d4e14e Add .gitignore files for an in-source-tree build.
Tell git to ignore files generated by a build inside the source tree.
2012-06-08 16:26:21 +01:00
Alasdair G Kergon
bb2a2bb3ff Remove obsolete CVS helper script.
Remove last_cvs_update.sh now that we're using git.
2012-06-07 14:06:01 +01:00
Alasdair Kergon
0efcdc3ad9 . 2012-04-19 13:47:38 +00:00
Alasdair Kergon
8ae2ca5ff7 . 2012-04-19 13:47:11 +00:00
Peter Rajnoha
973cfb19b7 Add udev info and context to lvmdump.
--------------------------------------------------------------------
2012-04-18 15:26:02 +00:00
Jonathan Earl Brassow
68d84fa3eb Add a couple new functions to gdbinit file and decode a couple lv->status flags
New functions:
 - seg_pvs: Print a list of PVs in a seg_pvs list
 - pv_dev_name: print name of a PV
2012-04-10 23:24:00 +00:00
Peter Rajnoha
d837eebdcc Use pvscan --cache instead of vgscan in lvmetad init script and systemd unit. 2012-03-16 15:12:04 +00:00
Zdenek Kabelac
a9382908ae Fix string parsing
Fix propagation of -e option - pass it via internal shell variable.
Fix parsing of /proc/mounts files (don't check for substrings).
 as reported by O.Mangold with suggested patch:
 https://www.redhat.com/archives/linux-lvm/2012-February/msg00030.html
Properly pass arguments with spaces ("$@")
Add validation for YES and EXTOFF variable content.
2012-03-16 12:53:05 +00:00
Peter Rajnoha
93945bb616 Use SD_ACTIVATION env. var. in systemd units to better detect systemd in use.
LISTEN_PID and LISTEN_FDS environment variables are defined only during systemd
"start" action. But we still need to know whether we're activated during
"reload" action as well - we use the reload action to call "dmeventd -R"/"lvmetad -R"
for statefull daemon restart. We can't use normal "restart" as that is simply
composed of "stop" and "start" and we would lose any state the daemon has.
2012-03-14 15:51:51 +00:00
Peter Rajnoha
aeb7a93796 Add 'Restart: on-abort' for lvmetad systemd service.
Restart lvmetad automatically if it exits due to reception of uncaught signal,
leaving a track in systemd log/syslog.
2012-03-08 09:49:09 +00:00
Peter Rajnoha
9e23089757 LVMetaD socket operates in non-blocking mode. 2012-02-28 13:07:03 +00:00
Peter Rajnoha
792343a694 lvmetad.socket 2012-02-27 15:45:49 +00:00
Peter Rajnoha
56ca71bd8e Use 'killproc' fn in lvmetad init script (fn provided by 'functions' init script library). 2012-02-27 08:56:46 +00:00
Peter Rajnoha
e6fa4a095e Also remove intermediate lvmetad init script file. 2012-02-24 15:07:00 +00:00
Peter Rajnoha
8c3c020a56 Use '-p PID_FILE' for the status call since the pidfile is in its own lvm subdir and return proper status code. 2012-02-24 13:45:37 +00:00
Peter Rajnoha
97c2309e19 The daemon as well as the first scan must be both executed properly, otherwise it's an error! 2012-02-24 13:11:57 +00:00
Peter Rajnoha
a30491b25f Add LVMetaD init script. 2012-02-24 13:03:50 +00:00
Peter Rajnoha
f84d6048cf Use 'd' instead of 'D' in tmpfiles configuration to not overwrite any existing directory.
...that happens when systemd creates it first (e.g. based on a .socket unit)
before the tmpfiles.d content is executed.
2012-02-23 14:24:30 +00:00
Peter Rajnoha
840bc23ee1 Remove the old systemd socket file, we're using the .in template now. 2012-02-23 13:39:08 +00:00
Peter Rajnoha
dac3c36feb 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.
2012-02-23 13:31:49 +00:00
Petr Rockai
dae0822698 The lvmetad client-side integration. Only active when use_lvmetad = 1 is set in
lvm.conf *and* lvmetad is running.
2012-02-23 13:11:07 +00:00
Peter Rajnoha
da532741c9 Add LVMetaD systemd units. 2012-02-23 11:24:07 +00:00
Peter Rajnoha
2c893455ad Install lvm2 monitoring init script and systemd units only if dmeventd is built. 2012-02-23 11:13:18 +00:00
Peter Rajnoha
7044863afc Clean intermediate files. 2012-02-23 10:01:12 +00:00
Peter Rajnoha
0da6c851bd Add lvm2 tmpfiles.d configuration file. 2012-02-22 18:02:31 +00:00
Peter Rajnoha
4417a8bd40 Add configure --with-tmpfilesdir and lvm2 tmpfiles.d configuration file itself.
/etc/tmpfiles.d directory holds configuration files for temporary/volatile
files and directories that should be automatically managed. For example,
if we have some parts of the fs hierarchy on tmpfs, we'd like to recreate
some files or directories on every boot so they're always prepared for use.

Systemd can read such configuration files. For now, the lock and run directory
are the ones that are most probably placed on tmpfs. If this is the case, we
can install the configuration by 'make install_tmpfiles_configuration'.
2012-02-22 17:55:10 +00:00
Peter Rajnoha
b627165a75 Clean up systemd unit ordering and requirements. 2012-02-01 13:08:39 +00:00
Peter Rajnoha
32e53e506d Use also normalized output for vgchange command in lvm2-monitor init script. 2011-12-16 11:42:56 +00:00
Peter Rajnoha
0644371f09 Fix lvm2-monitor init script to use normalized output when using vgs. 2011-12-07 12:29:41 +00:00
Alasdair Kergon
630b4c2111 Move gentoo MAKEDEV to /sbin in lvm2create_initrd. (James Le Cuirot) 2011-11-12 17:03:53 +00:00
Peter Rajnoha
8626490ca7 Add "ExecReload" to dm-event.service for systemd to reload dmeventd properly.
Normally, restart simply means "stop and start" for systemd. However, if
we're installing new versions of the dmeventd binary/libdevmapper, we need
to restart dmeventd. This fails if we have some devices monitored - we need
to call "dmeventd -R" instead.

The "ExecReload" did not work quite well in some old versions of systemd,
systemd assumed that only the configuration is reloaded on "ExecReload",
not the whole binary itself so it lost track of dmeventd daemon (it lost new
dmeventd PID). This is fixed and seems to be working fine now with recent
versions of dmeventd.
2011-10-31 12:22:49 +00:00
Jonathan Earl Brassow
9aedb1431f New handy gdb debugging function, "dm_list_size"
Example:
(gdb) dm_list_size &split_images
1 list items
2011-09-28 16:32:22 +00:00
Zdenek Kabelac
00e72fcfee Fix install_ocf
When builddir is different from srcdir install_ocf: has not been able to find
files for installation.
2011-09-24 21:05:03 +00:00
Zdenek Kabelac
8f8c5580fd Add support for DM_DEV_DIR
Follow other commands support this directory setting.
Useful for test suite.
2011-09-19 19:36:52 +00:00
Zdenek Kabelac
13e3c25ade Add support for non /dev devices
Since test suite is not using /dev - add support for such dirs into fsadm.
2011-09-19 14:52:33 +00:00
Zdenek Kabelac
53c09bce42 Support different PATH setting
When fsadm is test - it needs to execute lvm and fsadm from non-standard path
setting.   So adding a support in fsadm script when user set LVM_BINARY, then
the lvm command invoced from fsadm will have the same PATH setting as before
entering  fsadm command.

Needed for testing.
2011-09-19 13:51:09 +00:00
Zdenek Kabelac
d2010960c9 Surround all executed commands with quotes
In case someone would use filename paths with spaces when changing
this script surround commands with '"'.

With default settings there is no change in behavior.
2011-09-19 13:47:37 +00:00
Zdenek Kabelac
dd96ceda43 Fix missing '$' in test 2011-09-19 13:43:50 +00:00
Jonathan Earl Brassow
08c50a291e reorder some status flag printing in gdbinit file. 2011-09-13 13:57:02 +00:00