Mailinglist Archive: opensuse-packaging (149 mails)
| < Previous | Next > |
Re: [opensuse-packaging] commands to go into a .specfile
- From: Miroslav Suchý <miroslav@xxxxxxxx>
- Date: Thu, 29 Oct 2009 12:25:26 +0100
- Message-id: <4AE97BA6.6090900@xxxxxxxx>
doiggl@xxxxxxxxxxxxxxxxxx napsal(a):
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}
Miroslav Suchy
--
To unsubscribe, e-mail: opensuse-packaging+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse-packaging+help@xxxxxxxxxxxx
Hello,
I am trying to compile the cricket from source code.
I am using this a guide to try and get it going:-
http://cricket.sourceforge.net/support/doc/beginner.html
I need to put the following commands into the spec file
1. Setup cricket userid and group [done]
%pre
id cricket >/dev/null 2>&1
if [ $? -ne 0 ]; then
/usr/sbin/groupadd cricket
/usr/sbin/useradd -r -d %{_libdir}/%{name} -c "Cricket SNMP Monitor"
cricket
fi
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}
Miroslav Suchy
--
To unsubscribe, e-mail: opensuse-packaging+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse-packaging+help@xxxxxxxxxxxx
| < Previous | Next > |