* Re: [gentoo-dev] What is insopts?
2002-01-29 17:45 Sean Mitchell
@ 2002-01-29 15:37 ` Chad M. Huneycutt
2002-01-29 21:22 ` Geert Bevin
1 sibling, 0 replies; 8+ messages in thread
From: Chad M. Huneycutt @ 2002-01-29 15:37 UTC (permalink / raw
To: gentoo-dev
Sean Mitchell wrote:
> Okay... looks like I was barking up the wrong tree. I found the info on
> insopts in "man 5 ebuild", so it looks like insopts won't create the user
> for me. I still haven't figured out how qmail is doing it, though....
If I had to guess, I would say that config-fast is doing it in pkg_config().
--
Chad Huneycutt
Ph.D. Student
Georgia Tech College of Computing
http://www.cc.gatech.edu/~chadh
^ permalink raw reply [flat|nested] 8+ messages in thread
* [gentoo-dev] What is insopts?
@ 2002-01-29 17:30 Sean Mitchell
0 siblings, 0 replies; 8+ messages in thread
From: Sean Mitchell @ 2002-01-29 17:30 UTC (permalink / raw
To: 'gentoo-dev@gentoo.org'
Hi All.....
Trying to make an ebuild for mailman, and I need to create a user and group.
Maybe I'm blind, but I didn't see anything about this in the developer docs.
I notice that several of the ebuilds use "insopts" to (I think) accomplish
this, but neither google nor grep were able to shed much light on it.
Can anyone offer some guidance here?
Thanks,
Sean
^ permalink raw reply [flat|nested] 8+ messages in thread
* RE: [gentoo-dev] What is insopts?
@ 2002-01-29 17:45 Sean Mitchell
2002-01-29 15:37 ` Chad M. Huneycutt
2002-01-29 21:22 ` Geert Bevin
0 siblings, 2 replies; 8+ messages in thread
From: Sean Mitchell @ 2002-01-29 17:45 UTC (permalink / raw
To: 'gentoo-dev@gentoo.org'
Okay... looks like I was barking up the wrong tree. I found the info on
insopts in "man 5 ebuild", so it looks like insopts won't create the user
for me. I still haven't figured out how qmail is doing it, though....
Still looking....
Sean
-----Original Message-----
Hi All.....
Trying to make an ebuild for mailman, and I need to create a user and group.
Maybe I'm blind, but I didn't see anything about this in the developer docs.
I notice that several of the ebuilds use "insopts" to (I think) accomplish
this, but neither google nor grep were able to shed much light on it.
Can anyone offer some guidance here?
^ permalink raw reply [flat|nested] 8+ messages in thread
* RE: [gentoo-dev] What is insopts?
2002-01-29 17:45 Sean Mitchell
2002-01-29 15:37 ` Chad M. Huneycutt
@ 2002-01-29 21:22 ` Geert Bevin
1 sibling, 0 replies; 8+ messages in thread
From: Geert Bevin @ 2002-01-29 21:22 UTC (permalink / raw
To: gentoo-dev
Qmail doesn't create its users dynamically, they're always present in
/etc/passwd even if qmail is not installed.
On Tue, 2002-01-29 at 18:45, Sean Mitchell wrote:
> Okay... looks like I was barking up the wrong tree. I found the info on
> insopts in "man 5 ebuild", so it looks like insopts won't create the user
> for me. I still haven't figured out how qmail is doing it, though....
>
> Still looking....
>
> Sean
>
> -----Original Message-----
>
> Hi All.....
>
> Trying to make an ebuild for mailman, and I need to create a user and group.
> Maybe I'm blind, but I didn't see anything about this in the developer docs.
>
> I notice that several of the ebuilds use "insopts" to (I think) accomplish
> this, but neither google nor grep were able to shed much light on it.
>
> Can anyone offer some guidance here?
>
> _______________________________________________
> gentoo-dev mailing list
> gentoo-dev@gentoo.org
> http://lists.gentoo.org/mailman/listinfo/gentoo-dev
>
--
Geert Bevin
the Leaf sprl/bvba
"Use what you need" Pierre Theunisstraat 1/47
http://www.theleaf.be 1030 Brussels
gbevin@theleaf.be Tel & Fax +32 2 241 19 98
^ permalink raw reply [flat|nested] 8+ messages in thread
* RE: [gentoo-dev] What is insopts?
@ 2002-01-29 21:32 Sean Mitchell
2002-01-29 21:43 ` Martin Schlemmer
0 siblings, 1 reply; 8+ messages in thread
From: Sean Mitchell @ 2002-01-29 21:32 UTC (permalink / raw
To: 'gentoo-dev@gentoo.org'
Ah!
Okay... is this because there's no sanctioned way to do it from an ebuild?
Seems to me that /etc/passwd could get huge if we did this for any package
that wants its own userid(s).
I'm thinking that I should just call useradd... anyone have wisdom to the
contrary to offer?
On a bit of a tangent, I'm wondering if a qmail or maybe a maildir USE
variable wouldn't be justified as it can have a big impact on other
packages. Mailmail is going to require some tweaking for sure.
Sean
-----Original Message-----
From: Geert Bevin [mailto:gbevin@theleaf.be]
Sent: Tuesday, January 29, 2002 4:22 PM
To: gentoo-dev@gentoo.org
Subject: RE: [gentoo-dev] What is insopts?
Qmail doesn't create its users dynamically, they're always present in
/etc/passwd even if qmail is not installed.
^ permalink raw reply [flat|nested] 8+ messages in thread
* RE: [gentoo-dev] What is insopts?
2002-01-29 21:32 Sean Mitchell
@ 2002-01-29 21:43 ` Martin Schlemmer
2002-01-30 9:23 ` Geert Bevin
0 siblings, 1 reply; 8+ messages in thread
From: Martin Schlemmer @ 2002-01-29 21:43 UTC (permalink / raw
To: Gentoo-Dev
[-- Attachment #1: Type: text/plain, Size: 1245 bytes --]
On Tue, 2002-01-29 at 23:32, Sean Mitchell wrote:
> Ah!
>
> Okay... is this because there's no sanctioned way to do it from an ebuild?
> Seems to me that /etc/passwd could get huge if we did this for any package
> that wants its own userid(s).
>
> I'm thinking that I should just call useradd... anyone have wisdom to the
> contrary to offer?
>
> On a bit of a tangent, I'm wondering if a qmail or maybe a maildir USE
> variable wouldn't be justified as it can have a big impact on other
> packages. Mailmail is going to require some tweaking for sure.
>
What I would have done, is create a pkg_postinst() like
follow:
pkg_postinst() {
if [ -z "`grep "mailman" /etc/passwd`" ] ; then
echo
echo "***************************************"
echo "* Please create a user called mailman *"
echo "***************************************"
fi
}
Or similar. I for one do not want stuff just to mess with
my config files without me knowing. After all, Gentoo tries
to be user friendly without crippeling the user ... and
how much effort is it to creat the user exactly how you like
it ?
Greetings,
--
Martin Schlemmer
Gentoo Linux Developer, Desktop Team Developer
Cape Town, South Africa
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 232 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* RE: [gentoo-dev] What is insopts?
2002-01-29 21:43 ` Martin Schlemmer
@ 2002-01-30 9:23 ` Geert Bevin
0 siblings, 0 replies; 8+ messages in thread
From: Geert Bevin @ 2002-01-30 9:23 UTC (permalink / raw
To: gentoo-dev
Maybe adding a user creation funcitonality to pkg_config and pkg_postrm
is a good solution. It isn't executed automatically and it removes the
burned from the user to execute the exact commands, since some packages
need to even do more things afterwards, like changing permissions and
ownership, or even create multiple users.
example from a private package:
INSTALLDIR="/opt/${PN}
MYGRP="mygrp"
MYUSR="myusr"
pkg_config() {
einfo "Creating ${MYGRP} group if needed <=="
if [ ! `grep -x "^${MYGRP}:.*" /etc/group` ] ; then
groupadd ${MYGRP};
fi
einfo "Creating ${MYUSR} user by deleting a previous existing
entry if needed <=="
if [ `grep -x "^${MYUSR}:.*" /etc/passwd` ] ; then
if [ -d ${INSTALLDIR} ] ; then
userdel -r ${MYUSR};
else
userdel ${MYUSR};
fi
fi
useradd -m -d ${INSTALLDIR} -g ${MYGRP} ${MYUSR}
echo "==> Updating permissions and ownerships <=="
chgrp root `dirname ${INSTALLDIR}`
chmod 755 `dirname ${INSTALLDIR}`
chown -Rf ${MYUSR}.${MYGRP} ${D}${INSTALLDIR}
chmod -Rf 775 ${D}${INSTALLDIR}
}
pkg_postrm() {
einfo "Removing ${MYUSR} user if needed <=="
if [ `grep -x "^${MYUSR}:.*" /etc/passwd` ] ; then
if [ -d ${INSTALLDIR} ] ; then
userdel -r ${MYUSR};
else
userdel ${MYUSR};
fi
fi
}
On Tue, 2002-01-29 at 22:43, Martin Schlemmer wrote:
> On Tue, 2002-01-29 at 23:32, Sean Mitchell wrote:
> > Ah!
> >
> > Okay... is this because there's no sanctioned way to do it from an ebuild?
> > Seems to me that /etc/passwd could get huge if we did this for any package
> > that wants its own userid(s).
> >
> > I'm thinking that I should just call useradd... anyone have wisdom to the
> > contrary to offer?
> >
> > On a bit of a tangent, I'm wondering if a qmail or maybe a maildir USE
> > variable wouldn't be justified as it can have a big impact on other
> > packages. Mailmail is going to require some tweaking for sure.
> >
>
> What I would have done, is create a pkg_postinst() like
> follow:
>
> pkg_postinst() {
> if [ -z "`grep "mailman" /etc/passwd`" ] ; then
> echo
> echo "***************************************"
> echo "* Please create a user called mailman *"
> echo "***************************************"
> fi
> }
>
> Or similar. I for one do not want stuff just to mess with
> my config files without me knowing. After all, Gentoo tries
> to be user friendly without crippeling the user ... and
> how much effort is it to creat the user exactly how you like
> it ?
>
>
> Greetings,
>
> --
>
> Martin Schlemmer
> Gentoo Linux Developer, Desktop Team Developer
> Cape Town, South Africa
>
--
Geert Bevin
the Leaf sprl/bvba
"Use what you need" Pierre Theunisstraat 1/47
http://www.theleaf.be 1030 Brussels
gbevin@theleaf.be Tel & Fax +32 2 241 19 98
^ permalink raw reply [flat|nested] 8+ messages in thread
* RE: [gentoo-dev] What is insopts?
@ 2002-01-30 14:00 Sean Mitchell
0 siblings, 0 replies; 8+ messages in thread
From: Sean Mitchell @ 2002-01-30 14:00 UTC (permalink / raw
To: 'gentoo-dev@gentoo.org'
I like this... it not only answers my user creation question but also
how/where to handle some of the setuid stuff. The only trouble is I'm not
sure how configure/make will like --with-mail-gid=mailman and
--with-cgi-gid=mailman if mailman doesn't exist until after the install.
I'll give it a go and see....
Cheers,
Sean
-----Original Message-----
From: Geert Bevin [mailto:gbevin@theleaf.be]
Sent: Wednesday, January 30, 2002 4:24 AM
To: gentoo-dev@gentoo.org
Subject: RE: [gentoo-dev] What is insopts?
Maybe adding a user creation funcitonality to pkg_config and pkg_postrm
is a good solution. It isn't executed automatically and it removes the
burned from the user to execute the exact commands, since some packages
need to even do more things afterwards, like changing permissions and
ownership, or even create multiple users.
example from a private package:
INSTALLDIR="/opt/${PN}
MYGRP="mygrp"
MYUSR="myusr"
pkg_config() {
einfo "Creating ${MYGRP} group if needed <=="
if [ ! `grep -x "^${MYGRP}:.*" /etc/group` ] ; then
groupadd ${MYGRP};
fi
einfo "Creating ${MYUSR} user by deleting a previous existing
entry if needed <=="
if [ `grep -x "^${MYUSR}:.*" /etc/passwd` ] ; then
if [ -d ${INSTALLDIR} ] ; then
userdel -r ${MYUSR};
else
userdel ${MYUSR};
fi
fi
useradd -m -d ${INSTALLDIR} -g ${MYGRP} ${MYUSR}
echo "==> Updating permissions and ownerships <=="
chgrp root `dirname ${INSTALLDIR}`
chmod 755 `dirname ${INSTALLDIR}`
chown -Rf ${MYUSR}.${MYGRP} ${D}${INSTALLDIR}
chmod -Rf 775 ${D}${INSTALLDIR}
}
pkg_postrm() {
einfo "Removing ${MYUSR} user if needed <=="
if [ `grep -x "^${MYUSR}:.*" /etc/passwd` ] ; then
if [ -d ${INSTALLDIR} ] ; then
userdel -r ${MYUSR};
else
userdel ${MYUSR};
fi
fi
}
On Tue, 2002-01-29 at 22:43, Martin Schlemmer wrote:
> On Tue, 2002-01-29 at 23:32, Sean Mitchell wrote:
> > Ah!
> >
> > Okay... is this because there's no sanctioned way to do it from an
ebuild?
> > Seems to me that /etc/passwd could get huge if we did this for any
package
> > that wants its own userid(s).
> >
> > I'm thinking that I should just call useradd... anyone have wisdom to
the
> > contrary to offer?
> >
> > On a bit of a tangent, I'm wondering if a qmail or maybe a maildir USE
> > variable wouldn't be justified as it can have a big impact on other
> > packages. Mailmail is going to require some tweaking for sure.
> >
>
> What I would have done, is create a pkg_postinst() like
> follow:
>
> pkg_postinst() {
> if [ -z "`grep "mailman" /etc/passwd`" ] ; then
> echo
> echo "***************************************"
> echo "* Please create a user called mailman *"
> echo "***************************************"
> fi
> }
>
> Or similar. I for one do not want stuff just to mess with
> my config files without me knowing. After all, Gentoo tries
> to be user friendly without crippeling the user ... and
> how much effort is it to creat the user exactly how you like
> it ?
>
>
> Greetings,
>
> --
>
> Martin Schlemmer
> Gentoo Linux Developer, Desktop Team Developer
> Cape Town, South Africa
>
--
Geert Bevin
the Leaf sprl/bvba
"Use what you need" Pierre Theunisstraat 1/47
http://www.theleaf.be 1030 Brussels
gbevin@theleaf.be Tel & Fax +32 2 241 19 98
_______________________________________________
gentoo-dev mailing list
gentoo-dev@gentoo.org
http://lists.gentoo.org/mailman/listinfo/gentoo-dev
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2002-01-30 13:59 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-01-29 17:30 [gentoo-dev] What is insopts? Sean Mitchell
-- strict thread matches above, loose matches on Subject: below --
2002-01-29 17:45 Sean Mitchell
2002-01-29 15:37 ` Chad M. Huneycutt
2002-01-29 21:22 ` Geert Bevin
2002-01-29 21:32 Sean Mitchell
2002-01-29 21:43 ` Martin Schlemmer
2002-01-30 9:23 ` Geert Bevin
2002-01-30 14:00 Sean Mitchell
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox