Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

problem if running from sym link of hibari script #11

Open
kwidoyo opened this Issue Dec 22, 2011 · 0 comments

Comments

Projects
None yet
2 participants

kwidoyo commented Dec 22, 2011

e.g.:
$ sudo ln -s /usr/local/var/lib/hibari/hibari/bin/hibari /etc/init.d/gogogo

then we can not run hibari by executing /etc/init.d/gogogo

Issue:

  • hibari script uses $0 and pwd for variable declaration.

As a workaround, edit the hibari script as follows:
....

RUNNER_SCRIPT_DIR=$(cd ${0%/*} && pwd)

RUNNER_BASE_DIR=${RUNNER_SCRIPT_DIR%/*}

RUNNER_BASE_DIR="/usr/local/var/lib/hibari/hibari/"
RUNNER_SCRIPT_DIR=$RUNNER_BASE_DIR/bin
...

SCRIPT=basename $0

SCRIPT="hibari"
....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment