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

Run on Debian 12 #46

Closed
BuildWithData opened this issue Oct 7, 2023 · 4 comments
Closed

Run on Debian 12 #46

BuildWithData opened this issue Oct 7, 2023 · 4 comments

Comments

@BuildWithData
Copy link
Contributor

BuildWithData commented Oct 7, 2023

Hi @shannona

I have tried to run the standup script with debian 12 first as you asked here

I am able to run the script and it seems to work

But there is one problem I have encountered during the execution of the script:

./standup.sh - Downloading Bitcoin; this will also take a while!
wget-log: Permission denied; disabling logging.
wget-log: Permission denied; disabling logging.
wget-log: Permission denied; disabling logging.
....

I have checked the standup.log file and got this:

>>> cat /standup.log | grep wget-log | wc -l; wc -l /standup.log
51169
51983 /standup.log

So in short we have roughly 51k rows with this log message.

As we can read from the first line I reported above, these log messages are raised in the bitcoin download section and specifically by the series of wget commands (from row 308 to 312):

sudo -u standup wget https://bitcoincore.org/bin/$BITCOIN/$BITCOINPLAIN-x86_64-linux-gnu.tar.gz -O ~standup/$BITCOINPLAIN-x86_64-linux-gnu.tar.gz
sudo -u standup wget https://bitcoincore.org/bin/$BITCOIN/SHA256SUMS.asc -O ~standup/SHA256SUMS.asc
sudo -u standup wget https://bitcoincore.org/bin/$BITCOIN/SHA256SUMS -O ~standup/SHA256SUMS

sudo -u standup wget https://raw.githubusercontent.com/bitcoin/bitcoin/23.x/contrib/builder-keys/keys.txt -O ~standup/keys.txt

Not an expert here but I cannot understand why a Permission denied error is raised when each wget is run as sudo -u standup

After this series of logs, I'd expect to find the standup folder empty, but instead all files are found:

>>> ls -l /home/standup/
total 43164
-rw-r--r-- 1 standup sudo     2850 Apr 25  2022 SHA256SUMS
-rw-r--r-- 1 standup sudo    13482 Apr 25  2022 SHA256SUMS.asc
-rw-r--r-- 1 standup sudo 44173568 Apr 25  2022 bitcoin-23.0-x86_64-linux-gnu.tar.gz
-rw-r--r-- 1 standup sudo     3591 Oct  7 12:27 keys.txt

I even tried to run this manually like this:

>>> sudo -u standup mkdir /home/standup/manual
>>> sudo -u standup wget https://bitcoincore.org/bin/$BITCOIN/$BITCOINPLAIN-x86_64-linux-gnu.tar.gz -O /home/standup/manual/$BITCOINPLAIN-x86_64-linux-gnu.tar.gz

and it worked smoothly without any wget log error

any idea ?

@shannona
Copy link
Contributor

Hey @BuildWithData, thanks for looking into that.

So it looks like wget is now writing log files. wget-log, wget-log.1, etc. The problem is that when you sudo to ~standup it might end up writing them to a directory where ~standup doesn't have permissions.

So I tested the script in /tmp and it worked fine and I see the logs it created:

-rw-r--r-- 1 sudo 65K Oct 10 18:54 /tmp/wget-log
-rw-r--r-- 1 sudo 551 Oct 10 18:54 /tmp/wget-log.1
-rw-r--r-- 1 sudo 227 Oct 10 18:54 /tmp/wget-log.2

But I ran it in / and it generated exactly the errors you noted.

I think if we add an -o option to all the wget commands run by standup, and make sure it points to somewhere that ~standup can write too, that'll do the trick:

       -o logfile
       --output-file=logfile
           Log all messages to logfile.  The messages are normally reported to standard error.

maybe mkdir ~standup/logs and then -o ~standup/logs/whatever.log?

@BuildWithData BuildWithData mentioned this issue Oct 14, 2023
6 tasks
@BuildWithData
Copy link
Contributor Author

BuildWithData commented Oct 14, 2023

thanks for the explanation @shannona, opened a pull request here

With respect to updating to bitcoin core v0.25, I'll open a separate pull request to keep changes distinct and have a cleaner commit history

@shannona
Copy link
Contributor

Thanks for the very thorough PR. I've tested it through, merged, and updated LBTCftCL too, thanks to your suggestion.

Looking forward to seeing Bitcoin Core 25 as well. Hopefully easy!

@BuildWithData
Copy link
Contributor Author

hi @shannona opened here

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

No branches or pull requests

2 participants