malformated LSB header in postgres: missing LSB end marker, aborting

From: Matthias Apitz <guru(at)unixarea(dot)de>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: malformated LSB header in postgres: missing LSB end marker, aborting
Date: 2026-03-25 10:48:51
Message-ID: acO9k1XLTEmCo+sj@pureos
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-general


Hello,

We use the following script as /etc/init.d/postgres on
SuSE Linux Enterprise, SLES 15 SP7, to start PostgreSQL 16.5 server:

$ tar tzf postgresql-16.5.tar.gz | grep start-scripts/linux
postgresql-16.5/contrib/start-scripts/linux

# cp postgresql-16.5/contrib/start-scripts/linux /etc/init.d/postgres

# head -10 /etc/init.d/postgres
#! /bin/sh

# chkconfig: 2345 98 02
# description: PostgreSQL RDBMS

# This is an example of a start/stop script for SysV-style init, such
# as is used on Linux systems. You should edit some of the variables
# and maybe the 'echo' commands.
#
# Place this file at /etc/init.d/postgresql (or
# ...

Together with systemd services this gives the following error:

# systemctl enable postgres.service
Synchronizing state of postgres.service with SysV service script with /usr/lib/systemd/systemd-sysv-install.
Executing: /usr/lib/systemd/systemd-sysv-install enable postgres
error: malformated LSB header in postgres: missing LSB end marker, aborting.

The service file contains:

# cat /etc/systemd/system/postgres.service
[Unit]
Description=SunRise PostgreSQL server
After=systemd-user-sessions.service

[Service]
ExecStart=/etc/init.d/postgres start
ExecStop=/etc/init.d/postgres stop
TimeoutStartSec=infinity
RemainAfterExit=yes

[Install]
WantedBy=multi-user.target

When I enhance the script with this section between BEGIN / END

# cat /etc/init.d/postgres
#! /bin/sh
# chkconfig: 2345 98 02
# description: PostgreSQL RDBMS
### BEGIN INIT INFO
# Provides: postgresql
# Required-Start: $network $named
# Required-Stop:
# Default-Start: 3 5
# Default-Stop:
# Description:
### END INIT INFO
...

The error goes away:

# systemctl enable postgres.service
Synchronizing state of postgres.service with SysV service script with /usr/lib/systemd/systemd-sysv-install.
Executing: /usr/lib/systemd/systemd-sysv-install enable postgres
ln -sf ../postgres /etc/init.d/rc3.d/S50postgres
ln -sf ../postgres /etc/init.d/rc5.d/S50postgres

Any comments on this?

Thanks

matthias

--
Matthias Apitz, ✉ guru(at)unixarea(dot)de, http://www.unixarea.de/ +49-176-38902045
Public GnuPG key: http://www.unixarea.de/key.pub

Annalena Baerbock: "We are fighting a war against Russia ..." (25.1.2023)

I, Matthias, I am not at war with Russia.
Я не воюю с Россией.
Ich bin nicht im Krieg mit Russland.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2026-03-25 14:35:21 Re: malformated LSB header in postgres: missing LSB end marker, aborting
Previous Message Aayra Singh 2026-03-25 03:05:38 RE: Recall: PostGre SQL/ HCL