LINBIT / drbd-utils

DRBD userspace utilities (for 9.x, 8.4, 8.3)
GNU General Public License v2.0
78 stars 46 forks source link

drbd: only rmmod if DRBD is a module #2

Closed sandy-lcq closed 5 years ago

sandy-lcq commented 6 years ago

Account for the case if the DRBD drive is built into the kernel. Otherwise, errors, like the following, will occur:

root@localhost:~# /etc/init.d/drbd stop Stopping all DRBD resources: ERROR: Module drbd does not exist in /proc/modules

rck commented 6 years ago

Hm, why would one cat | grep and then string check for -z when

if grep -qw drbd /proc/modules; ...

does the same?

Besides that it does not really fix the whole mess. So you don't try to rmmod (good), but you also don't break the loop (bad), so you run a second retry loop.

This needs a more careful look, I don't take your change, but I will look into it eventually.

Thanks, rck

rck commented 5 years ago

should be fixed in: https://github.com/LINBIT/drbd-utils/commit/d994b5b6ced9f2ee10e497204161aa5dc88a80b0