Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ebSu1-0005qA-9M for pgsql-docs@arkaria.postgresql.org; Tue, 16 Jan 2018 15:11:53 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ebSu0-0002z2-Qh for pgsql-docs@arkaria.postgresql.org; Tue, 16 Jan 2018 15:11:52 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ebCym-0005kO-Kr for pgsql-docs@lists.postgresql.org; Mon, 15 Jan 2018 22:11:44 +0000 Received: from mail-io0-x242.google.com ([2607:f8b0:4001:c06::242]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1ebCyj-00066E-Jz for pgsql-docs@lists.postgresql.org; Mon, 15 Jan 2018 22:11:44 +0000 Received: by mail-io0-x242.google.com with SMTP id t63so14660040iod.0 for ; Mon, 15 Jan 2018 14:11:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=94nO+tXMYxTFDCXoyOpCp+NZL+viS+IOdcweyKZGE78=; b=e9RBLO0IfQTUkl5XZ9XaL2ITT/3UFWgvKmyf8FsflstFM57bKZ2skUmaClfV6d9od3 y1gHq9Abb1sdvdBnX2wZNN5tRPWK1Wga3gwMNTXGxIan8MgV6ZjY3c4KuPeqHp0GawFp P1wtco03njyfFjo8FBSLhf/4+AVU3I9xMzSxO7JJPIn0f1JyNvTakaEdlAMfkCm2PjmA qEQrLeOYUu7KQtU1/iQlH+C7yvgesLAk2TSkIz9UBDsLM/u26je+87L5kACNSZxvmwt5 xTbbdQH5rVvqfYO1vdAGeoUCN8zYcZiG1kcQecDPiSgdENtMpq1XOqPlmkstdcGfgqw2 KPeA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=94nO+tXMYxTFDCXoyOpCp+NZL+viS+IOdcweyKZGE78=; b=ssXBHGnCeKKl4lWJsEWcAzYVkxh7H2Z/dmOnM1TwZYu/M0dEazzi0d2rbciKFqPWxD ALLRGZ3wLdINFaKcVb1tXBLNErYnFSftrzGMKqowXn07HmX6PTgkQOQvDYME1MNh3EEc qSgv8WlOlcyBEEKXL1NAmTrZK+8UqlbA0hx8QS5L0pc+xtn8qF+kJqKbyKUjidE/Hrrr PEFYNfyrrwM/kJVFREoHD1aGa6wi/+mwQlZNCiEX9w4zjC4AMic4l4WZ7Ckj9rGkLmyx /FpkBWDiIj4Dxw0wJvzUJDko7BMpimgUMUORI+CinC3cvSy9KxbvE5sEKAZ2NDji2elq 8bgg== X-Gm-Message-State: AKwxyteKKRaajbQi5l8OleJk7bnGA4WJpLtM+8CVAGE48QuMZ/Lv5R+f CQ4OAnRcJNyXnD4Kuu/ebGin/TEJcv5QRcfkwNc= X-Google-Smtp-Source: ACJfBosvelrccckShelAuRQWZAY1JXgdPC2jBMRSwB5wJKC/Gad/8DRBliZuxTLm0APPIbSX/tV+y8mpU7bnb2gnTuw= X-Received: by 10.107.173.159 with SMTP id m31mr35921445ioo.36.1516054298123; Mon, 15 Jan 2018 14:11:38 -0800 (PST) MIME-Version: 1.0 Received: by 10.2.137.146 with HTTP; Mon, 15 Jan 2018 14:11:37 -0800 (PST) In-Reply-To: <10688.1516053366@sss.pgh.pa.us> References: <20180115213024.3624.26539@wrigleys.postgresql.org> <10688.1516053366@sss.pgh.pa.us> From: Scott Watson Date: Mon, 15 Jan 2018 17:11:37 -0500 Message-ID: Subject: Re: initdb To: Tom Lane Cc: pgsql-docs@lists.postgresql.org Content-Type: multipart/alternative; boundary="001a11449db4e65ffb0562d7e589" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --001a11449db4e65ffb0562d7e589 Content-Type: text/plain; charset="UTF-8" Hi Tom, I was running initdb command when calling the postgresql96-setup command. Trying to run this as the user postgres failed. /usr/pgsql-9.6/bin/postgresql96-setup initdb The database was created under /var/lib/pgsql/9.6/data thanks Scott. On Mon, Jan 15, 2018 at 4:56 PM, Tom Lane wrote: > =?utf-8?q?PG_Doc_comments_form?= writes: > > So I was trying to create a new db with initdb. I tried to run this with > > the postgres user after installing the server rpm and it failed with > runuser > > may not be run as non-root users. So then for fun I tried to run init > db > > as the root user which should have failed but instead it just reported > > initializing database ... OK > > hmm, worksforme: > > $ sudo initdb -D someplace > initdb: cannot be run as root > Please log in (using, e.g., "su") as the (unprivileged) user that will > own the server process. > > Were you actually running initdb directly, or some script that perhaps > sudo'd internally? > > regards, tom lane > --001a11449db4e65ffb0562d7e589 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi Tom,=C2=A0

I was running initdb comm= and when calling the postgresql96-setup command.=C2=A0 =C2=A0 Trying to run= this as the user postgres failed.

/usr/pgsql-9.6/bin/postgresql96-setup initdb

The database was created under /var/lib/pgsql/9.6/dat= a

<= span style=3D"color:rgb(0,0,0);font-family:monospace;font-size:10.764px;bac= kground-color:rgb(247,247,247)">thanks
Scott.

=

On Mon, Jan 15, 2018 at 4:56 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
=3D?utf-8?q?PG_Doc_comments_= form?=3D <noreply@postgre= sql.org> writes:
> So I was trying to create a new db with initdb.=C2=A0 I tried to run t= his with
> the postgres user after installing the server rpm and it failed with r= unuser
> may not be run as non-root users.=C2=A0 =C2=A0So then for fun I tried = to run init db
> as the root user which should have failed but instead it just reported=
> initializing database ... OK

hmm, worksforme:

$ sudo initdb -D someplace
initdb: cannot be run as root
Please log in (using, e.g., "su") as the (unprivileged) user that= will
own the server process.

Were you actually running initdb directly, or some script that perhaps
sudo'd internally?

=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 regards, tom lane

--001a11449db4e65ffb0562d7e589--