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

375 Commits

Author SHA1 Message Date
Zdenek Kabelac
35df4b10eb shellcheck: some apostrophe changes and cleanups 2017-10-25 22:02:54 +02:00
Zdenek Kabelac
34618c2d30 scripts: paths update
Correct usage of sbindir also for scripts so the path
no longer needs resolving more vars like exec_prefix & prefix.
2017-10-25 22:02:54 +02:00
Zdenek Kabelac
d809fbb541 systemd: use proper sbindir path
Replace lowercase  @sbindir@  with  @SBINDIR@ which contains
fully decoded path.

Same with  @usrsbindir@ which is also used with clvmd and cmirrord.

Also handle SYSCONFDIR for EnvironmentFile.

Patch fixes generated unit files with strings like:
ExecStart=${exec_prefix}/sbin/lvm
2017-10-25 22:02:54 +02:00
Ondrej Kozina
dcc8f90c58 fsadm: refactor resize_crypt function
split resize_crypt function in two.

a) Detect proper dm-crypt device type and count new --size
   value for cryptsetup resize command.

b) Perform the resize
2017-10-24 13:41:16 +02:00
Ondrej Kozina
9916d8fa9a fsadm: rename local variables to avoid confusion 2017-10-24 13:41:09 +02:00
Ondrej Kozina
af781897fa fsadm: fix bug in LUKS grow/shrink decision branch 2017-10-24 13:40:54 +02:00
Ondrej Kozina
6df7917581 fsadm: add luks specific error message for small devices 2017-10-24 13:40:50 +02:00
Ondrej Kozina
f5beb58561 fsadm: implement 'check' for a fs on top of LUKS 2017-10-11 14:39:22 +02:00
Ondrej Kozina
c795a3b37f fsadm: fail 'check' explicitly on unsupported fs type 2017-10-11 14:39:15 +02:00
Ondrej Kozina
74fd0dd6c4 fsadm: respect DM_DEV_DIR variable 2017-10-11 14:39:07 +02:00
Ondrej Kozina
59145715f1 fsadm: minor fixes for crypt support
drop useless asterisk expansion
enforce matching string prefix by adding ^
2017-10-10 15:21:35 +02:00
Ondrej Kozina
30293baaa0 fsadm: add support for crypt devices 2017-10-10 14:18:57 +02:00
Thomas Lamprecht
a781b1c178 dmeventd: ensure systemd service gets stopped on shutdown
Add these for dmeventd systemd unit (dm-event.service):

  Before: shutdown.target
  Conflicts: shutdown.target

This will cause the dmeventd to be properly stopped at shutdown (after
all the dmeventd clients unregistered their devices from monitoring)
with dm-event.service's stop action (there's no direct action defined
for the "stop" so systemd sends SIGTERM instead).

Before, we let dmeventd to get killed only as part of the very last
SIGTERM/SIGKILL for all the remaining processes late in the shutdown
sequence so we may have missed some logs if dmeventd encountered an
error during its shutdown (logging facilities are already off at this
late time in shutdown sequence).

Ref: https://www.redhat.com/archives/lvm-devel/2017-October/msg00000.html
2017-10-05 13:01:55 +02:00
Zdenek Kabelac
3ae8adce92 fsadm: add --help
Newer version of blockdev tool needs --help as the tool is no longer
printing help without this option like it used to in past.
2017-10-05 10:23:20 +02:00
Peter Rajnoha
b0f4e0fcec blkdeactivate: cleanup
Use a different variable for translated name in dm/md_deactivate fn
Fix dmraidoption/dmraidoptions in man page.
2017-09-22 11:10:57 +02:00
Peter Rajnoha
096fcb5a6e blkdeactivate: also try to unmount /boot on blkdeactivate -u if on top of supported device
There's nothing special about /boot other than it's used during boot.
But when blkdeactivate is called either on all devices or including a
device where the /boot is on top, we should also include this mount
point when doing unmount before deactivation of supported devices.
2017-09-21 17:15:48 +02:00
Peter Rajnoha
584b4ae38b blk-availability: use blkdeactivate -r wait in blk-availability systemd service/initscript 2017-09-21 17:10:15 +02:00
Peter Rajnoha
95087c8f96 blkdeactivate: add blkdeactivate -r wait option to wait for MD resync/recovery/reshape
The new blkdeactivate -r|mdraidoption wait causes blkdeactivate to wait
for any resync/recovery/reshape that is currently in progress before
deactivating the device.

If this option is used, blkdeactivate calls mdadm -W|--wait before
mdadm -S|--stop.
2017-09-21 17:10:15 +02:00
Peter Rajnoha
7fa0d52262 blkdeactivate: fix blkdeactivate regression with failing DM/MD devs deactivation
Revert dc50f2f4a0.

We're canonicalizing/escaping the names here and we're reusing the
variable name so the code doesn't need to use extra variables and
further assignments that may confuse us. Let's keep the code simple.

The

   local name=(...$name)

is not the same as

   local name
   name=(...$name)

(I know various code-checking tools fuss about this and recommend
the 2nd way, but let's ignore those tools' nitpicking here please.)
2017-09-21 17:10:15 +02:00
Peter Rajnoha
9f34125d5d blkdeactivate: fix --{dm,lvm,mpath}options option name recognition
There was a typo in blkdeactivate --dmoption/--lvmoption/mpathoption,
it had missing "s" at the end and it was not recognized properly, only
short names for the options (-d/-l/-m).
2017-09-21 17:08:44 +02:00
Zdenek Kabelac
ad44543e81 makefiles: script executable missed dynamic
Add missing  ELDFLAGS when linking binary.
Also pass CFLAGS for cases where we build code coverage compilation.
2017-08-01 18:32:16 +02:00
Zdenek Kabelac
95dd5bc7fb configure: tune BUILD_DMEVENTD
Drop 'DMEVENT' make variable and use  BUILD_DMEVENTD like with other daemons.
NOTE: by default we do not build dmeventd - maybe time to change
as lot of build targets basically do need dmeventd...

Switch to use SYSTEMD_LIBS and avoid linking systemd library with
every linked tool when dbus notification are enabled.
(TODO  add missing testing for lib presence)
2017-08-01 18:17:06 +02:00
Zdenek Kabelac
73bbd5528c tests: scripts double quote 2017-07-10 14:23:53 +02:00
Zdenek Kabelac
191dadc623 clvmd_fix_conf.sh: double quote 2017-06-29 22:23:16 +02:00
Zdenek Kabelac
99925d0d41 clvmd_fix_conf.sh: legacy code
Use $(..) instead of legacy `..`.
2017-06-29 22:23:16 +02:00
Zdenek Kabelac
afa0bd916e vgimportclone.sh: do not quote regex
Don't quote rhs of =~, it'll match literally rather than as a regex.
2017-06-29 22:23:16 +02:00
Zdenek Kabelac
ef4506069a vgimportclone.sh: use well defined tests
Prefer [ p ] && [ q ] as [ p -a q ] is not well defined.
Prefer [ p ] || [ q ] as [ p -o q ] is not well defined.
2017-06-29 22:23:16 +02:00
Zdenek Kabelac
8dc29d7cc7 vgimportclone.sh: drop extra $
$/${} is unnecessary on arithmetic variables.
2017-06-29 22:23:16 +02:00
Zdenek Kabelac
16a38dede9 vgimportclone.sh: add -r to read
read without -r will mangle backslashes.
2017-06-29 22:23:16 +02:00
Zdenek Kabelac
588b12e71d vgimportclone.sh: avoid legacy syntax
Use $(..) instead of legacy `..`.
2017-06-29 22:23:16 +02:00
Zdenek Kabelac
d745593e89 vgimportclone.sh: cannot trap signal 9 2017-06-29 22:23:16 +02:00
Zdenek Kabelac
275eeb4631 vgimportclone.sh: double quote 2017-06-29 22:23:16 +02:00
Zdenek Kabelac
96a2e00240 vgimportclone.sh: no mixing string and array
Argument mixes string and array. Use * or separate argument.
2017-06-29 22:23:16 +02:00
Zdenek Kabelac
4d34bc65dd lvm2_cluster_activation_red_hat.sh: double quote 2017-06-29 22:23:16 +02:00
Zdenek Kabelac
051c7f88cf lvmconf_lockingtype2: double quote 2017-06-29 22:23:16 +02:00
Zdenek Kabelac
ef8691a2d2 lvmconf_lockingtype2: preferable syntax
Prefer [ p ] || [ q ] as [ p -o q ] is not well defined.
2017-06-29 22:23:16 +02:00
Zdenek Kabelac
030912ec03 lvmdump: replace individual redirects
Consider using { cmd1; cmd2; } >> file instead of individual redirects.
2017-06-29 22:23:16 +02:00
Zdenek Kabelac
df57845f61 lvmdump: drop useless cat
Useless cat. Consider 'cmd < file | ..' or 'cmd file | ..' instead.
2017-06-29 22:23:16 +02:00
Zdenek Kabelac
a458065aa1 lvmdump: legacy syntax
Use $(..) instead of legacy `..`.
2017-06-29 22:23:16 +02:00
Zdenek Kabelac
a0740f831c lvmdump: drop extra $
$/${} is unnecessary on arithmetic variables.
2017-06-29 22:23:16 +02:00
Zdenek Kabelac
e08e714b68 lvmdump: replace printf
Don't use variables in the printf format string. Use printf "..%s.." "$foo".
Advice replaced with plain 'echo'.
2017-06-29 22:23:16 +02:00
Zdenek Kabelac
e292c1a1ca lvmdump: double quote
Double quote to prevent globbing and word splitting.
2017-06-29 22:23:16 +02:00
Zdenek Kabelac
6330e2dc86 lvmconf: prefer well defined and
Prefer [ p ] && [ q ] as [ p -a q ] is not well defined.
2017-06-29 22:23:16 +02:00
Zdenek Kabelac
ccdb75adcc lvmconf: double quote 2017-06-29 22:23:16 +02:00
Zdenek Kabelac
de04e36fda lvmconf: fix test for setting external locking type
Fix test for check of set locking lib dir.
2017-06-29 22:23:16 +02:00
Zdenek Kabelac
daa372f78d blkdeactivate: quote literal
This { is literal. Check expression (missing ;/\n?) or quote it.
2017-06-29 22:23:16 +02:00
Zdenek Kabelac
b5fc0d73e5 blkdeactivate: more readable if-then-else-fi 2017-06-29 22:23:16 +02:00
Zdenek Kabelac
dc50f2f4a0 blkdeactivate: split local declaration and assign 2017-06-29 22:23:16 +02:00
Zdenek Kabelac
ce1383fe46 blkdeactivate: drop unused var 2017-06-29 22:23:16 +02:00
Zdenek Kabelac
45861557b5 blkdeactivate: double quote
Using double quote to prevent globbing and word splitting.
2017-06-29 22:23:16 +02:00