You are not logged in.
I'm looking for a way to create a user within a PKGBUILD. Is that even possible, since makepkg is run within a chroot?
Reason: xampp needs a mysql user *before* the extraction of its files.
There are old topics about that [1] and [2]. The second one proposes the use of a fakeuser utility to do that. It works, but I think it does not make the PKGBUILD much clean. Should I stick to it, or there are better options?
Another thing: why can't I use pre_install to create a user? I tried it but it didn't work. Mariadb seems to add a user, however it does that in the post_install process, not in pre_install.
[1]: https://bbs.archlinux.org/viewtopic.php?id=25109
[2]: https://bbs.archlinux.org/viewtopic.php?id=160775
Edit: solved with fakeuser.
Last edited by thiagowfx (2014-06-30 18:45:31)
Offline
Hmm... Readme.install in a scriplet. See one of the official packages that creates users.
Offline
If you don't like fakeuser, you can require a package xampp-users as makedepends that creates the users with an installscript.
I'm looking for a way to create a user within a PKGBUILD. Is that even possible, since makepkg is run within a chroot?
In a fakeroot no users can be created, this functionality is not implemented, that's why I hacked fakeuser together.
Another thing: why can't I use pre_install to create a user? I tried it but it didn't work. Mariadb seems to add a user, however it does that in the post_install process, not in pre_install.
You could create a user in pre_install, but that is not of much use if the user doesn't exist during package().
There are basically 3 approaches:
1) create user on your build machine before running makepkg, then create it during pre_install.
2) use fakeuser to create a temporary user inside a fakeroot, then create that same user in pre_install.
3) install everything with default permissions, then create the user in post_install and run chown/chgrp for the files.
Last edited by progandy (2014-06-30 10:30:38)
| alias CUTF='LANG=en_XX.UTF-8@POSIX ' | alias ENGLISH='LANG=C.UTF-8 ' |
Offline
Edit: Forgot to edit.
Last edited by progandy (2014-06-30 10:30:23)
| alias CUTF='LANG=en_XX.UTF-8@POSIX ' | alias ENGLISH='LANG=C.UTF-8 ' |
Offline
If you don't like fakeuser, you can require a package xampp-users as makedepends that creates the users with an installscript.
It is not that I don't like it: the problem is this package is getting too cumbersome. I already had to use proot because there was no choice, now I'm facing the decision of using or not fakeuser. Two workarounds to solve a simple packaging problem, looks like much to me.
Another thing: why can't I use pre_install to create a user? I tried it but it didn't work. Mariadb seems to add a user, however it does that in the post_install process, not in pre_install.
You could create a user in pre_install, but that is not of much use if the user doesn't exist during package().
There are basically 3 approaches:
1) create user on your build machine before running makepkg, then create it during pre_install.
2) use fakeuser to create a temporary user inside a fakeroot, then create that same user in pre_install.
3) install everything with default permissions, then create the user in post_install and run chown/chgrp for the files.
3) wouldn't work here because the user must exist before the extraction of the files. The permissions are automatically set during the extraction, I suppose (just to be clear: this can't be controlled because it is a .run file).
1) Creating a user before running makepkg is the most KISS solution (together with @graysky's suggestion), however it wouldn't be 100% automated. I would already have done it if I thought we couldn't get a better solution.
Now, the last option is to use fakeuser. I'll probably to that, at least it works.
Offline
thiagowfx, there is some uncertainty about the license of this bundle as discussed starting here.
Do you have any insight into this? Is the source code available somewhere I missed? If not, would you consider changing the license note for the AUR package as I'd prefer not to perpetuate license violations through our AUR.
As noted in the grr thread, these concerns are raised only as an arch user who values license integrity, not as a mod or anything else. So feel free to tell me to "get lost" - but I would hope you don't.
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
No problem in expressing your concerns, Trilby. However, could you talk to the current maintainer of the package about its license? I am just a contributor (I can change the license in my github repo, but someone should talk to the maintainer anyways).
Honestly, I usually agree with what WorMzy said in the topic you referenced, I usually don't have the motivation to put my efforts in things that are not open (mainly when they say they are). Although, this package is pretty popular, so as people seem to like it, I felt it would be worth the effort to repackage it (this package was about to complete a year as being out-of-date, before this proot/fakeuser thing).
Unfortunately, I also couldn't find any source code. This situation was really a hidden 'grrr'.
Offline
Thanks for the reply. Sorry for the confusion, I had mistakenly assumed you were maintaining the PKGBUILD. I'll forward my question/concern to the maintainer.
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
Unfortunately, I also couldn't find any source code. This situation was really a hidden 'grrr'.
Maybe it would be a more satisfying solution to maintain a package with xampp-like configuration files for the apache, php and mariadb packages.
| alias CUTF='LANG=en_XX.UTF-8@POSIX ' | alias ENGLISH='LANG=C.UTF-8 ' |
Offline