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

home directory not writable by default #63

Open
williamtsoi1 opened this issue May 13, 2016 · 7 comments
Open

home directory not writable by default #63

williamtsoi1 opened this issue May 13, 2016 · 7 comments

Comments

@williamtsoi1
Copy link
Contributor

Hi,

Using this module and the defaults for the home directory (ie. /srv), the ownership of this directory chowned to the nexus user, and so nexus isn't able to create the /srv/.java folder in order to store preferences. Leading to errors similar to:

https://issues.sonatype.org/browse/NEXUS-3671

@kenbreeman
Copy link
Contributor

Not sure I understand the issue correctly.

The permissions for the home directory should be set in a way that allows the nexus user to write to that directory:
https://github.com/hubspotdevops/puppet-nexus/blob/master/manifests/package.pp#L84-L91

Why isn't the .java folder able to be created?
Would it make sense to include creation of that .java folder in this puppet module?

@peterabbott
Copy link

I found that I had to override the home directory variable in hiera to something nested like /opt/nexus for it to properly work. The issue I found was that setting the root path for nexus to /srv (or in my case /opt) set the service users' home dir to that. It was created as root instead of the user so when the service ran it did not have permissions to write to the directory.

@williamtsoi1
Copy link
Contributor Author

maybe then setting the default in the module to /srv/nexus or even /opt/nexus would be a better choice?

@kenbreeman
Copy link
Contributor

The default is currently /srv/nexus

We set the root here:
https://github.com/hubspotdevops/puppet-nexus/blob/master/manifests/params.pp#L29-L30
We set the home here:
https://github.com/hubspotdevops/puppet-nexus/blob/master/manifests/package.pp#L47

Are you using the latest version? Am I missing something?

@tmclaugh
Copy link
Contributor

tmclaugh commented Sep 2, 2016

The module extracts the nexus package to $nexus_root, creating a directory with the nexus version number in it. That directory is represented by $nexus_home_real

$nexus_home is created at the end as a symlink to the currently running version under $nexus_home_real.

It's confusing but was the best idea I could come up with at the time. Not sure of a better way to handle that version number.

@peterabbott
Copy link

The issue is not necessarily with the location /srv/nexus (although /opt/nexus would be a more standard install location), it is the user that gets created to run the service.

If you look at /etc/passwd you will see that it is set to /srv (using all defaults from params.pp). So when the service is started there is something inside the application that is trying to write to the users' home directory (assuming java property 'user.home').

My working around was to set the nexus_root to /opt/nexus and the service would start without any intervention.

@tmclaugh
Copy link
Contributor

tmclaugh commented Sep 3, 2016

It's just a minor fix to the user resource in init.pp.

Sent from my iPhone

On Sep 3, 2016, at 2:25 AM, Peter Abbott [email protected] wrote:

The issue is not necessarily with the location /srv/nexus (although /opt/nexus would be a more standard install location), it is the user that gets created to run the service.

If you look at /etc/passwd you will see that it is set to /srv (using all defaults from params.pp). So when the service is started there is something inside the application that is trying to write to the users' home directory (assuming java property 'user.home').

My working around was to set the nexus_root to /opt/nexus and the service would start without any intervention.


You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.

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

4 participants