RFC: check for enewuser, enewgroup outside of pkg_setup
On Wed, 19 Jan 2011 16:25:03 +0100
"Paweł Hajdan, Jr." <phajdan.jr@gentoo.org> wrote:
> "If enewuser or enewgroup is called from outside of pkg_setup, fail"
It is useful sometimes to call it in pkg_postinst(), if the user/group
is needed at runtime and not during install-time.
--
Best regards,
Michał Górny
01-19-2011, 03:38 PM
Alec Warner
RFC: check for enewuser, enewgroup outside of pkg_setup
On Wed, Jan 19, 2011 at 3:47 PM, Michał Górny <mgorny@gentoo.org> wrote:
> On Wed, 19 Jan 2011 16:25:03 +0100
> "Paweł Hajdan, Jr." <phajdan.jr@gentoo.org> wrote:
>
>> "If enewuser or enewgroup is called from outside of pkg_setup, fail"
>
> It is useful sometimes to call it in pkg_postinst(), if the user/group
> is needed at runtime and not during install-time.
What difference is there if you run it during setup vs postinst?
-A
>
> --
> Best regards,
> Michał Górny
>
01-19-2011, 04:18 PM
Michał Górny
RFC: check for enewuser, enewgroup outside of pkg_setup
On Wed, 19 Jan 2011 16:38:10 +0000
Alec Warner <antarus@gentoo.org> wrote:
> On Wed, Jan 19, 2011 at 3:47 PM, Michał Górny <mgorny@gentoo.org>
> wrote:
> > On Wed, 19 Jan 2011 16:25:03 +0100
> > "Paweł Hajdan, Jr." <phajdan.jr@gentoo.org> wrote:
> >
> >> "If enewuser or enewgroup is called from outside of pkg_setup,
> >> fail"
> >
> > It is useful sometimes to call it in pkg_postinst(), if the
> > user/group is needed at runtime and not during install-time.
>
> What difference is there if you run it during setup vs postinst?
If the build fails or user aborts the merge, his/her system
is not junked with an unnecessary account/group.
--
Best regards,
Michał Górny
01-19-2011, 09:44 PM
Mike Frysinger
RFC: check for enewuser, enewgroup outside of pkg_setup
On Wednesday, January 19, 2011 12:18:24 Michał Górny wrote:
> On Wed, 19 Jan 2011 16:38:10 +0000 Alec Warner wrote:
> > On Wed, Jan 19, 2011 at 3:47 PM, Michał Górny wrote:
> > > On Wed, 19 Jan 2011 16:25:03 +0100 Paweł Hajdan, Jr. wrote:
> > >> "If enewuser or enewgroup is called from outside of pkg_setup,
> > >> fail"
> > >
> > > It is useful sometimes to call it in pkg_postinst(), if the
> > > user/group is needed at runtime and not during install-time.
> >
> > What difference is there if you run it during setup vs postinst?
>
> If the build fails or user aborts the merge, his/her system
> is not junked with an unnecessary account/group.
this is why we allow people to pick the appropriate step. ebuilds should be
using pkg_{pre,post}inst unless the user/group is needed at src_* time.
-mike
05-12-2012, 10:48 PM
Michael Weber
RFC: check for enewuser, enewgroup outside of pkg_setup
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
On 01/19/2011 11:44 PM, Mike Frysinger wrote:
> this is why we allow people to pick the appropriate step. ebuilds
> should be using pkg_{pre,post}inst unless the user/group is needed
> at src_* time. -mike
I noticed a rather annoying test inside enewuser for existence of the
provided "shell" path in the filesystem ( user.eclass lines 153-156 ).
If you want to create an user and set the shell variable to an program
you just emerge, you have to call it from pkg_postinst.
(The example was a trivial desktop manager x11-misc/trivdm in [1])
RFC: check for enewuser, enewgroup outside of pkg_setup
On Sun, 13 May 2012 00:48:00 +0200
Michael Weber <xmw@gentoo.org> wrote:
> On 01/19/2011 11:44 PM, Mike Frysinger wrote:
> > this is why we allow people to pick the appropriate step. ebuilds
> > should be using pkg_{pre,post}inst unless the user/group is needed
> > at src_* time. -mike
>
> I noticed a rather annoying test inside enewuser for existence of the
> provided "shell" path in the filesystem ( user.eclass lines 153-156 ).
>
> If you want to create an user and set the shell variable to an program
> you just emerge, you have to call it from pkg_postinst.
If you don't need it in install-time (i.e. don't install any files
owned by it), you should indeed defer the check as late as possible.
There's no point in creating user earlier when the emerge can still
fail/be aborted.