Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1gHoik-0005e9-7l for pgsql-general@arkaria.postgresql.org; Wed, 31 Oct 2018 11:31:34 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gHoih-0004p3-Vw for pgsql-general@arkaria.postgresql.org; Wed, 31 Oct 2018 11:31:31 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1gHbGo-0006e9-H4 for pgsql-general@lists.postgresql.org; Tue, 30 Oct 2018 21:09:50 +0000 Received: from mail-ed1-x52c.google.com ([2a00:1450:4864:20::52c]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gHbGl-00023t-CY for pgsql-general@postgresql.org; Tue, 30 Oct 2018 21:09:49 +0000 Received: by mail-ed1-x52c.google.com with SMTP id e5-v6so11796737eds.6 for ; Tue, 30 Oct 2018 14:09:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=HTVfhSok0SE3eJ3Mmgt0cDY0F1mc8PsFM/r4JzJPFFg=; b=TmdJ1z6tLf8PHlW27BCuv4JvCWsBTiQZqyALiaPyGqUc/Oss6zvT58xBMjog2hvVjQ Lj6BXs/U2sVrXCn1dyLq0+MvIJZDFA/7/wurDkPSY8BAYwhkYkRy54l64DY09EbsQM82 hzLKOQUTNAKIKzC2Lpl9IEFCw92FHDKIpwpsXH6oVjjnwcnj19jQ+t0kA3hlqqso+WE4 hwKqxKtyh8G5iYC6iScexubO3K9eANoxFMPQkphkzsnXXkfgKEoyiaFSpsGdh2imUwp1 f52b5TlQ9WEH0tkbIqU9j3nfYfYO/IMAb2DSxSAF4qsrEP9NqBRLp3pR2rXAhC+G3j48 +ePQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=HTVfhSok0SE3eJ3Mmgt0cDY0F1mc8PsFM/r4JzJPFFg=; b=ow7ogi1u6cSoAAJZT4mrlhvcHdM7JYnG8pD6AhPYjEH7Jp1r9SCbeqfQSbw/abqobh IdOLXbNvSGpMlabO+MfbVS4ClKINZn1on5fpDfLd6Ta0qVMs6NUyFRWWM3xLj/v/0d// kPwpGLt0u2tUJzW3dBRhTSlslADfpNLmLeSm13GljnvoRx25N3yccJAUKofaLOVNX7IR Oi8bVbqr03ooRdnXMzHM4/SorejGSL6c4Ml2oJH9vKx1CQUcIDKN9cQ9G+wV08+ZAeY/ AeeO8slCqpHRUMQZL3UXCbF8rPZ4q18DKbFEzEBEb1Fbkd2Fnae+/lH0GFEtxGMw8f3g sUZg== X-Gm-Message-State: AGRZ1gIRQk1OfG2krumu0uhDG+FN5FheC/UvU3saWM45YprgwE/I/+wi fT+cPxjhHM+KRvHhOqJeJqGgTTA6 X-Google-Smtp-Source: AJdET5f6eiQFY5YnU0xDycHT5hU18nnYBVRN53F3IdYp1wCSlK2C/SQ9/tNoxaYofofvSSrYgSZalw== X-Received: by 2002:a50:a125:: with SMTP id 34-v6mr157361edj.63.1540933784866; Tue, 30 Oct 2018 14:09:44 -0700 (PDT) Received: from [192.168.0.139] (ip565edd1d.direct-adsl.nl. [86.94.221.29]) by smtp.gmail.com with ESMTPSA id c17-v6sm7289895edt.77.2018.10.30.14.09.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 30 Oct 2018 14:09:44 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (1.0) Subject: Re: Question about servicescript for stopping and starting postgresql instance From: Marian Forums X-Mailer: iPad Mail (15G77) In-Reply-To: Date: Tue, 30 Oct 2018 22:09:43 +0100 Cc: pgsql-general@postgresql.org Content-Transfer-Encoding: quoted-printable Message-Id: References: To: Adrian Klaver List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hi, Postgres was installed through a repo with yum install. I will try to run it with another type. Regards Marian > Op 30 okt. 2018 om 21:56 heeft Adrian Klaver h= et volgende geschreven: >=20 >> On 10/30/18 9:27 AM, Marian Forums wrote: >> Hi Adrain, >> Thanks for your reply. >=20 >=20 > How was Postgres installed on this machine? >=20 > Have you tried the script from the docs? >=20 >=20 >> My script looks like this: >=20 > I am no systemd expert, still the Type=3Dforking does not seem right to me= . >=20 >> # cat /usr/lib/systemd/system/postgresql-9.6.pg-tstxxx.service >> [Unit] >> Description=3Dpostgresql_pg-tstxxx >> After=3Dsyslog.target >> After=3Dnetwork.target >> [Service] >> Type=3Dforking >> User=3Dpostgresql >> Group=3Dpostgresqlg >> Environment=3DPGDATA=3D/data/pg-tstxxx/data-01/ >> # Run ExecStartPre with root-permissions >> PermissionsStartOnly=3Dtrue >> ExecStartPre=3D/bin/chown postgresql:postgresqlgroup /var/run/postgresql >> ExecStart=3D/usr/pgsql-9.6/bin/pg_ctl start -D ${PGDATA} >> ExecStop=3D/usr/pgsql-9.6/bin/pg_ctl stop -D ${PGDATA} -s -m fast >> ExecReload=3D/usr/pgsql-9.6/bin/pg_ctl reload -D ${PGDATA} -s >> Restart=3Don-failure >> KillMode=3Dcontrol-group >> ExecStop=3D/bin/kill -SIGTERM $MAINPID >> RestartSec=3D10s >> [Install] >> WantedBy=3Dmulti-user.target >> thanks in advance. >> regards, >> Marian >> Op di 30 okt. 2018 om 14:30 schreef Adrian Klaver >: >> On 10/30/18 5:09 AM, Marian Forums wrote: >> > Hi, >> > >> > I have a question about creating a service script to >> start/stop/status >> > postgresql instance ( version 9.6.8) on Red Hat 7. >> How did you install Postgres on the machine? >> > >> > I have read the explanation of how to create such a service >> script on >> > https://www.postgresql.org/docs/9.6/static/server-start.html . >> Did you use the example at the above link or did you write your own? >> If you wrote your own can you show it? >> > >> > Stopping and Starting works. >> > However when I stop the service with: >> > systemctl stop postgresq.service and than ask for the status with >> > systemctl status postgresql.service, the service gets started again= . >> > >> > Is this normal functionality on Red Hat 7? >> > I have searched on the Internet ( including the Red Hat site) for a= >> > parameter to replace this behavior, but did not find anything. >> > >> > Your help is much appreciated. >> > Thanks in advance. >> > Regards, >> > Marian >> -- Adrian Klaver >> adrian.klaver@aklaver.com >=20 >=20 > --=20 > Adrian Klaver > adrian.klaver@aklaver.com