creating a user from an RPM package

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



What wizardry do you guys use in the SPEC file when creating/deleting a
user from an RPM package?

I was going to create a macro like:

%define user(login,uid,gid,name,homedir,shell) \
        echo "$1:x:$2:$3:$4:$5:$6"      >>/etc/passwd; \
        echo "$1:!!:12005:0:99999:7:::" >>/etc/shadow; \
        echo "$1:x:$3:" >>/etc/group; \
        mkdir -p $5; \
        chown $2:$3 $5

and then appropriate sedness and rm's when removing it, but I figure
there has to be a cleaner way, or a builtin as this surely is a
common feature. The RPM guide doesn't seem to mention it, or if it
does, I missed it.

Alternatively, if you could point me to a package or a spec file that
does this, I'd be much obliged.

Thanks

-- 
Spiro Harvey                  Knossos Networks Ltd
021-295-1923                    www.knossos.net.nz

_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
http://lists.centos.org/mailman/listinfo/centos

[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux