neko_pgsql-8.3.1 bug/suggestion

IRIX and IRIX software discussion including open source and commerical offerings.
Forum rules
Any posts concerning pirated software or offering to buy/sell/trade commercial software are subject to removal.
User avatar
duck
Donor
Donor
Posts: 742
Joined: Mon Oct 27, 2003 5:22 pm
Location: Jakobstad, Finland
Contact:

neko_pgsql-8.3.1 bug/suggestion

Unread postby duck » Fri Feb 12, 2016 6:43 am

My octane started pausing every time I shut it down until I pressed enter and I narrowed it down to the init.d scripts neko_pgsql-8.3.1 installs; even if you're not running the server, it will still try to shut it down using su - $PGUSER -c [...] and the unprivileged user that it also sets up does have a password (*LK*, lock?) causing su to prompt for input.

I would suggest something like

Code: Select all

--- neko_pgsql.old      Fri Feb 12 16:29:42 2016
+++ neko_pgsql  Fri Feb 12 16:27:53 2016
@@ -42,6 +42,8 @@
 # Who to run the postmaster as, usually "postgres".  (NOT "root")
 PGUSER=postgres
 
+PGPID="${PGDATA}/postmaster.pid"
+
 # Where to keep a log file
 PGLOG="$PGDATA/server.log"
 
@@ -82,9 +84,11 @@
         fi
        ;;
   stop)
-        echo -n "Stopping PostgreSQL: "
-        su - $PGUSER -c "$PGCTL stop -D '$PGDATA' -s -m fast"
-        echo "ok"
+       if [ -e $PGPID ];then
+         echo -n "Stopping PostgreSQL: "
+         su - $PGUSER -c "$PGCTL stop -D '$PGDATA' -s -m fast"
+         echo "ok"
+       fi
        ;;
   restart)
         if $IS_ON $PROG; then


To prevent trying to shut down a server that isn't running at least.
:Octane: halo, octane Image knightrider, d i g i t a l AlphaPC164, pond, soekris net6501, misc cool stuff in a rack
N.B.: I tend to talk out of my ass. Do not take it too seriously.

Return to “IRIX and Software”

Who is online

Users browsing this forum: No registered users and 1 guest