6

So I want to use the following in my script stanza:

forever -l >(tee $QW_LOG_DIR/webserver.log | logger -p user.info -t '[QW]') start webserver.js

However, that won't work because:

  1. That's bash syntax, and:

  2. The >(...) construct creates a process before my actually creating forever, so upstart will track the wrong pid.

    ... at least that's what I think, I'm an upstart newbie.

My thinking is that in order to bypass both of these issues, I should use mkfifo in my pre-start stanza so that I can write to the fifo in my start script.

Questions:

  1. Is that the way to go? If not -- what is?
  2. If it is, then I will need to run the (tee | logger) part "in the background", presumably in pre-start?
  3. Again, if so, how do I track it, and take it down in my post-end stanza?
0

1 Answer 1

2

If you need to invoke a Bash script from Upstart, you can place the script in a file and invoke it through the exec stanza:

exec /bin/bash /path/to/my-bash-script.sh

If you place a suitable shebang (#!/bin/bash) at the script’s beginning and make the file executable you can even execute it directly:

exec /path/to/my-bash-script.sh

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .