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

Provide means to set umask of user? #1032

Closed
keirlawson opened this issue Sep 22, 2017 · 8 comments · Fixed by #1038
Closed

Provide means to set umask of user? #1032

keirlawson opened this issue Sep 22, 2017 · 8 comments · Fixed by #1038

Comments

@keirlawson
Copy link
Contributor

It would be great if there was some means of setting the umask of a user created by an RPM build via native-packager. Obviously this can be done with some other provisioning tool but this strikes me as a relatively common requirement that might be worth incorporating directly in native-packager?

@muuki88
Copy link
Contributor

muuki88 commented Sep 25, 2017

Take a look at the LinuxPackageMapping. There are already ways of setting POSIX permissions. Is there something missing? This should also be documented in the LinxuPlugin.

Maybe we need to make this more visible.

@keirlawson
Copy link
Contributor Author

I'm wanting to set the default permissions of files created by my process rather than files installed by the package (for example, log files) - for this I need to set the user's umask I believe

@muuki88
Copy link
Contributor

muuki88 commented Sep 26, 2017

Aaaaah. 😃 Thanks for clarifying 😊

That sounds reasonable. What would an ideal API for that look like?

@keirlawson
Copy link
Contributor Author

I guess a daemonUserMask property as part of the Java server application archetype?

@muuki88
Copy link
Contributor

muuki88 commented Sep 26, 2017

With type Option[String] an None as default I guess? Where would we put the umask command. This needs to be part of the bash script, right?

@keirlawson
Copy link
Contributor Author

Ok digging into this a bit more, it seems atleast on our systems (CentOS with System V) the most "correct" place to stick the umask is in /etc/default/appname - so settings the umask can be done already using the etc-default-systemv template. Perhaps rather than adding a new option it might just be better to document this approach for others that might need it?

@muuki88
Copy link
Contributor

muuki88 commented Sep 26, 2017

That sounds even better! 😎
Less settings mean less maintenance.

keirlawson added a commit to keirlawson/sbt-native-packager that referenced this issue Sep 27, 2017
muuki88 pushed a commit that referenced this issue Oct 21, 2017
* Add recipe for setting umask

Closes #1032

* Add explicit reference to Java Server archetype
@mkurz
Copy link
Member

mkurz commented Nov 2, 2019

Added docs for a more general way how to set umask, not just when using System V/systemd: #1274

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants