Received: by mail.netbsd.org (Postfix, from userid 605) id B625184E98; Sun, 2 Oct 2022 14:24:51 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mail.netbsd.org (Postfix) with ESMTP id E555184E57 for ; Sun, 2 Oct 2022 14:24:50 +0000 (UTC) X-Virus-Scanned: amavisd-new at netbsd.org Received: from mail.netbsd.org ([127.0.0.1]) by localhost (mail.netbsd.org [127.0.0.1]) (amavisd-new, port 10025) with ESMTP id NVI7xtV0zFTf for ; Sun, 2 Oct 2022 14:24:50 +0000 (UTC) Received: from cvs.NetBSD.org (ivanova.netbsd.org [199.233.217.197]) by mail.netbsd.org (Postfix) with ESMTP id 47B2D84D25 for ; Sun, 2 Oct 2022 14:24:50 +0000 (UTC) Received: by cvs.NetBSD.org (Postfix, from userid 500) id 38A1DFA90; Sun, 2 Oct 2022 14:24:50 +0000 (UTC) Content-Transfer-Encoding: 7bit Content-Type: multipart/mixed; boundary="_----------=_1664720690171150" MIME-Version: 1.0 Date: Sun, 2 Oct 2022 14:24:50 +0000 From: "Martin Husemann" Subject: CVS commit: pkgsrc/databases/postgresql14-server/files To: pkgsrc-changes@NetBSD.org Reply-To: martin@netbsd.org X-Mailer: log_accum Message-Id: <20221002142450.38A1DFA90@cvs.NetBSD.org> Sender: pkgsrc-changes-owner@NetBSD.org List-Id: Precedence: bulk List-Unsubscribe: This is a multi-part message in MIME format. --_----------=_1664720690171150 Content-Disposition: inline Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" Module Name: pkgsrc Committed By: martin Date: Sun Oct 2 14:24:50 UTC 2022 Modified Files: pkgsrc/databases/postgresql14-server/files: pgsql.sh Log Message: Remove unneded double evaluation from big parts (fixing quoting bugs). Split command line arguments in regular "command_args" and the daemon command args, as some of the latter are not working when initializing the system database tables. Avoid obsolete "-a" operator to test. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 pkgsrc/databases/postgresql14-server/files/pgsql.sh Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. --_----------=_1664720690171150 Content-Disposition: inline Content-Length: 2873 Content-Transfer-Encoding: binary Content-Type: text/x-diff; charset=us-ascii Modified files: Index: pkgsrc/databases/postgresql14-server/files/pgsql.sh diff -u pkgsrc/databases/postgresql14-server/files/pgsql.sh:1.1 pkgsrc/databases/postgresql14-server/files/pgsql.sh:1.2 --- pkgsrc/databases/postgresql14-server/files/pgsql.sh:1.1 Fri Oct 8 10:23:44 2021 +++ pkgsrc/databases/postgresql14-server/files/pgsql.sh Sun Oct 2 14:24:50 2022 @@ -1,6 +1,6 @@ #!@RCD_SCRIPTS_SHELL@ # -# $NetBSD: pgsql.sh,v 1.1 2021/10/08 10:23:44 adam Exp $ +# $NetBSD: pgsql.sh,v 1.2 2022/10/02 14:24:50 martin Exp $ # # PostgreSQL database rc.d control script # @@ -30,6 +30,7 @@ procname="@PREFIX@/bin/postgres" : ${pgsql_group:=@PGGROUP@} : ${pgsql_home:=@PGHOME@} +pgsql_nfiles=4096 extra_commands="initdb reload" initdb_cmd="pgsql_initdb" start_precmd="pgsql_precmd" @@ -39,7 +40,7 @@ restart_cmd="pgsql_restart" stop_cmd="pgsql_stop" reload_cmd="pgsql_reload" -if [ -f /etc/rc.subr -a -d /etc/rc.d -a -f /etc/rc.d/DAEMON ]; then +if [ -f /etc/rc.subr ] && [ -d /etc/rc.d ] && [ -f /etc/rc.d/DAEMON ]; then load_rc_config $name elif [ -f /etc/rc.conf ]; then . /etc/rc.conf @@ -48,13 +49,14 @@ fi cd / command_args="-w -s -D ${pgsql_home}/data -m fast -l ${pgsql_home}/errlog" +command_args_daemon="${command_args}" if [ -n "${pgsql_flags}" ]; then - command_args="${command_args} -o \\\"${pgsql_flags}\\\"" + command_args_daemon="${command_args} -o \"${pgsql_flags}\"" fi pgsql_precmd() { - ulimit -n 4096 + ulimit -n ${pgsql_nfiles} if [ ! -d ${pgsql_home}/data/base ]; then pgsql_initdb fi @@ -71,40 +73,35 @@ pgsql_initdb() @CHOWN@ ${pgsql_user} ${pgsql_home} @CHGRP@ ${pgsql_group} ${pgsql_home} @CHMOD@ 0700 ${pgsql_home} - doit="@SU@ -m ${pgsql_user} -c '${command} init ${command_args}'" - eval $doit + @SU@ -m ${pgsql_user} -c "${command} init ${command_args}" fi } pgsql_start() { @ECHO@ "Starting ${name}." - doit="@SU@ -m ${pgsql_user} -c '${command} start ${command_args}'" - eval $doit + @SU@ -m ${pgsql_user} -c "${command} start ${command_args_daemon}" } pgsql_restart() { @ECHO@ "Restarting ${name}." - doit="@SU@ -m ${pgsql_user} -c '${command} restart ${command_args}'" - eval $doit + @SU@ -m ${pgsql_user} -c "${command} restart ${command_args_daemon}" } pgsql_stop() { @ECHO@ "Stopping ${name}." - doit="@SU@ -m ${pgsql_user} -c '${command} stop ${command_args}'" - eval $doit + @SU@ -m ${pgsql_user} -c "${command} stop ${command_args}" } pgsql_reload() { @ECHO@ "Reloading ${name}." - doit="@SU@ -m ${pgsql_user} -c '${command} reload ${command_args}'" - eval $doit + @SU@ -m ${pgsql_user} -c "${command} reload ${command_args_daemon}" } -if [ -f /etc/rc.subr -a -d /etc/rc.d -a -f /etc/rc.d/DAEMON ]; then +if [ -f /etc/rc.subr ] && [ -d /etc/rc.d ] && [ -f /etc/rc.d/DAEMON ]; then run_rc_command "$1" else pidfile="${pgsql_home}/data/postmaster.pid" --_----------=_1664720690171150--