Thread: postgresql94-setup problems on centos7

postgresql94-setup problems on centos7

From
H Visage
Date:
Hi there,

 I'd like to add a couple of different database clusters, and want them named different as systemd services. So I created the Bulk.service & Web.service files in /etc/systemd/system/multi-user.target.wants which includes back the /lib/systemd/system/postgresql-9.4.service

The problem is this fails when I want to do a "/usr/pgsql-9.4/bin/postgresql94-setup initdb Bulk"

tracing the problem, it fails with:

+ '[' -f /etc/systemd/system/Bulk.service ']'
+ '[' -f /lib/systemd/system/Bulk.service ']'
+ echo 'Could not find systemd unit file Bulk.service'
Could not find systemd unit file Bulk.service

the test *should* be:
  -f /etc/systemd/system/multi-user.target.wants/${SERVICE}.service

(Especially as it's default service file gets installed/linked from /etc/systemd/system/multi-user.target.wants/postgresql-9.4.service )

--
---
Hendrik Visage
Envisage Systems / Envisage Cloud Solutions
084-612-5345 or 083-675-5506
hvisage@envisage.co.za

Re: postgresql94-setup problems on centos7

From
Devrim GÜNDÜZ
Date:

Hi,

I think our version is true.

See the first few lines of the service file, please:

http://git.postgresql.org/gitweb/?p=pgrpms.git;a=blob_plain;f=rpm/redha
t/9.4/postgresql/EL-7/postgresql-9.4.service;hb=HEAD

To create a new service, just create your file under
/etc/systemd/system/web.service .


systemctl enable web.service

will create the *symlinks* under multi-user.target.wants directory.

I hope that is clear.

Regards, Devrim


On Wed, 2015-09-16 at 01:10 +0200, H Visage wrote:
> Hi there,
>
>  I'd like to add a couple of different database clusters, and want
> them
> named different as systemd services. So I created the Bulk.service &
> Web.service files in /etc/systemd/system/multi-user.target.wants
> which
> includes back the /lib/systemd/system/postgresql-9.4.service
>
> The problem is this fails when I want to do a
> "/usr/pgsql-9.4/bin/postgresql94-setup initdb Bulk"
>
> tracing the problem, it fails with:
>
> + '[' -f /etc/systemd/system/Bulk.service ']'
> + '[' -f /lib/systemd/system/Bulk.service ']'
> + echo 'Could not find systemd unit file Bulk.service'
> Could not find systemd unit file Bulk.service
>
> the test *should* be:
>   -f /etc/systemd/system/multi-user.target.wants/${SERVICE}.service
>
> (Especially as it's default service file gets installed/linked from
> /etc/systemd/system/multi-user.target.wants/postgresql-9.4.service )
>

--
Devrim GÜNDÜZ
Principal Systems Engineer @ EnterpriseDB: http://www.enterprisedb.com
PostgreSQL Danışmanı/Consultant, Red Hat Certified Engineer
Twitter: @DevrimGunduz , @DevrimGunduzTR





Re: postgresql94-setup problems on centos7

From
H Visage
Date:
Hi Devrim,

Thank you, was just confusing that the file I had to remove wasn't in /etc/systemd/system but in the .../multi-user.target directory

eventually got it going

On Wed, Sep 16, 2015 at 10:28 AM, Devrim GÜNDÜZ <devrim@gunduz.org> wrote:


Hi,

I think our version is true.

See the first few lines of the service file, please:

http://git.postgresql.org/gitweb/?p=pgrpms.git;a=blob_plain;f=rpm/redha
t/9.4/postgresql/EL-7/postgresql-9.4.service;hb=HEAD


To create a new service, just create your file under
/etc/systemd/system/web.service .


systemctl enable web.service

will create the *symlinks* under multi-user.target.wants directory.

I hope that is clear.

Regards, Devrim


On Wed, 2015-09-16 at 01:10 +0200, H Visage wrote:
> Hi there,
>
>  I'd like to add a couple of different database clusters, and want
> them
> named different as systemd services. So I created the Bulk.service &
> Web.service files in /etc/systemd/system/multi-user.target.wants
> which
> includes back the /lib/systemd/system/postgresql-9.4.service
>
> The problem is this fails when I want to do a
> "/usr/pgsql-9.4/bin/postgresql94-setup initdb Bulk"
>
> tracing the problem, it fails with:
>
> + '[' -f /etc/systemd/system/Bulk.service ']'
> + '[' -f /lib/systemd/system/Bulk.service ']'
> + echo 'Could not find systemd unit file Bulk.service'
> Could not find systemd unit file Bulk.service
>
> the test *should* be:
>   -f /etc/systemd/system/multi-user.target.wants/${SERVICE}.service
>
> (Especially as it's default service file gets installed/linked from
> /etc/systemd/system/multi-user.target.wants/postgresql-9.4.service )
>

--
Devrim GÜNDÜZ
Principal Systems Engineer @ EnterpriseDB: http://www.enterprisedb.com
PostgreSQL Danışmanı/Consultant, Red Hat Certified Engineer
Twitter: @DevrimGunduz , @DevrimGunduzTR






--
---
Hendrik Visage
Envisage Systems / Envisage Cloud Solutions
084-612-5345 or 083-675-5506
hvisage@envisage.co.za