Skip to content
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

Closed
wants to merge 5 commits into from

Conversation

tux2bsd
Copy link
Contributor

@tux2bsd tux2bsd commented Dec 16, 2023

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) .

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
@tux2bsd tux2bsd changed the title Update drbd Update drbd: fix script reporting no such file Dec 16, 2023
@tux2bsd tux2bsd changed the title Update drbd: fix script reporting no such file Update drbd: Script reports no such file, it shouldn't. Fixed. Dec 16, 2023
@tux2bsd
Copy link
Contributor Author

tux2bsd commented Dec 17, 2023

@rck fyi

@rck
Copy link
Member

rck commented Dec 19, 2023

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.

@tux2bsd
Copy link
Contributor Author

tux2bsd commented Dec 22, 2023

@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.

@rck
Copy link
Member

rck commented Dec 22, 2023

closing this nonsense now, will apply my proposed patch after the next release

@rck rck closed this Dec 22, 2023
@tux2bsd
Copy link
Contributor Author

tux2bsd commented Dec 22, 2023

@rck you're more pathetic than I could imagine.

@rck
Copy link
Member

rck commented Dec 22, 2023

happy holidays to you as well 🥳

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants