diff -Nur --no-dereference smeserver-postgresql-0.2.0.old/root/etc/e-smith/templates/etc/e-smith/pgsql/init/00_restore_backup smeserver-postgresql-0.2.0/root/etc/e-smith/templates/etc/e-smith/pgsql/init/00_restore_backup --- smeserver-postgresql-0.2.0.old/root/etc/e-smith/templates/etc/e-smith/pgsql/init/00_restore_backup 2021-11-23 14:33:57.000000000 -0500 +++ smeserver-postgresql-0.2.0/root/etc/e-smith/templates/etc/e-smith/pgsql/init/00_restore_backup 2022-12-26 22:40:59.451000000 -0500 @@ -2,12 +2,12 @@ use warnings; use strict; -$ENV\{PATH\} = "/usr/bin"; +$ENV\{PATH\} = "/usr/pgsql-13/bin/:/usr/bin"; delete $ENV\{BASH_ENV\}; if (-e "/home/e-smith/db/pgsql/pgsql.dump") \{ open(STDIN, "/home/e-smith/db/pgsql/pgsql.dump"); - exec(qw(chpst -u postgres psql -q -f - template1)); + exec(qw(chpst -u postgres /usr/pgsql-13/bin/psql -q -f - template1)); \} exit 0; diff -Nur --no-dereference smeserver-postgresql-0.2.0.old/root/etc/rc.d/init.d/pgsql.init smeserver-postgresql-0.2.0/root/etc/rc.d/init.d/pgsql.init --- smeserver-postgresql-0.2.0.old/root/etc/rc.d/init.d/pgsql.init 2021-11-11 12:04:18.000000000 -0500 +++ smeserver-postgresql-0.2.0/root/etc/rc.d/init.d/pgsql.init 2022-12-26 22:39:30.641000000 -0500 @@ -32,10 +32,13 @@ exit 0 fi +psql='/usr/pgsql-13/bin/psql' +createdb='/usr/pgsql-13/bin/createdb' + M="Waiting for postgresql to startup: ." for i in $(seq 1 30) do - if chpst -u postgres psql -f - template1 < /dev/null 2>/dev/null + if chpst -u postgres $psql -f - template1 < /dev/null 2>/dev/null then if [ "$M" = "." ] then @@ -50,8 +53,8 @@ case $F in *.sql) D=$(echo $F | sed 's/\.sql$//') - action "Creating database $D in postgresql" chpst -u postgres createdb -T template0 $D - action "Loading $F into postgresql" chpst -u postgres /usr/bin/psql $D < $link && /bin/rm $link + action "Creating database $D in postgresql" chpst -u postgres $createdb -T template0 $D + action "Loading $F into postgresql" chpst -u postgres $psql $D < $link && /bin/rm $link ;; *) action "Loading $F into postgresql" chpst -u postgres $link && /bin/rm $link