Mailinglist Archive: opensuse-factory (1324 mails)

< Previous Next >
Re: [opensuse-factory] Tumbleweed: how to "enable" (run at boot) postgresql 9.4.4 service.. [GPG signed]
On Sunday 11 October 2015 10.33:52 André Verwijs wrote:

Tumbleweed: how to "enable" (run at boot) PostgrwSQL 9.4.4 service


when i run....

OpenSUSE-TW:~ # systemctl enable postgresql.service

postgresql.service is not a native service, redirecting to
systemd-sysv-install
Executing /usr/lib/systemd/systemd-sysv-install enable postgresql
Failed to execute /usr/lib/systemd/systemd-sysv-install: No such file or
directory


when i start postgresql, it works great.....

OpenSUSE-TW:~ # service postgresql start

OpenSUSE-TW:~ # systemctl status postgresql.service

postgresql.service - LSB: Start the PostgreSQL master daemon
Loaded: loaded (/etc/init.d/postgresql)
Active: active (exited) since Sun 2015-10-11 09:49:08 CEST; 2s ago
Docs: man:systemd-sysv-generator(8)

Process: 3781 ExecStart=/etc/init.d/postgresql start (code=exited,
status=0/SUCCESS)
Oct 11 09:49:07 OpenSUSE-TW systemd[1]: Starting LSB: Start the
PostgreSQL master daemon...
Oct 11 09:49:07 OpenSUSE-TW su[3793]: (to postgres) root on none
Oct 11 09:49:07 OpenSUSE-TW su[3793]: pam_unix(su-l:session): session
opened for user postgres by (uid=0)
Oct 11 09:49:07 OpenSUSE-TW su[3831]: (to postgres) root on none
Oct 11 09:49:07 OpenSUSE-TW su[3831]: pam_unix(su-l:session):
sessionopened for user postgres by (uid=0)
Oct 11 09:49:08 OpenSUSE-TW systemd[1]: Started LSB: Start the
PostgreSQL master daemon.
Oct 11 09:49:08 OpenSUSE-TW postgresql[3781]: Starting PostgreSQL 9.4.4
..done

for other services there's no problem, so why postgresql can't be
added/activated, i don't know....


tips are welcome...
André



From where come the 9.4x postgresql package on TW there's no such one in factory
https://build.opensuse.org/package/show/openSUSE:Factory/postgresql

But (at this is the funniest part) it's present in Leap:42.1
https://build.opensuse.org/package/show/openSUSE:Leap:42.1/postgresql94

Anyway, if you init your database manually correctly you can then use this kind
of service
in /etc/systemd/system

postgresql-9.4.service

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

[Service]
Type=forking

User=postgres
Group=postgres

# Note: avoid inserting whitespace in these Environment= lines, or you may
# break postgresql-setup.

# Port number for server to listen on
Environment=PGPORT=5432

# Location of database directory
Environment=PGDATA=/var/lib/pgsql/data/

# Allow all gdal outbound raster drivers
Environment=POSTGIS_ENABLE_OUTDB_RASTERS=1
Environment=POSTGIS_GDAL_ENABLED_DRIVERS=ENABLE_ALL


# Where to send early-startup messages from the server (before the logging
# options of postgresql.conf take effect)
StandardOutput=syslog

# Disable OOM kill on the postmaster
OOMScoreAdjust=-1000

ExecStart=/usr/bin/pg_ctl start -D ${PGDATA} -s -o "-p ${PGPORT}" -w -t 300
ExecStop=/usr/bin/pg_ctl stop -D ${PGDATA} -s -m fast
ExecReload=/usr/bin/pg_ctl reload -D ${PGDATA} -s

# Give a reasonable amount of time for the server to start up/shut down
TimeoutSec=300

[Install]
WantedBy=multi-user.target


You have to adjust data path and binaries if you have several pg version
installed.
But I think you've got the idea.
I'm using this since 9.1 under 12.3 and 9.2 with 13.1 work perfect.



--

Bruno Friedmann
Ioda-Net Sàrl www.ioda-net.ch

openSUSE Member & Board, fsfe fellowship
GPG KEY : D5C9B751C4653227
irc: tigerfoot
< Previous Next >
References