-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update drbd: Script reports no such file, it shouldn't. Fixed. #36
Conversation
Fix this error: Starting DRBD resources:/etc/init.d/drbd: line 148: /var/lib/linstor/loop_device_mapping: No such file or directory [
whitespace
if elif else, rather than extra if
maybe it's good to keep that last return 0
@rck fyi |
hm, you did not take the time to prepare a proper commit (including proper commit messages) but now you assume I should do the work for you? I'm actually not too fond of these "fixing whitspaces" kind of commits either. back to something more productive: this is a patch I could imagine merging, would that be sufficient for you? diff --git a/scripts/drbd b/scripts/drbd
index fbed28f2..69d94cb5 100755
--- a/scripts/drbd
+++ b/scripts/drbd
@@ -148,10 +148,14 @@ handle_linstor_loopback()
{
local line dev file loop_mapping
- # new location
- loop_mapping=/var/lib/linstor.d/loop_device_mapping
- # fallback to old location
- [ -f "$loop_mapping" ] || loop_mapping=/var/lib/linstor/loop_device_mapping
+ # new location then fallback to old location
+ if [ -f "/var/lib/linstor.d/loop_device_mapping" ]; then
+ loop_mapping="/var/lib/linstor.d/loop_device_mapping"
+ elif [ -f "/var/lib/linstor/loop_device_mapping" ]; then
+ loop_mapping="/var/lib/linstor/loop_device_mapping"
+ else
+ return 0
+ fi In general I'm only willing to accept the absolute minimum to this shell nonsense, like it or not, we now have proper systemd unit files and I actually wanted to remove this file for a long time. |
@rck you should learn to read, and comprehend. It's not a white space fix, it fixes a bug. Like I said "please squash" because I'd done my bit quickly via github's web interface which doesn't allow me to squash as the project settings need to allow that (apparently). This is a trivial change, I did the "work" in fixing the bug and testing it and finding out it affected others. Your bellyaching that you have to do "work" is simply ridiculous. I only tagged you as you had somewhat recent interaction with the file. But it was my misfortune that you, Roland, are an arrogant and maladjusted individual. |
closing this nonsense now, will apply my proposed patch after the next release |
@rck you're more pathetic than I could imagine. |
happy holidays to you as well 🥳 |
Fixes this error (when started via sysvinit):
Starting DRBD resources:/etc/init.d/drbd: line 148: /var/lib/linstor/loop_device_mapping: No such file or directory [
Related: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1030118
Though in my case I am using Devuan, which is downstream of Debian for most packages (e.g. drbd-utils)
Couple of commits, please squash. I did this quickly only using github's interface... (script tested though) .