Bitcoin (Core) cookbook #121
No reviewers
Labels
No Label
service
accounts
service
discourse
service
drone-ci
service
email
service
garage
service
gitea
service
ipfs
service
mastodon
service
postgres
service
remotestorage
service
wiki
service
xmpp
bug
design
dev environment
docs
duplicate
enhancement
feature
good first issue
idea
invalid
kredits-1
kredits-2
kredits-3
on hold
ops
question
release
major
release
minor
release
patch
security
ui/ux
wontfix
No Milestone
No project
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: kosmos/chef#121
Loading…
Reference in New Issue
No description provided.
Delete Branch "feature/bitcoin_cookbook"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Installs and configures Bitcoin Core on Ubuntu via the official snap package. (Update: we now only use the new
source
recipe, which compiles from source.)@gregkare The installation of the actual
bitcoin-core
snap package via thesnap_package
resource makes the chef client process hang for me, and I'm stuck trying to figure out why. I tried to attach strace, but it's too late and I don't see a way of starting the chef run as an argument for strace from within the VM. Maybe you could see if it hangs on your machine, too, and maybe you'd have an idea for how to find out more?Sure, I will investigate
It's not just the bitcoin-core snap package, even the hello-world package has the same behavior. I found this issue on the chef repo: https://github.com/chef/chef/issues/8827
So it looks like
snap_package
is completely broken, at least on Ubuntu 18.04 (and 19.04, as the person who reported the issue is running that). In the mean time we can work around it by not using it, instead doing something like:snap install
returns 0 when a package already exists so no need for a guard clauseI have pushed a few changes, including running
snap install
as an execute command and fixing the mounting of the directory (typo in an attribute name)Great, thanks!
I created an issue about the invalid systemd unit when passing a hash as a config: https://github.com/chef/chef/issues/9259
Doesn't it also add newlines around every key/value pair? I'm pretty sure it did that on my machine.
For me it only adds a newline before the start of a section, so that behavior is correct
Strange. Maybe a difference between Linux and macOS hosts?
Status update:
I wrote a whole new source recipe yesterday (see latest commit), and got everything working as intended. However, I ended up with a leveldb issue when starting bitcoin, which I wasn't able to fix. So I have it re-indexing the whole chain database now.
After a while of indexing, it runs into the same issue. Goes something like:
I have already upped the ulimit for open files to unlimited in the systemd service config (and tried doing it via ulimit before). But somehow it seems to be stuck at the 1024 default, no matter what I do.
I'm wondering if there's a different issue, and this error message is just a symptom. In any case, I'm completely stuck now. Already spent hours trying to fix it.
Anyone has ideas for debugging it further?
Hmm:
So maybe it's worth fixing the ulimit after all.
Unfortunately, the current ulimit cookbook and resource didn't work for me. When I opened a shell as the
satoshi
user, it would always show me the default value again. Same when I tried setting it in/etc/security/limits.conf
.I also set a high value in
/proc/sys/fs/file-max
and ransysctl -p
to apply it, and that also didn't work.I must be doing something terribly wrong for all the normal methods to fail like that.
We're using the ulimit cookbook to set the file handle limit for dirsrv (
2c40ad4591/site-cookbooks/kosmos-dirsrv/resources/instance.rb (L16-L18)
) and that works on barnard:Can you post the code you're using?
I used that exact code when trying it with that resource. The question is not so much about that resource as about none of the various methods working at all.
I found out that limits from
limits.conf
don't apply to systemd services at all, but it still doesn't explain why opening a shell for that user still shows the default limit when there are entries in the config file that change it.https://bugzilla.redhat.com/show_bug.cgi?id=754285
OK, I also just confirmed that this is happening with a ulimit set correctly in a shell session when running the exec command manually. So the issue is something else.
Unfortunately, there's nobody on the Web who had the same issue with this program apparently. :/
Turns out that this is an unknown issue with encfs (and/or leveldb).
I pushed a change to only store the wallet data in encfs, but use the default directory (still configurable) for the rest.
As I nuked all data, it is currently re-syncing the whole chain. So I'm going to revisit this when sync is done.
Another few improvements later, and it's finally finished! 🎉
WIP: Bitcoin (Core) cookbookto Bitcoin (Core) cookbookLooks good to me apart from the Vagrant file change and the license file. I also don't see the ulimit change anywhere, did you forget to push it?
@ -96,3 +96,3 @@
chef.add_recipe 'kosmos-base'
chef.add_recipe 'kosmos_encfs'
# chef.add_recipe 'kosmos-postgresql::default'
# chef.add_recipe 'kosmos-bitcoin::snapd'
I don't think that should have been checked in
Why not? It's commented, so you can uncomment it to easily run the recipe locally. Same as all the other commented recipes.
@ -0,0 +1,3 @@
Copyright 2019 The Authors
The license should be MIT like the other kosmos cookbooks
Which ulimit change are you referring to?
I don't see the code that sets the file handle limit for the satoshi user
That's because...
With systemd services, this is done via the
LimitNOFILE
config.See https://www.freedesktop.org/software/systemd/man/systemd.exec.html#Process%20Properties
(Which also makes the ulimit cookbook obsolete for anything that is run as a systemd service.)
LGTM!
I didn't see the
LimitNOFILE
option in the systemd unit