pkgsrc-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: pkgsrc/databases/postgresql16-server/files



Module Name:    pkgsrc
Committed By:   triaxx
Date:           Thu Oct  5 21:11:36 UTC 2023

Modified Files:
        pkgsrc/databases/postgresql16-server/files: pgsql.sh

Log Message:
postgresql16-server: Fix rc.d script for OS using pkgtools/rc.subr

Some systems (e.g. macOS) do not have /etc/rc.subr. For unprivileged
bootstrapped pkgsrc with pkgtools/rc.d-boot and pkgtools/rc.subr, rc.conf
and rc.subr are installed in ${SYSCONFBASE}.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 pkgsrc/databases/postgresql16-server/files/pgsql.sh

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/databases/postgresql16-server/files/pgsql.sh
diff -u pkgsrc/databases/postgresql16-server/files/pgsql.sh:1.1 pkgsrc/databases/postgresql16-server/files/pgsql.sh:1.2
--- pkgsrc/databases/postgresql16-server/files/pgsql.sh:1.1     Sun Sep 17 08:53:22 2023
+++ pkgsrc/databases/postgresql16-server/files/pgsql.sh Thu Oct  5 21:11:36 2023
@@ -1,6 +1,6 @@
 #!@RCD_SCRIPTS_SHELL@
 #
-# $NetBSD: pgsql.sh,v 1.1 2023/09/17 08:53:22 adam Exp $
+# $NetBSD: pgsql.sh,v 1.2 2023/10/05 21:11:36 triaxx Exp $
 #
 # PostgreSQL database rc.d control script
 #
@@ -18,9 +18,7 @@
 #      pgsql_home="/path/to/home"      # path to pgsql database directory
 # See postmaster(1) for possible options.
 
-if [ -f /etc/rc.subr ]; then
-       . /etc/rc.subr
-fi
+$_rc_subr_loaded . @SYSCONFBASE@/rc.subr
 
 name="pgsql"
 rcvar=${name}
@@ -40,10 +38,12 @@ restart_cmd="pgsql_restart"
 stop_cmd="pgsql_stop"
 reload_cmd="pgsql_reload"
 
-if [ -f /etc/rc.subr ] && [ -d /etc/rc.d ] && [ -f /etc/rc.d/DAEMON ]; then
+if [ -f @SYSCONFBASE@/rc.subr ] && \
+   [ -d @SYSCONFBASE@/rc.d ] && \
+   [ -f @SYSCONFBASE@/rc.d/DAEMON ]; then
        load_rc_config $name
-elif [ -f /etc/rc.conf ]; then
-       . /etc/rc.conf
+elif [ -f @SYSCONFBASE@/rc.conf ]; then
+       . @SYSCONFBASE@/rc.conf
 fi
 
 cd /
@@ -101,7 +101,9 @@ pgsql_reload()
        @SU@ -m ${pgsql_user} -c "${command} reload ${command_args_daemon}"
 }
 
-if [ -f /etc/rc.subr ] && [ -d /etc/rc.d ] && [ -f /etc/rc.d/DAEMON ]; then
+if [ -f @SYSCONFBASE@/rc.subr ] && \
+   [ -d @SYSCONFBASE@/rc.d ] && \
+   [ -f @SYSCONFBASE@/rc.d/DAEMON ]; then
        run_rc_command "$1"
 else
        pidfile="${pgsql_home}/data/postmaster.pid"



Home | Main Index | Thread Index | Old Index