installing postgreSQL on 13.1

First, thanks to all, for this wonderful distribution of Linux.

I really like openSuse…

Hope this can help others…

Fresh install of 13.1
with Yast Software manager

Select to install postgreSQL-server(will be 9.2.4-4.1.3 that comes with OpenSuse13.1)

also select postgresql-contrib- [size=1]Contributed Extensions and Additions to PostgreSQL[/size]

Apparently the file for systemd is missing and the soft link too.

so the postgresql service does not show up in the YaST SERVICE MANAGER

My fix (all as root)

  1. Set in /etc/sysconfig (with YaST)
    the POSTGRES_DATADIR to /home/postgres92/data
    (/home has the big partition…)

  2. Run from command line
    service postgresql start
    This will run the old script in /etc/init.d/postgresql and initialize a new database in /home/postgres92/data

  3. create this file postgresql.service in /usr/lib/systemd/system/

cd /usr/lib/systemd/system/
vi postgresql.service

(copy this and save )

[Unit]
Description=PostgreSQL database server
After=network.target

[Service]
Type=forking
TimeoutSec=120
User=postgres
Group=postgres

Environment=PGROOT=/home/postgres92

SyslogIdentifier=postgres
PIDFile=$PGROOT/data/postmaster.pid

ExecStartPre=/usr/bin/postgresql-check-db-dir ${PGROOT}/data

ExecStart= /usr/bin/pg_ctl -s -D ${PGROOT}/data start -w -t 120
ExecReload=/usr/bin/pg_ctl -s -D ${PGROOT}/data reload
ExecStop= /usr/bin/pg_ctl -s -D ${PGROOT}/data stop -m fast

Due to PostgreSQL’s use of shared memory, OOM killer is often overzealous in

killing Postgres, so adjust it downward

OOMScoreAdjust=-200

[Install]
WantedBy=multi-user.target

  1. Run this (to create the soft link)

ln -s /usr/lib/systemd/system/postgresql.service /etc/systemd/system/multi-user.target.wants/postgesql.service

reboot

now postgresql will show up as a service with systemd in YaST SERVICE MANAGER
and will be set to Enable and Active so it will start after every reboot

thanks for the help from these links for pointing me in the right direction

https://projects.archlinux.org/svntogit/packages.git/tree/trunk/postgresql.service?h=packages/postgresql

and

https://bbs.archlinux.org/viewtopic.php?pid=1213552

Yossi

First refer to bug https://bugzilla.novell.com/show_bug.cgi?id=799471
Postgresql /etc/init.d/postgresql still works (have a look at the png attachement in the bug)

Secondly you should never never never never (repeat 1000 times after me) place something that is specific to your environment in system part
So if you want to create a native postgresql.service for systemd on your system place it in /etc/systemd/system

Otherwise, the day the package will offer a wide system script your will be replaced or the new one will be in a .rpmnew file and you will miss it.

Clarifying what Bruno just stated,

A distro comes with its own set of systemd Unit config files.
If you wish to add or edit a Unit file, you should <not> edit the files directly.

If you’re editing a file simply copy the file to the location Bruno describes and make your customizations.
Or, if you’re creating a new Unit file, do it in that same location Bruno describes.

Any files in that location will over-ride any existing default Unit files.

This makes it easy to
If you make a mistake, you still have the original. In fact, just delete your custom Unit file and the original will take effect.

HTH,
TSU

hello Bruno hello dear TSU

i also am willing to install postgresql on opensuse 13.1 - well i want to combine it with osmosis

first question : do i have to make some checks - to get an overview on the ressources and the performance and space etc. etx.

note: i need to run postgresql with osmosis - so therefore i need some ressorces left.

just need your advice for the first test -

afterwards i am going to install postgresql

btw: i am willing to follow the advices of Bruno:

Secondly you should never never never never (repeat 1000 times after me) place something that is specific to your environment in system part. So if you want to create a native postgresql.service for systemd on your system place it in /etc/systemd/system

i will try to avoid the mistakes:

  1. Set in /etc/sysconfig (with YaST)
    the POSTGRES_DATADIR to /home/postgres92/data
    (/home has the big partition…)
  1. create this file postgresql.service in /usr/lib/systemd/system/
    cd /usr/lib/systemd/system/
    vi postgresql.service

love to her from you