From e1abee9ada08fb805c2919ca01ff9e220ad07186 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timo=20Ter=C3=A4s?= Date: Sun, 30 Oct 2011 16:41:30 +0200 Subject: main/postgres: fix init.d script pid checking The pid file contains a lot of numeric stuff. The first line is the PID, so use just 'read' to get it instead of the grep. --- main/postgresql/postgresql.initd | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'main/postgresql/postgresql.initd') diff --git a/main/postgresql/postgresql.initd b/main/postgresql/postgresql.initd index 2de91d0df..3452db856 100644 --- a/main/postgresql/postgresql.initd +++ b/main/postgresql/postgresql.initd @@ -50,7 +50,8 @@ start() { return 1 fi - local pid=$(grep "^[0-9]\+" "$PGDATA/postmaster.pid") + local pid + read pid < "$PGDATA/postmaster.pid" test -d /proc/"${pid}" eend $? } -- cgit v1.2.3