evertrue / zookeeper-cookbook

Chef cookbook for installing and managing Zookeeper.
https://supermarket.chef.io/cookbooks/zookeeper
Apache License 2.0
81 stars 117 forks source link

Create zookeeper user as system user #142

Closed petere closed 9 years ago

petere commented 9 years ago

Note that this will end up not creating a home directory, which might be good or bad. In the latter case, the home directory location should also be configurable.

jeffbyrnes commented 9 years ago

@petere thanks for the contribution! A system doesn’t necessarily not receive a home folder, but it is created in a special range of UIDs reserved for non-person users (see this handy Stack Overflow answer).

For me, :+1:

jeffbyrnes commented 9 years ago

Shipped in v2.12.0

bwhaley commented 8 years ago

@petere pointed out that home dirs are not created, and for me this caused errors in the log like this:

2016-02-20_00:19:38.01251 Feb 20, 2016 12:19:38 AM java.util.prefs.FileSystemPreferences checkLockFile0ErrorCode
2016-02-20_00:19:38.01254 WARNING: Could not lock User prefs.  Unix error code 2.
2016-02-20_00:19:38.01254 Feb 20, 2016 12:19:38 AM java.util.prefs.FileSystemPreferences syncWorld
2016-02-20_00:19:38.01255 WARNING: Couldn't flush user prefs: java.util.prefs.BackingStoreException: Couldn't get file lock.

I work around this in my wrapper cookbook

directory "/home/#{node['exhibitor']['user']}" do
    action :create
    owner node['exhibitor']['user']
    group node['exhibitor']['user']
    mode '0700'
end

But maybe it should be done when the user is created?

jeffbyrnes commented 8 years ago

@bwhaley hmmm, you’re right, I don’t think the home folder is being created. I’m testing that now. I have a vague memory of fixing that by manually creating the home folder for the ZK user a long time ago on our ZK nodes; oops.

Opened a new issue to cover this, #163