Thread: Installation question
Oh wise ones, Novice trying to install postgresql-7.3.2 on linux. I am not root, but do have sudo priv. I unpacked the tarball in /usr.local/pkg/postgresql-7.3.2. I got as far as adduser which failed. Can someone point me to the error of my ways? Implications for subsequent steps? regards, Charles ./configure ok gmake ok sudo gmake install ok adduser postgres fail [chauser@gulliver postgresql-7.3.2]$ adduser postgres bash: adduser: command not found mkdir /usr/local/pgsql/data chown postgres /usr/local/pgsql/data su - postgres /usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data /usr/local/pgsql/bin/postmaster -D /usr/local/pgsql/data >logfile 2>&1 & /usr/local/pgsql/bin/createdb test /usr/local/pgsql/bin/psql test
On Mon, Mar 10, 2003 at 03:55:27PM -0500, Charles Hauser wrote: > [chauser@gulliver postgresql-7.3.2]$ adduser postgres > bash: adduser: command not found ^^^^^^^^^^^^^^^^ Looks like you don't have adduser on your system, or that it;s not in your path (I suspect the latter). Possibly postgres is getting installed in a location not in your path? A -- ---- Andrew Sullivan 204-4141 Yonge Street Liberty RMS Toronto, Ontario Canada <andrew@libertyrms.info> M2P 2A8 +1 416 646 3304 x110
adduser is a command that is usually only runnable by root, I believe you may have to grant sudo'd users explicit access to it. It attempts to create a new user account on your box called 'postgres'. This user then owns the postgresql server processes etc. It's not good form to run things as root as it opens security vulnerabilities, and users cannot voilate kernel space. Therefore, try adding the postgres user manually and removing this step from the process. Or sudo to the account that CAN addusers to the box and run your install. You may know this already. creatdb is a shell script that wraps the db commands create database etc... H On Tue, 2003-03-11 at 09:55, Charles Hauser wrote: > Oh wise ones, > > Novice trying to install postgresql-7.3.2 on linux. > > I am not root, but do have sudo priv. > > I unpacked the tarball in /usr.local/pkg/postgresql-7.3.2. > I got as far as adduser which failed. > > Can someone point me to the error of my ways? > Implications for subsequent steps? > > > regards, > > Charles > > > ./configure ok > gmake ok > sudo gmake install ok > adduser postgres fail > > [chauser@gulliver postgresql-7.3.2]$ adduser postgres > bash: adduser: command not found > > > mkdir /usr/local/pgsql/data > chown postgres /usr/local/pgsql/data > su - postgres > /usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data > /usr/local/pgsql/bin/postmaster -D /usr/local/pgsql/data >logfile 2>&1 & > /usr/local/pgsql/bin/createdb test > /usr/local/pgsql/bin/psql test > > > > > ---------------------------(end of broadcast)--------------------------- > TIP 2: you can get off all lists at once with the unregister command > (send "unregister YourEmailAddressHere" to majordomo@postgresql.org) -- Hadley Willan > Systems Development > Deeper Design Limited. +64(7)377-3328 hadley.willan@deeperdesign.co.nz > www.deeperdesign.com > +64(21)-28-41-463 Level 1, 4 Tamamutu St, PO Box 90, TAUPO 2730, New Zealand.
Just skip the adduser part and run postgresql under your user account. Or have the sysadmin add the user for you, and tell you the password he assigned. On 10 Mar 2003, Charles Hauser wrote: > Oh wise ones, > > Novice trying to install postgresql-7.3.2 on linux. > > I am not root, but do have sudo priv. > > I unpacked the tarball in /usr.local/pkg/postgresql-7.3.2. > I got as far as adduser which failed. > > Can someone point me to the error of my ways? > Implications for subsequent steps? > > > regards, > > Charles > > > ./configure ok > gmake ok > sudo gmake install ok > adduser postgres fail > > [chauser@gulliver postgresql-7.3.2]$ adduser postgres > bash: adduser: command not found > > > mkdir /usr/local/pgsql/data > chown postgres /usr/local/pgsql/data > su - postgres > /usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data > /usr/local/pgsql/bin/postmaster -D /usr/local/pgsql/data >logfile 2>&1 & > /usr/local/pgsql/bin/createdb test > /usr/local/pgsql/bin/psql test > > > > > ---------------------------(end of broadcast)--------------------------- > TIP 2: you can get off all lists at once with the unregister command > (send "unregister YourEmailAddressHere" to majordomo@postgresql.org) >
On Mon, Mar 10, 2003 at 04:22:09PM -0500, Andrew Sullivan wrote: > Looks like you don't have adduser on your system, or that it;s not in > your path (I suspect the latter). Possibly postgres is getting > installed in a location not in your path? I know, I know, replying to myself, but reading that over, it didn't even make sense to me. What I _meant_ to say was that you probably don't have adduser in a location on your path. You could add it explicitly before trying to install postgres. e.g. $ PATH=$PATH:/path/to/adduser; export PATH $ sudo [stuff to install postgres] My guess is that adduser is in /sbin/ or /usr/sbin. A -- ---- Andrew Sullivan 204-4141 Yonge Street Liberty RMS Toronto, Ontario Canada <andrew@libertyrms.info> M2P 2A8 +1 416 646 3304 x110
As suggested by Andrew, adduser was not in the path I was in. [chauser@gulliver pgsql]$ ls -l /usr/sbin/adduser lrwxrwxrwx 1 root root 7 Jan 31 15:17 /usr/sbin/adduser -> useradd > > Therefore, try adding the postgres user manually and removing this step > from the process. Or sudo to the account that CAN addusers to the box > and run your install. > If I understand, you are saying that by running 'adduser postgres' then I would be running as root - bad form, and that I am better off using creatdb. so I should; - mkdir usr/local/pgsql/data - /usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data - /usr/local/pgsql/bin/postmaster -D /usr/local/pgsql/data >logfile 2>&1 & - creatdb -U chauser -W test - /usr/local/pgsql/bin/psql test
Andrew, > > I know, I know, replying to myself, but reading that over, it didn't > even make sense to me. What I _meant_ to say was that you probably > don't have adduser in a location on your path. You could add it > explicitly before trying to install postgres. e.g. yep, adduser lives in /usr/sbin [chauser@gulliver pgsql]$ ls -l /usr/sbin/adduser lrwxrwxrwx 1 root root 7 Jan 31 15:17 /usr/sbin/adduser -> useradd Charles
On 10 Mar 2003, Charles Hauser wrote: > As suggested by Andrew, adduser was not in the path I was in. > If I understand, you are saying that by running 'adduser postgres' then > I would be running as root - bad form, and that I am better off using > creatdb. Don't you want to use createuser instead? Rich Dr. Richard B. Shepard, President Applied Ecosystem Services, Inc. (TM) 2404 SW 22nd Street | Troutdale, OR 97060-1247 | U.S.A. + 1 503-667-4517 (voice) | + 1 503-667-8863 (fax) | rshepard@appl-ecosys.com http://www.appl-ecosys.com/
Richard, > Don't you want to use createuser instead? Perhaps, first time install........... ./configure -> ran OK gmake -> ran OK su -> I misunderstood and did NOT do this gmake install -> sudo gmake install ran OK So, I want to: - create a DB with me as owner adduser postgres-> skip? mkdir /usr/local/pgsql/data chown postgres /usr/local/pgsql/data su - postgres ->skip? /usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data /usr/local/pgsql/bin/postmaster -D /usr/local/pgsql/data >logfile 2>&1 & /usr/local/pgsql/bin/createdb test /usr/local/pgsql/bin/psql test Charles
On 10 Mar 2003, Charles Hauser wrote: > Perhaps, first time install........... > > ./configure -> ran OK > gmake -> ran OK > su -> I misunderstood and did NOT do this > gmake install -> sudo gmake install ran OK > > So, I want to: > - create a DB with me as owner > > adduser postgres-> skip? Beg pardon, Charles. I thought you had the postgres user added already. What I've done in the past -- and this may be different with the 7.3 series -- is su to postgres to run initdb, then create me as a user. Rich Dr. Richard B. Shepard, President Applied Ecosystem Services, Inc. (TM) 2404 SW 22nd Street | Troutdale, OR 97060-1247 | U.S.A. + 1 503-667-4517 (voice) | + 1 503-667-8863 (fax) | rshepard@appl-ecosys.com http://www.appl-ecosys.com/
Richard, Apologize for being dense.... Is it advisable/required to: - create a 'postgres' user account which owns /data - and then create user 'chauser' as owner of a specific DB? what I did yesterday was to: [chauser@gulliver pgsql]$ mkdir /usr/local/pgsql/data [chauser@gulliver pgsql]$ sudo chown chauser /usr/local/pgsql/data [chauser@gulliver pgsql]$ /usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data The files belonging to this database system will be owned by user "chauser". This user must also own the server process. ..... I am not root, and can not 'adduser postgres' (sudo will not work?) But from what I am reading I should make user 'postgres' own /data Charles > > Perhaps, first time install........... > > > > ./configure -> ran OK > > gmake -> ran OK > > su -> I misunderstood and did NOT do this > > gmake install -> sudo gmake install ran OK > > > > So, I want to: > > - create a DB with me as owner > > > > adduser postgres-> skip? > > Beg pardon, Charles. I thought you had the postgres user added already. > What I've done in the past -- and this may be different with the 7.3 series > -- is su to postgres to run initdb, then create me as a user. > > Rich > > Dr. Richard B. Shepard, President > > Applied Ecosystem Services, Inc. (TM) > 2404 SW 22nd Street | Troutdale, OR 97060-1247 | U.S.A. > + 1 503-667-4517 (voice) | + 1 503-667-8863 (fax) | rshepard@appl-ecosys.com > http://www.appl-ecosys.com/ >
On 11 Mar 2003, Charles Hauser wrote: > Is it advisable/required to: > - create a 'postgres' user account which owns /data > - and then create user 'chauser' as owner of a specific DB? My understanding is that postgresql installs expecting a user 'postgres' as its admin. What I've done in the past is install postgresql then, as root, use adduser/useradd to create the 'postgres' user account. Once I have postgres living here I 'su postgres' (from my username account), start postgresql (with psql), then issue the command, 'createuser <username> -c -u'. This creates my username as a superuser able to create new databases and new users. Then I usually forget the password for the 'postgres' user because I do all the admin tasks as me. :-) Make sense? HTH, Rich Dr. Richard B. Shepard, President Applied Ecosystem Services, Inc. (TM) 2404 SW 22nd Street | Troutdale, OR 97060-1247 | U.S.A. + 1 503-667-4517 (voice) | + 1 503-667-8863 (fax) | rshepard@appl-ecosys.com http://www.appl-ecosys.com/
What you've done will work fine. If you don't have root access on the box and can't create accounts, running it under your own account is fine. Just know that the database, running something like an untrusted pl language, could be used by other database users to snoop around in your personal directory and everything. On 11 Mar 2003, Charles Hauser wrote: > Richard, > > Apologize for being dense.... > > Is it advisable/required to: > - create a 'postgres' user account which owns /data > - and then create user 'chauser' as owner of a specific DB? > > > what I did yesterday was to: > > [chauser@gulliver pgsql]$ mkdir /usr/local/pgsql/data > [chauser@gulliver pgsql]$ sudo chown chauser /usr/local/pgsql/data > [chauser@gulliver pgsql]$ /usr/local/pgsql/bin/initdb -D > /usr/local/pgsql/data > The files belonging to this database system will be owned by user > "chauser". > This user must also own the server process. > ..... > > I am not root, and can not 'adduser postgres' (sudo will not work?) > > But from what I am reading I should make user 'postgres' own /data > > > Charles > > > > Perhaps, first time install........... > > > > > > ./configure -> ran OK > > > gmake -> ran OK > > > su -> I misunderstood and did NOT do this > > > gmake install -> sudo gmake install ran OK > > > > > > So, I want to: > > > - create a DB with me as owner > > > > > > adduser postgres-> skip? > > > > Beg pardon, Charles. I thought you had the postgres user added already. > > What I've done in the past -- and this may be different with the 7.3 series > > -- is su to postgres to run initdb, then create me as a user. > > > > Rich > > > > Dr. Richard B. Shepard, President > > > > Applied Ecosystem Services, Inc. (TM) > > 2404 SW 22nd Street | Troutdale, OR 97060-1247 | U.S.A. > > + 1 503-667-4517 (voice) | + 1 503-667-8863 (fax) | rshepard@appl-ecosys.com > > http://www.appl-ecosys.com/ > > > > > > ---------------------------(end of broadcast)--------------------------- > TIP 4: Don't 'kill -9' the postmaster >