Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Bouncy CLI Fails to Start with Monit #13

Open
joemccann opened this Issue · 2 comments

2 participants

@joemccann

I have a simple monit script that monitors bouncy and works fine, but only when I make the following change to the bouncy cli script:

#!/usr/local/bin/node

if you npm install -g bouncy the top looks like this:

#!/usr/bin/env node

When it is set to the env version, monit fails to restart the process which is an init.d script. When it is the direct path to node ( #!/usr/local/bin/node ) it restarts it just fine.

There is nothing in the monit script nor the init.d script that is funky. The only delta for when it fails is when I use the #!/usr/bin/env node version.

I've checked permissions and all that jazz and everything seems fine. Also, my path is the following:

PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games

Any ideas?

@substack
Owner

Does setting it to just #!node work?

@joemccann

When I do that I get this error:

./bouncy: 32: /usr/local/bin/bouncy: not found

Here's the init.d script:

#! /bin/sh
# /etc/init.d/bouncy

# Don't forget to reload init.d:
# update-rc.d bouncy defaults

APP='subprint'

case "$1" in
  start)
    /usr/local/bin/bouncy /var/www/$APP/server/configs/routes.json 80 > /var/www/$APP/bouncy.log  &
    echo $! > /etc/init.d/bouncy.node.pid
    ;;
  stop)
     kill -9 `ps -A | awk '/bouncy/{print $1}'`
   ;;
  restart)
    kill -9 `ps -A | awk '/bouncy/{print $1}'`

    /usr/local/bin/bouncy /var/www/$APP/server/configs/routes.json 80 > /var/www/$APP/bouncy.log  &
    echo $! > /etc/init.d/bouncy.node.pid
    ;;
  *)
    echo "Usage: /etc/init.d/bouncy {start|stop|restart}"
    exit 1
    ;;
esac

exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.