A verbose startup script for PostgreSQL on FreeBSD

The default startup script for PostgreSQL on FreeBSD doesn’t give much clue when starting and stopping the DBMS. Here’s a patch to remedy this annoyance.

--- postgresql  26 Jan 2011 08:29:32 -0000      1.1
+++ postgresql  26 Jan 2011 08:40:33 -0000      1.2
@@ -54,12 +54,22 @@

 postgresql_command()
 {
-    su -l ${postgresql_user} -c "exec ${command} ${command_args} ${rc_arg}"
+    if [ "${1}" != "status" ]; then
+      echo PostgreSQL rc.d script taking action to ${1} PostgreSQL;
+    fi;
+
+    su -l ${postgresql_user} -c "exec ${command} ${command_args} ${rc_arg}";
+
+    if [ "${1}" != "status" ]; then
+      echo PostgreSQL rc.d script done with action ${1};
+    fi;
 }
-
+
 postgresql_initdb()
 {
+    echo PostgreSQL rc.d script taking action to initdb in directory ${postgresql_data};
-    su -l -c ${postgresql_class} ${postgresql_user} -c "exec /usr/local/bin/initdb ${postgresql_initdb_flags} -D ${postgresql_data}"
+    su -l -c ${postgresql_class} ${postgresql_user} -c "exec /usr/local/bin/initdb ${postgresql_initdb_flags} -D ${postgresql_data}";
+    echo PostgreSQL rc.d script done with action initdb;
 }

 run_rc_command "$1"