On 10/29/2009 12:25 PM, Miroslav Suchý wrote:
You have it too simple. Correct way to check account is getent (user can use ldap, NIS...). And it can happen that group exist, but username not, and vice versa. This is sniplet we use in Spacewalk project:
%define package_name nocpulse getent group %{package_name} >/dev/null || groupadd -r %{package_name} getent passwd %{package_name} >/dev/null || \ useradd -r -g %{package_name} -G apache \ -d %{_var}/lib/%{package_name} -s /bin/bash \ -c "NOCpulse user" %{package_name}
... or check http://en.opensuse.org/Packaging/Users_And_Groups which is moreorless the same, but more general. -- Best Regards / S pozdravom, Pavol RUSNAK SUSE LINUX, s.r.o openSUSE Boosters Team Lihovarska 1060/12 PGP 0xA6917144 19000 Praha 9, CR prusnak[at]suse.cz http://www.suse.cz -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org