-
Notifications
You must be signed in to change notification settings - Fork 443
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
RPM directories not owned by user / group as expected #241
Comments
Is there a way not to specify a target but to declare just the end point with the right permissions and user recurisvely? |
First, try to use the newest RC (0.7.0-RC3). https://github.com/muuki88/sbt-native-packager-examples |
Yes, I think we should add some notes about play pid file because it's not so obvious, but now I am very busy at work unfortunately...( |
great, thanks for the information. I actually had already started using the pidfile.path to the application, after doing a bit of digging about. The issue is though, that the init script starts the application dropping in the pid, which then play sees (because i've passed it in) and decides not to start as the pidfile already exists. Also, the /etc/default isn't something used by RPM's it uses Also i had issues with upgrades of the package, because there was a preuninstall and a postuninstall section for removing the user. But nothing for stopping the application in the preuninstall, so i've had to change it with my own: rpm.preun="if [ \"$1\" = \"0\" ] ; then ; service %{name} stop > /dev/null 2>&1 ; chkconfig --del %{name} ; fi" Otherwise, as it's nohup, it's effecitvely disowning the shell the application was started in, leaving the user logged in and hence, can't delete the user and fails. It might be worth having a |
Is it possible to place my own startup script in the templates directory and it use it or is it only using that for the etc-default template? |
No it should be possible to override the startscript there. Can you post it here or provide a pullrequest with the fixes? |
sure, so in the start-rpm-template
(This defaults to yes unless specified elsewhere i.e. in the /etc/sysconfig/<app_name> configuration file.) Then further down:
This means in my application, i ship a /etc/sysconfig/<app_name> file and inside it i have
So, the startup script won't manage the creation of the pid file but can still kill the process and start the process and get the legitimate play application pid as oppose the pid of the shell that spawned the play application |
Thanks a lot for sharing. I hope we'll be able to integrate this in some way. |
Has to be done after #348 |
I have built the RPM package using sbt-native-package 0.7.0-RC1 and when the application is built and the RPM is installed on centos 6.5, it fails to own the directory with the relevant user of the application %{NAME} as expected.
/usr/share/application is owned by root:root and its contents.
Play is then trying to place a RUNNING_PID inside this directory when it starts, as the %{NAME} user and is unable to do so due to perms.
I have tried changing the permissions on the directory using code found on a similar issue but it failed to work:
Not quite sure how to get the right user and group to own the directories it is creating, i can't see anything in the codebase that identifies in linuxPackageMappings and packageMappings that is identifying the user / group, but this is me just trying to understand the code so probably missing it.
The text was updated successfully, but these errors were encountered: