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

packageName added to defaultLinuxLogsLocation #620

Closed
fommil opened this issue Jul 7, 2015 · 3 comments
Closed

packageName added to defaultLinuxLogsLocation #620

fommil opened this issue Jul 7, 2015 · 3 comments

Comments

@fommil
Copy link

fommil commented Jul 7, 2015

I had customised defaultLinuxLogsLocation expecting that this would be the logs directory, but actually

https://github.com/sbt/sbt-native-packager/blob/master/src/main/scala/com/typesafe/sbt/packager/archetypes/JavaServerApplication.scala#L54

the /.../logs/NAME directory is created instead.

It would be good if the name was not automatically added. Maybe this could be achieved by having defaultLinuxLogsLocationBase and defaultLinuxLogsLocation so that I could customise the latter.

@fommil
Copy link
Author

fommil commented Jul 8, 2015

fyi, workaround is something like this

    // ANNOYANCE: https://github.com/sbt/sbt-native-packager/issues/620
    defaultLinuxLogsLocation := defaultLinuxInstallLocation.value + "/" + packageName.value + "/logs",
    linuxPackageMappings += packageTemplateMapping(defaultLinuxLogsLocation.value)().
                              withUser((daemonUser in Linux).value).
                              withGroup((daemonGroup in Linux).value),
    linuxPackageMappings := linuxPackageMappings.value.filterNot { m =>
      m.mappings.find(_._2 == (defaultLinuxLogsLocation.value + "/" + packageName.value )).isDefined
    },

and, of course, to be vigilant which one to use in my scripts... including in my workaround for #619

@fommil
Copy link
Author

fommil commented Jul 8, 2015

actually, this isn't working... there is still a default mapping for root:root to own the /opt/NAME/logs directory.

I might have to customise the post-install script to change the permissions.

@fommil
Copy link
Author

fommil commented Jul 8, 2015

hmm, false alarm. Seems that despite there being a second entry, the one I provide wins in terms of owner.

@fommil fommil closed this as completed Aug 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants