Results 1 to 3 of 3

Thread: How to create group and user for install?

  1. #1
    Join Date
    Jan 2009
    Location
    Switzerland
    Posts
    1,529

    Default How to create group and user for install?

    Hi

    I am working on a spec file to package j-chkmail, a milter for sendmail or postfix to filter email messages.

    I use 11.1 i586 and build on a local host to test this. The package compiles, so far so good. When the install is launched it stops with an error:

    Code:
    make  install-data-hook
    make[3]: Entering directory `/usr/src/packages/BUILD/jchkmail-2.2.0-100108/etc'
    cp j-chkmail.cf.default j-chkmail.cf.running /var/tmp/jchkmail-2.2.0-build//etc/mail/jchkmail/
    chown: invalid user: `smmsp'
    make[3]: *** [install-data-hook] Error 1
    make[3]: Leaving directory `/usr/src/packages/BUILD/jchkmail-2.2.0-100108/etc'
    make[2]: *** [install-data-am] Error 2
    make[2]: Leaving directory `/usr/src/packages/BUILD/jchkmail-2.2.0-100108/etc'
    make[1]: *** [install-am] Error 2
    make[1]: Leaving directory `/usr/src/packages/BUILD/jchkmail-2.2.0-100108/etc'
    make: *** [install-recursive] Error 1
    error: Bad exit status from /var/tmp/rpm-tmp.3034 (%install)
    The relevant part of the Makefile where it stops looks like this:

    Code:
    install-workroot:
            @echo "  * Installing $(DESTDIR)/var/jchkmail"
            @$(mkdir_p) $(DESTDIR)/var/jchkmail
            @chmod 755 $(DESTDIR)/var/jchkmail
            @chown smmsp $(DESTDIR)/var/jchkmail
            @chgrp smmsp $(DESTDIR)/var/jchkmail
    It complains that smmsp is not a valid user but when I add commands to create them like this:

    Code:
    %install
    /usr/sbin/groupadd -r smmsp >/dev/null 2>/dev/null
    /usr/sbin/useradd -r -o -g smmsp -c "j-chkmail milter" smmsp 2>/dev/null
    make DESTDIR="%{buildroot}" install
    it complains that the user exists (which is true for my system) but I'm in a root jail? How is this situation handled in a spec file?
    Technology is 'stuff that doesn't work yet.' -- Bran Ferren

  2. #2
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    28,163
    Blog Entries
    15

    Default Re: How to create group and user for install?

    Quote Originally Posted by vodoo
    Hi

    I am working on a spec file to package j-chkmail, a milter for sendmail
    or postfix to filter email messages.

    I use 11.1 i586 and build on a local host to test this. The package
    compiles, so far so good. When the install is launched it stops with an
    error:


    Code:
    --------------------
    make install-data-hook
    make[3]: Entering directory
    `/usr/src/packages/BUILD/jchkmail-2.2.0-100108/etc' cp
    j-chkmail.cf.default
    j-chkmail.cf.running /var/tmp/jchkmail-2.2.0-build//etc/mail/jchkmail/
    chown: invalid user: `smmsp' make[3]: *** [install-data-hook] Error 1
    make[3]: Leaving directory
    `/usr/src/packages/BUILD/jchkmail-2.2.0-100108/etc' make[2]: ***
    [install-data-am] Error 2 make[2]: Leaving directory
    `/usr/src/packages/BUILD/jchkmail-2.2.0-100108/etc' make[1]: ***
    [install-am] Error 2 make[1]: Leaving directory
    `/usr/src/packages/BUILD/jchkmail-2.2.0-100108/etc' make: ***
    [install-recursive] Error 1 error: Bad exit status
    from /var/tmp/rpm-tmp.3034 (%install) --------------------


    The relevant part of the Makefile where it stops looks like this:


    Code:
    --------------------
    install-workroot:
    @echo " * Installing $(DESTDIR)/var/jchkmail"
    @$(mkdir_p) $(DESTDIR)/var/jchkmail
    @chmod 755 $(DESTDIR)/var/jchkmail
    @chown smmsp $(DESTDIR)/var/jchkmail
    @chgrp smmsp $(DESTDIR)/var/jchkmail
    --------------------


    It complains that smmsp is not a valid user but when I add commands to
    create them like this:


    Code:
    --------------------
    %install
    /usr/sbin/groupadd -r smmsp >/dev/null 2>/dev/null
    /usr/sbin/useradd -r -o -g smmsp -c "j-chkmail milter" smmsp
    2>/dev/null make DESTDIR="%{buildroot}" install
    --------------------


    it complains that the user exists (which is true for my system) but I'm
    in a root jail? How is this situation handled in a spec file?
    Hi
    Have a look at the spec file in this mandrake version;
    ftp://ftp.pbone.net/mirror/carroll.c...2010.1.src.rpm

    --
    Cheers Malcolm (Linux Counter #276890)
    SUSE Linux Enterprise Desktop 11 (x86_64) Kernel 2.6.27.39-0.3-default
    up 1 day 23:24, 2 users, load average: 0.19, 0.22, 0.14
    GPU GeForce 8600 GTS Silent - CUDA Driver Version: 190.18


  3. #3
    Join Date
    Jan 2009
    Location
    Switzerland
    Posts
    1,529

    Default Re: How to create group and user for install?

    Thanks. Helps a lot to see how they did it, but for the problem of user/group they seem to use a workaround. As I don't like to lower the security standards of the author of the package I am currently studying Packaging/Users And Groups - openSUSE which I have found in the meantime. I will try it (once I have understood it) and report back.
    Technology is 'stuff that doesn't work yet.' -- Bran Ferren

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •