[opensuse-buildservice] service_add macro
Hi, I'd like to generate a package for different distributions using OBS. The package requires to create a user and install a service. Via a search engine, I found this PDFs: http://files.opensuse.org/opensuse/en/9/9b/LinuxTag2006_Build_Service_2.pdf http://files.opensuse.org/opensuse/en/5/57/FOSDEM_building.pdf But when I use user_group_add, I get following error: fg: no job control Are these macros supported by OBS or the distributions? Is there an example package? Are was this just an idea and I have to write if clauses for every distribution (openSUSE, Fedora, Mandriva) Thanks, Florian
Hi Florian, /sbin/groupadd ...... /sbin/useradd ..... do not using it while building because packages are build as "abuild" and not as "root". So you can only use it inside %pre Example: #---------------------------------------------------------------------------------- %pre #---------------------------------------------------------------------------------- #echo "PARAM_pre: "$1 # on `rpm -ivh` PARAM is 1 # on `rpm -Uvh` PARAM is 2 if [ "$1" = "1" ]; then echo "Adding %{vmusr} user" if [ -z "`%__grep "^%{vmusr}:" /etc/group 2>/dev/null`" ]; then %{_sbindir}/groupadd -r -g %{vmgid} %{vmusr} fi if [ -z "`%__grep "^%{vmusr}" /etc/passwd 2>/dev/null`" ]; then %{_sbindir}/useradd -c "maildirs chef" -d %{vmdir} -g %{vmusr} -u %{vmid} -r -s /bin/false %{vmusr} fi fi Cheers Chris Florian Richter schrieb:
Hi,
I'd like to generate a package for different distributions using OBS. The package requires to create a user and install a service. Via a search engine, I found this PDFs: http://files.opensuse.org/opensuse/en/9/9b/LinuxTag2006_Build_Service_2.pdf http://files.opensuse.org/opensuse/en/5/57/FOSDEM_building.pdf
But when I use user_group_add, I get following error: fg: no job control
Are these macros supported by OBS or the distributions? Is there an example package? Are was this just an idea and I have to write if clauses for every distribution (openSUSE, Fedora, Mandriva)
Thanks, Florian
--------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
On Mon, Sep 08, 2008 at 11:44:26PM +0200, Florian Richter wrote:
Hi,
I'd like to generate a package for different distributions using OBS. The package requires to create a user and install a service. Via a search engine, I found this PDFs: http://files.opensuse.org/opensuse/en/9/9b/LinuxTag2006_Build_Service_2.pdf http://files.opensuse.org/opensuse/en/5/57/FOSDEM_building.pdf
But when I use user_group_add, I get following error: fg: no job control
Are these macros supported by OBS or the distributions?
I must confess that currentlyu only info_add/info_del gets defined. As I'm currently updating rpm for Factory, I'll try to add the other ones. Sorry, Michael. -- Michael Schroeder mls@suse.de SUSE LINUX Products GmbH, GF Markus Rex, HRB 16746 AG Nuernberg main(_){while(_=~getchar())putchar(~_-1/(~(_|32)/13*2-11)*13);} --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
participants (3)
-
Christian
-
Florian Richter
-
Michael Schroeder