0

"%pre – This is where code is run before the install scripts run."

this section does not work for me . I got a spec file from “http://repo.andrewfarley.com/centos/specs/zabbix.spec” . every thing is ok ,but the rpm package can not create the “zabbix” user .

any reply is appreciated .Thank you .

OS : CentOS 5.7

Jeff
  • 1
  • Creating a user requires `root` (or other similarly elevated) privileges. Are you running with permissions that would allow you to create a user? – Jonathan Leffler Feb 20 '13 at 04:36
  • When you say the RPM package cannot create the Zabbix user, are you actually seeing an error saying the user cannot be created? Or does the installation just error out because the user doesn't exist once it's past the %pre section? – Forrest Feb 20 '13 at 05:37
  • thx a lot guys, the rpm package was installed by root ,should have the right permission . – Jeff Feb 20 '13 at 05:47
  • I got error message "user zabbix does not exist - using root /group zabbix does not exist - using root" when I install and I use --scripts option to check whether the package have the scripts ,and it is not. – Jeff Feb 20 '13 at 05:51
  • I got it ,it's my fault .the %pre section is for zabbix package not for the additional packages . Thanks every one . – Jeff Feb 23 '13 at 11:57

1 Answers1

1

That spec file is broken. They will delete the user during an upgrade in %postun. %postun should check it's parameter and only delete the users if it is given 0, i.e. "zero packages of this name will be installed when this transaction is complete."

Were you doing an install or an upgrade?

Aaron D. Marasco
  • 6,506
  • 3
  • 26
  • 39
  • thx for you reply . yes,I have notice that. and the installation was first time on the machine. and I also install the package with create the zabbix user by hand ,then uninstall it ,the zabbix user which I create by hand still exist . it's means the %pre ,%postun section are all don't work in this spec . I do a lot search ,all the article are all talk about how to configure . – Jeff Feb 21 '13 at 01:38