3

I have an RPM which does

  1. File copy (say, 123.so )
  2. in %post, runs

/etc/init.d/VontuMonitor restart

If copy the same files manually (user is root) and launch the same command manually, then everything works. If I create an RPM which does exactly the same, then the script fails with "file not found" exception (though the specified file does exist).

What is the difference between RPM and copy&execute commands? I suppose that RPM does something, which prevents script from normal working, but what could that be? Is where any way to track things performed by RPM installator?

I have CentOS, /etc/init.d/VontuMonitor is a 3rd-party script.

[UPD] This is my RPM and I'm sure that there is nothing but file copy and this command in spec-file.

2

This means you are not executing exactly the same commands; It also depends on what your rpm does before; what files it installs etc... You can see the scripts an rpm executes by performing:

rpm -qp <your.rpm> --scripts

then you can compare with the commands you execute manually

  • 1
    Thank you for an answer; rpm -qp my.rpm --scripts outputs nothing. And my RPM does nothing before, so that does not help. – Надежда Тарашкевич Nov 7 '16 at 7:56
  • that is very strange. Did you provide the correct path to your.rpm ? the -p switch takes the path to a (not yet installed) rpm. If the rpm is already installed, you can run: rpm -q <rpm-name> --scripts (without -p !) – Chris Maes Nov 7 '16 at 8:51
  • unfortunately does not work for me. Can this mean I have my RPM database broken or something like that? – Надежда Тарашкевич Nov 8 '16 at 11:16
  • no; that would mean that your rpm is not build correctly. when using -p your rpm does not need to be installed – Chris Maes Nov 8 '16 at 11:40
  • Thank you for your time, unfortunately this is not the case. rpm -bb command report success for this rpm. During the installation, I see progress indication and finally 100% installed. But not with -p key, -p does not work for me. – Надежда Тарашкевич Nov 9 '16 at 4:33
0

The problem was outside the description. .spec file contained %defattr command which have set /opt /* to 644 access right (no execution).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.