Description:
How to run EMCtl.sh from a directory other than $WILYHOME/bin.
How to start and stop Postgres from any directory.
Solution:
EMCtrl.sh looks at the WILYHOME environment variable and uses this location if it is defined. If not, it assumes that the ../ directory is the WILYHOME location.
To run EMCtl.sh from a directory other than $WILYHOME/bin you need to set (and export) the WILYHOME variable.
Here is an example start script that can be executed from anywhere.
startEM.sh:
#!/bin/ksh
export WILYHOME=/apps/introscope
. /apps/introscope/bin/EMCtrl.sh start &
stopEM.sh:
#!/bin/ksh
export WILYHOME=/apps/introscope
. /apps/introscope/bin/EMCtrl.sh stop &
If Postgres is installed in /apps/postgres
The command to start Postgres is:
/apps/postgres/bin/pg_ctl -D /apps/postgres/data -l /apps/postgres/data/pg_log/postmaster.log start &
The command to stop Postgres is:
/apps/postgres/bin/pg_ctl -D /apps/postgres/data stop &