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

Must set 'daemonUser in Linux' if daemonUser != name #193

Closed
hfs opened this issue Mar 16, 2014 · 5 comments
Closed

Must set 'daemonUser in Linux' if daemonUser != name #193

hfs opened this issue Mar 16, 2014 · 5 comments

Comments

@hfs
Copy link
Contributor

hfs commented Mar 16, 2014

I use sbt-native-packager to package a Play 2.2 application as .deb for Ubuntu with Upstart. The server stuff in 0.7 is great and I’m already using it. You are solving my problems faster than I could even report them (support for daemonGroup, #178). Awesome work!

I noticed a little thing with 0.7.0-RC1: In my application name is different than daemonUser, and daemonGroup is again different from that. When I only have

daemonUser := 'daemonUser'

in build.sbt, the (empty) directories /var/log/appname and /var/run/appname are owned by appname:daemonGroup instead of daemonUser:daemonGroup. This leads to an additional, unwanted user appname to be created in the postinstall script.

If instead I put both

daemonUser := 'daemonUser'

daemonUser in Linux := 'daemonUser'

in build.sbt, everything to be owned by the process’ user is owned by daemonUser:daemonGroup as expected.

So, a workaround is available, but it would be nicer if only daemonUser had to be set.

@muuki88
Copy link
Contributor

muuki88 commented Mar 17, 2014

Thanks :) This is just a config issue. You have to scope the daemonUser.

daemonUser in Linux := "daemon-user"

daemonGroup in Linux := "daemon-group"

@hfs
Copy link
Contributor Author

hfs commented Mar 18, 2014

Aha! I had an unscoped reference to daemonUser elsewhere in build.sbt and didn’t read the error messages properly… Thanks for your help!

@hfs hfs closed this as completed Mar 18, 2014
@muuki88
Copy link
Contributor

muuki88 commented Mar 18, 2014

Nevermind. Thinking a bit more on this, I'm not sure if the Linux scope is correct here. @jsuereth , @aparkinson would it be better to keep the references of daemonUser and daemonGroup unscoped, so users can define:

daemonUser in Debian := "deb-user"
daemonUser in RPM := "rpm-user"
daemonUser in Windows := "win-user"

@jsuereth
Copy link
Member

I think if we had them appropriately delegate up the chain, it would be ideal.

You want the minimum amount of configuration REQUIRED with the maximum amount of flexibility.

@muuki88
Copy link
Contributor

muuki88 commented Mar 26, 2014

If I get this right

val Debian = config("debian") extend Linux
daemonUser in Linux := "linux-user",

 // will override first one when calling debian:*
daemonUser in Debian := "deb-user"

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

3 participants