Closed MarkBarbieri closed 3 years ago
Hey Mark,
Great catch on these, you're quite right, I've fixed all of them here (except for one) and committed the changes to GitHub.
I'm a little bit more confused about your pathing issue. It's starting with a double slash and not ending? I've definitely seen the ending issue when people add a trailing slash at the end of the command but never at the beginning and I'm not sure how this could happen. Can you clarify what path you used and if you used a manual path?
The default directory is the home directory (~). Is your home directory not set for that account by chance and you used the default? I think this could theoretically do this if you have no home directory set, or maybe the home directory is set to /? This can be modified with:
sudo usermod -d /home/username username
That's something to check at least!
Thanks. I didn’t dig deep into the path issue, I can test it further but what I expected was happening is that your template is
/$DirName/minecraftbe/$ServerName/fixpermissions.sh
and $DirName is expanding to /home/username
resulting in double leading ‘/‘
ie: //home/username/minecraftbe/…..
I can try and confirm this today if you want.
I suppose this answers it for me, in the Setup script you create the sudoers drop-in like this:
sudoline="$UserName ALL=(ALL) NOPASSWD: /bin/bash $DirName/minecraftbe/$ServerName/fixpermissions.sh -a, /bin/systemctl start $ServerName, /bin/bash $DirName/minecraftbe/$ServerName/start.sh"
But start.sh has this:
Permissions=$(sudo bash /dirname/minecraftbe/servername/fixpermissions.sh -a)
Note the difference: $DirName
vs /dirname
. This results in //home/username/minecraftbe/
in start.sh
Oh goodness, I see it now, thanks again Mark!
I've cleaned up this last one as well and committed the changes. I'm glad everything is working on your end now.
I feel kind of bone headed for missing them but the truth is essentially all software has mistakes like this and the more complicated it is the more things like this you'll find even in 20-30 year old codebases like Windows etc.
The benefit of open source is you guys can look at it and point out when the author(s) make mistakes. Ideally thanks to the community collaboration we can end up in a much better place than it ever could have if it was closed source/private. Thanks again!
Absolutely, no problem at all thanks. Thanks for fixing, and creating this in the first place.
I'm using Debian Bullseye
Today I ran the latest installer script over the top of an existing install from a few months ago
https://raw.githubusercontent.com/TheRemote/MinecraftBedrockServer/master/SetupMinecraft.sh
Following this action, the service no longer starts (I'm using systemd, but this is not the issue)
Several issues on this line: https://github.com/TheRemote/MinecraftBedrockServer/blob/master/start.sh#L58
And the sudoers drop-in: https://github.com/TheRemote/MinecraftBedrockServer/blob/master/SetupMinecraft.sh#L224
-a
' parameter so it matches the scriptSo the line in start.sh should be more like:
Permissions=$(sudo /bin/bash dirname/minecraftbe/servername/fixpermissions.sh -a)
and the drop-in
sudoline="$UserName ALL=(ALL) NOPASSWD: /bin/bash $DirName/minecraftbe/$ServerName/fixpermissions.sh -a, /bin/systemctl start $ServerName, /bin/bash $DirName/minecraftbe/$ServerName/start.sh"
Thanks