Bug 253558 - databases/postgresql13-server: possibly review rcorder REQUIRES?
Summary: databases/postgresql13-server: possibly review rcorder REQUIRES?
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: amd64 Any
: --- Affects Only Me
Assignee: pgsql
URL:
Keywords:
: 250966 (view as bug list)
Depends on:
Blocks:
 
Reported: 2021-02-16 15:58 UTC by Kamigishi Rei
Modified: 2021-05-15 09:16 UTC (History)
4 users (show)

See Also:
bugzilla: maintainer-feedback? (pgsql)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kamigishi Rei 2021-02-16 15:58:00 UTC
Currently postgresql has

# REQUIRES sshd

in the rc.d script. Would "DAEMON NETWORK netif" be a better choice?

I noticed that postgresql ends up at the very end of my rcorder with pdns requiring it on 13.0-BETA2; changing the REQUIRES line fixes the issue. This was not the case on 12.2-RELEASE.
Comment 1 Kamigishi Rei 2021-02-21 08:51:06 UTC
Here is the commit that changed this from LOGIN to sshd: https://svnweb.freebsd.org/ports?view=revision&revision=440628

The rationale feels a little dubious.
Comment 2 Catwoolfii 2021-04-21 15:17:06 UTC
I got a problem with autorun this script after building a system without sshd ;) It was a shock when I found such a require in this script.

You need such requirements that the script runs after mounting disks and starting networks (otherwise, postgres will not be able to create sockets):
# REQUIRE: FILESYSTEMS NETWORKING
Comment 3 Palle Girgensohn freebsd_committer 2021-05-14 15:08:08 UTC
I do not completely understand the problem here.

sshd requires

REQUIRE: LOGIN FILESYSTEMS

and postgresql requires sshd

The reason for this is that at one time, postgresql hung for quite a long time when starting, and since sshd was not started yet, I could not get in to investigate the problem as fast I had wished.

Surely, sshd, does start pretty early in the rcorder.

Building without sshd does not break anything. See rcorder man page:

BUGS
     The ‘REQUIRE’ keyword is misleading: It does not describe which daemons
     have to be running before a script will be started.  It describes which
     scripts must be placed before it in the dependency ordering.  For
     example, if your script has a ‘REQUIRE’ on ‘sshd’, it means the script
     must be placed after the ‘sshd’ script in the dependency ordering, not
     necessarily that it requires sshd to be started or enabled.


I don't see any big changes in FreeBSD 13, but please prove me wrong here. I have no problem changing the REQUIRE line, just that I need a more clearly defined problem.

Is it just that yoy think postgresql starts too late?
Comment 4 Kamigishi Rei 2021-05-14 15:24:56 UTC
(In reply to Palle Girgensohn from comment #3)

What does ‘pretty early’ mean? Right now on my 13.0-RELEASE machine rcorder shows sshd well after other services, with only redis and cron starting after it out of the enabled services.

It is similarly late on my other machine (also 13.0-RELEASE), after haproxy, bird, nsd, and other package-provided services. In fact, sshd is 5th from the end of rcorder (184 scripts total).
Comment 5 Palle Girgensohn freebsd_committer 2021-05-14 15:28:20 UTC
OK, fair enough.

And that is the problem, the late start, right?

How about I change it to

FILESYSTEMS NETWORKING syslogd

Would that work for everyone?
Comment 6 Kamigishi Rei 2021-05-14 15:35:20 UTC
(In reply to Palle Girgensohn from comment #5)

Judging by rc(8) the correct REQUIRES would be simply DAEMON: it implies FILESYSTEMS and NETWORKING, and it also implies SERVERS, which syslogd is BEFORE, thus syslogd is guaranteed to be present at DAEMON time.
Comment 7 Kamigishi Rei 2021-05-14 15:36:56 UTC
…Could also be SERVERS since it does not seem to require any of the SERVERS stuff.
Comment 8 Palle Girgensohn freebsd_committer 2021-05-14 23:37:05 UTC
*** Bug 250966 has been marked as a duplicate of this bug. ***
Comment 9 commit-hook freebsd_committer 2021-05-15 09:13:25 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=ab83f2b4bb78a718efa5c43247ba1e1d207f99b6

commit ab83f2b4bb78a718efa5c43247ba1e1d207f99b6
Author:     Palle Girgensohn <girgen@FreeBSD.org>
AuthorDate: 2021-05-15 09:11:12 +0000
Commit:     Palle Girgensohn <girgen@FreeBSD.org>
CommitDate: 2021-05-15 09:12:17 +0000

    databases/postgresql??-*: Upgrade to latest version

    PostgreSQL 13.3, 12.7, 11.12, 10.17, and 9.6.22 Released!

    The PostgreSQL Global Development Group has released an update to all supported
    versions of our database system, including 13.3, 12.7, 11.12, 10.17, and
    9.6.22. This release closes three security vulnerabilities and fixes over 45
    bugs reported over the last three months.

    Security fixes in this release:

    CVE-2021-32027: Buffer overrun from integer overflow in array subscripting
                    calculations

    CVE-2021-32028: Memory disclosure in INSERT ... ON CONFLICT ... DO UPDATE

    CVE-2021-32029: Memory disclosure in partitioned-table UPDATE ... RETURNING

    Also plenty of bug fixes. See the release note for details.

    Changes to the port:

    Make sure we use the matching version of llvm. This fixes a problem with the
    llvm version string not being monotonically increasing with the version
    number. [1]

    Better pkg message about checksums for postgresql 12+. [2] [4]

    Adjust login class parameter to adhere to the documentation in rc.subr(8) [3]:
      The rc.conf parameter for the login class of the postgresql daemon has
      changed name from postgresql_class to postgresql_login_class, since
      rc.subr(8) states that the parameter should be named ${name}_login_class.

    Allow parallel builds. [5]

    Correct the directory name for the user postgres in pkg message. [6]

    PR:             250824 [1], 253558 [2], 236060 [3], 233106 [4],  230656 [5]
    PR:             226674 [6]
    Submitted by:   Michael Zhilin [2], Michael Zhilin [3], Dmitry Chestnykh [4]
    Submitted by:   Steve Wills [5], knezour [6]

    Security:       76e0bb86-b4cb-11eb-b9c9-6cc21735f730
    Security:       62da9702-b4cc-11eb-b9c9-6cc21735f730

    Release notes:  https://www.postgresql.org/docs/release/

 UPDATING                                           |  8 ++++++
 databases/postgresql10-server/Makefile             |  4 +--
 databases/postgresql10-server/distinfo             |  6 ++---
 .../files/pkg-message-server.in                    |  8 +++---
 databases/postgresql10-server/files/postgresql.in  |  8 +++---
 databases/postgresql11-server/Makefile             |  4 +--
 databases/postgresql11-server/distinfo             |  6 ++---
 .../files/pkg-message-server.in                    |  8 +++---
 databases/postgresql11-server/files/postgresql.in  |  8 +++---
 databases/postgresql12-server/Makefile             |  4 +--
 databases/postgresql12-server/distinfo             |  6 ++---
 .../files/pkg-message-server.in                    | 14 +++++-----
 databases/postgresql12-server/files/postgresql.in  |  8 +++---
 databases/postgresql13-server/Makefile             | 31 +++++++++++++++-------
 databases/postgresql13-server/distinfo             |  6 ++---
 .../files/pkg-message-server.in                    | 14 +++++-----
 databases/postgresql13-server/files/postgresql.in  |  8 +++---
 databases/postgresql13-server/pkg-plist-client     |  1 +
 databases/postgresql13-server/pkg-plist-server     |  8 ++++++
 .../files/pkg-message-server.in                    |  8 +++---
 databases/postgresql96-server/Makefile             |  4 +--
 databases/postgresql96-server/distinfo             |  6 ++---
 .../files/pkg-message-server.in                    |  8 +++---
 databases/postgresql96-server/files/postgresql.in  |  8 +++---
 24 files changed, 112 insertions(+), 82 deletions(-)
Comment 10 Palle Girgensohn freebsd_committer 2021-05-15 09:16:37 UTC
Committed. Thanks!