[Slackbuilds-users] on creating users

Robby Workman rworkman at slackbuilds.org
Wed Jun 19 05:16:59 UTC 2013


On Tue, 18 Jun 2013 11:13:46 -0700
Miguel De Anda <miguel at thedeanda.com> wrote:

> I just realized something... I'm looking at the jboss and tomcat
> scripts as they need users as well... the build script chown's some
> files under that user/group. I think this would cause the package to
> fail if the gid/uid on the target system doesn't match the build
> system right? Should the rc script chown files as needed each time it
> starts?


I can't figure out how to say this, so I'll just show it - I 
*think* this is what you're asking:


root at pkgdev32:~# groupadd -g 300 testgroup
root at pkgdev32:~# useradd -d /dev/null -s /bin/false -u 300 -g 300 testuser
root at pkgdev32:~# touch testfile
root at pkgdev32:~# chown testuser:testgroup testfile
root at pkgdev32:~# ls -lh testfile
-rw-r--r-- 1 testuser testgroup 0 Jun 19 00:13 testfile
root at pkgdev32:~# tar cf test.tar testfile
root at pkgdev32:~# tar tvf test.tar 
-rw-r--r-- testuser/testgroup 0 2013-06-19 00:13 testfile
root at pkgdev32:~# getent group testgroup ; getent passwd testuser
testgroup:x:300:
testuser:x:300:300::/dev/null:/bin/false
root at pkgdev32:~# scp test.tar pkgdev64:.
The authenticity of host 'pkgdev64 (2001:470:8:937:a00:27ff:fe00:42)' can't be established.
ECDSA key fingerprint is f3:c6:c5:28:19:94:25:ec:e4:55:bd:c7:81:c9:26:fa.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'pkgdev64,2001:470:8:937:a00:27ff:fe00:42' (ECDSA) to the list of known hosts.
root at pkgdev64's password: 
test.tar

... switching to pkgdev64 host ...

root at pkgdev64:~# ls -lh test.tar 
-rw-r--r-- 1 root root 10K Jun 19 00:12 test.tar
root at pkgdev64:~# tar tvf test.tar 
-rw-r--r-- testuser/testgroup 0 2013-06-19 00:13 testfile
root at pkgdev64:~# groupadd -g 700 testgroup
root at pkgdev64:~# useradd -d /dev/null -s /bin/false -u 900 -g 700 testuser
root at pkgdev64:~# tar xvf test.tar 
testfile
root at pkgdev64:~# ls -lh testfile
-rw-r--r-- 1 testuser testgroup 0 Jun 19 00:13 testfile
root at pkgdev64:~# getent group testgroup ; getent passwd testuser
testgroup:x:700:
testuser:x:900:700::/dev/null:/bin/false

-RW
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.slackbuilds.org/pipermail/slackbuilds-users/attachments/20130619/a1ca9a89/attachment-0001.asc>


More information about the SlackBuilds-users mailing list