Bonjour,
 
J'utilise un script pour générer automatiquement un rpm (génération d'un fichier de spec+rpmbuild)
Je l'ai modifié pour rajouter des commandes de post install qui sont les suivantes :
 
Code :
 - %post
 - chmod -R 444 /usr/local/bin/toto/XXX
 - find /usr/local/bin/toto/XXX -type f -name XXX -print0 | xargs -0 chmod 555
 - find /usr/local/bin/toto/XXX -type f -regex .*ini -print0 | xargs -0 chmod 666
 - find /usr/local/bin/toto/XXX -type f -regex .*xml -print0 | xargs -0 chmod 666
 - /sbin/ldconfig
 
  | 
 
Prises séparément, ces commandes semblent fonctionner correctement.
Seulement, une fois incluses dans le RPM, lors de l'installation du RPM, on se retrouve avec tout le chemin /usr/local/bin/... dont les droits d'accès sont changés !
Ce qui pourri au passage la partition : pour la remettre d'aplomb, il faut faire les commandes suivantes, en root :
Code :
 - Cd /
 - Chmod 755 .
 - Chmod 755 usr
 - Chmod 755 usr/local
 - Chmod 755 usr/local/bin
 - Chmod -R 755 usr/local/bin/...
 
  | 
 
Je ne comprend pas qu'est ce qui change les droits de ce chemin, puisque les seules commandes que j'ai rajouté fonctionnent correctement, à part ?
 
Voici une partie du fichier de spec qui permet de générer le rpm :
Code :
 - # Initial spec file created by autospec ver. 0.8 with rpm 3 compatibility
 - Summary: XXX_RPM
 - # The Summary: line should be expanded to about here -----^
 - #Summary(fr): (translated summary goes here)
 - Name: XXX
 - Version: 8.8.4
 - Release: 1
 - Group: XXX
 - #Group(fr): (translated group goes here)
 - License: XXX
 - Source: XXX.bin.tar.gz
 - #NoSource: XXX.bin.tar.gz
 - BuildRoot: %{_tmppath}/%{name}-root
 - # Following are optional fields
 - #URL: http://www.example.net/XXX_RPM/
 - #Distribution: Red Hat Contrib-Net
 - #Patch: XXX_RPM-%{version}.patch
 - Prefix:/usr/local/bin/toto/XXX
 - #BuildArch: noarch
 - #Requires:
 - #Obsoletes:
 - #BuildRequires:
 - %description
 - XXX version 8.8.4
 - #%description -l fr
 - #(translated description goes here)
 - %prep
 - %setup -c XXX_RPM
 - #%patch
 - %install
 - %__cp -a . "${RPM_BUILD_ROOT-/}"
 - %clean
 - [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf "$RPM_BUILD_ROOT"
 - %post
 - chmod -R 444 /usr/local/bin/toto/XXX
 - find /usr/local/bin/toto/XXX -type f -name XXX -print0 | xargs -0 chmod 555
 - find /usr/local/bin/toto/XXX -type f -regex .*ini -print0 | xargs -0 chmod 666
 - find /usr/local/bin/toto/XXX -type f -regex .*xml -print0 | xargs -0 chmod 666
 - /sbin/ldconfig
 - %files
 - %defattr(744,root,root,744)
 - %dir /./
 - /./XXX.tar.gz
 - /./Temp.spec
 - /./XXX.spec
 - /./tmp
 - /./Temp2.spec
 - %dir /./usr/
 - %dir /./usr/local/
 - %dir /./usr/local/bin/
 - [...]
 - %dir /./usr/local/natinst/
 - %dir /./usr/local/natinst/smserver/
 - %changelog
 - * Sat Jul 04 2009 root <root@xq2500-1>
 - - Initial spec file created by autospec ver. 0.8 with rpm 3 compatibility
 
  | 
 
Merci pour vos conseils !
 
Configuration: Red hat 5