Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 51093 - Postgresql: pkg_config trying to sudo as root
Summary: Postgresql: pkg_config trying to sudo as root
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: PgSQL Bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-05-14 15:03 UTC by Jacob Atzen
Modified: 2007-09-22 23:18 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jacob Atzen 2004-05-14 15:03:15 UTC
Trying to do 'ebuild postgresql.ebuild config' complains about root not being in the sudoers file.

Why would root have to be in the sudoers file?

Reproducible: Always
Steps to Reproduce:
1. emerge postgresql
2. ebuild /var/db/pkg/dev-db/postgresql-7.4.2-r1/postgresql-7.4.2-r1.ebuild config

Actual Results:  
morpheus root # ebuild 
/var/db/pkg/dev-db/postgresql-7.4.2-r1/postgresql-7.4.2-r1.ebuild config

 * Creating the data directory ...
 * Initializing the database ...
root is not in the sudoers file.  This incident will be reported.

Expected Results:  
It shouldn't complain about root not being in the sudoers file. Perhaps the
problem is occuring as a consequence of running ebuild as root.


morpheus root # grep sudo
/var/db/pkg/dev-db/postgresql-7.4.2-r1/postgresql-7.4.2-r1.ebuild
        app-admin/sudo
                sudo -u postgres /usr/bin/initdb --pgdata ${PG_DIR}/data

This seems faulty, as it (afaik) requires a speciel setup of the sudoers file.
Comment 1 Tom Knight (RETIRED) gentoo-dev 2004-06-29 09:12:49 UTC
By default root should be in /etc/sudoers, what version of sudo are you using and was it installed as a dependency of postgres or was it already installed on your box?
Comment 2 Jacob Atzen 2004-07-03 00:16:01 UTC
I believe sudo was installed on it self. I might have made changes to the sudoers file that removed root from it. The relevant line from my sudoers file is:

#root   ALL=(ALL) ALL

I guess I've just fubar'ed my sudoers file. 
Perhaps it would be an idea to use 'su -c' instead of sudo?
Comment 3 Masatomo Nakano (RETIRED) gentoo-dev 2004-07-03 09:01:37 UTC
I think we should use su instead of sudo.

I'm one of the current postgresql maintainers in gentoo but I'm not sure why the ebuild uses sudo since it was made by the previous dev.

If no one objects about this, I'll change it.
Comment 4 Masatomo Nakano (RETIRED) gentoo-dev 2004-07-18 06:38:11 UTC
I've fixed this problem in postgresql-7.3.6-r2/postgresql-7.4.3-r1.