-
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
Creation of the daemon user and group is missing when installing a generated rpm on CentOS 6 ( in v. 0.7.0-RC2 ) #221
Comments
Simple workaround: NativePackagerKeys.rpmPretrans := Some("groupadd -r pim-service ; useradd -r -g pim-service pim-service") But i do not think that it should be necessary. My first attempt for a workarround was using the rpmPre setting: NativePackagerKeys.rpmPre := Some("groupadd -r pim-service ; useradd -r -g pim-service pim-service") But that did not work. The user was not created at all, and running the install with debug output, indicate that rpm did not try to run the commands at all. |
Have you added the Also you can replace the |
Checking the scriplets can be done with this command rpm2cpio your.rpm | cpio -i --make-directories |
Yes packageArchetype.java_server is added. I will try to se what scriplets that get generated. |
I could not figure out how to see the scriptlet with rpm2cpio your.rpm | cpio -i --make-directories but rpm -qp --scripts <rmpFile> gives a nice description of the scriptlets in an rpm. For my package it show 2 interesting things:
rpm -qp --scripts pim-service-3.8.0-0.noarch.rpm
postinstall scriptlet (using /bin/sh):
service pim-service start
preuninstall scriptlet (using /bin/sh):
# Removing system user/group : pim-service and pim-service
echo "Try deleting system user and group [pim-service:pim-service]"
if getent passwd | grep -q "^pim-service:";
then
echo "Deleting system user: pim-service"
userdel pim-service
fi
if getent group | grep -q "^pim-service:" ;
then
echo "Deleting system group: pim-service"
groupdel pim-service
fi
# Halting pim-service
echo "Shutdown pim-service"
service pim-service stop
postuninstall scriptlet (using /bin/sh):
# Removing system user/group : pim-service and pim-service
echo "Try deleting system user and group [pim-service:pim-service]"
if getent passwd | grep -q "^pim-service:";
then
echo "Deleting system user: pim-service"
userdel pim-service
fi
if getent group | grep -q "^pim-service:" ;
then
echo "Deleting system group: pim-service"
groupdel pim-service
fi |
Sorry, my bad. This was the wrong script. Hm. This looks not good. Which version are you using? |
I will check this, this evening and fix it within this PR #219 |
Sounds good, thank you. Yes i use 0.7.0-RC2 |
I was wondering why my first workaround did not work where i used the rpmPre setting instead of the rpmPretrans, and it turns out the the rpmPre setting is not resulting in a scriptlet in the generated rpm at all. Should i create a seperate issue on that? |
Yeah, that would be nice. With the small set of settings to reproduce the error. Thanks :) |
Checkout #219 and see if this work for you. If yes, I would close this. |
I will, but it will properly firs be tomorrow, my calendar is pretty packed today, sorry :( The same goes for the other issue i promised to create. |
Well i found some time, but i could not get it to work. I am not a experienced user of github, so just to be sure, it was this commit your wanted me to test?: 3b7c243 With that i get the following: rpm -qp --scripts /tmp/pim-service-3.8.0-0.noarch.rpm
postinstall scriptlet (using /bin/sh):
chgrp pim-service /etc/pim-service/tsapi.pro ; chmod g+w /etc/pim-service/tsapi.pro
preuninstall scriptlet (using /bin/sh):
# Halting pim-service
echo "Shutdown pim-service"
service pim-service stop
postuninstall scriptlet (using /bin/sh):
# Removing system user/group : pim-service and pim-service
echo "Try deleting system user and group [pim-service:pim-service]"
if getent passwd | grep -q "^pim-service:";
then
echo "Deleting system user: pim-service"
userdel pim-service
fi
if getent group | grep -q "^pim-service:" ;
then
echo "Deleting system group: pim-service"
groupdel pim-service
fi and when i try to install it: rpm -ihv /tmp/pim-service-3.8.0-0.noarch.rpm
Preparing... ########################################### [100%]
1:pim-service ########################################### [100%]
warning: user pim-service does not exist - using root
warning: group pim-service does not exist - using root
warning: user pim-service does not exist - using root
warning: group pim-service does not exist - using root
chgrp: invalid group: `pim-service' |
I think you should checkout the complete pull request. Instructions can be found here then git checkout pr/219
sbt publish-local use the Which version of rpm are you using? |
Following the instructinos, make me end on the same commit, that i had already tested, and it was with version 0.7-3b7c2438a40757dfa8f7ea0d60e4b6ebd575c8ee I am using rpm version 4.11.1 on the building machine, and 4.8.0 on the machine where it is installed. |
We found the bug. I asume you are using |
Have have set the following in my build file:
I have generated an rpm using rpm:packageBin.
When installing the rpm on an centos6 box, i get the following:
It does however seem to try to delete the user (twice actually), if I remove the the rpm again:
rpm -e `rpm -qa | grep pim` Try deleting system user and group [pim-service:pim-service] Shutdown pim-service Try deleting system user and group [pim-service:pim-service]
The text was updated successfully, but these errors were encountered: