Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Further to my last question, I'm now using logger.

I have the following upstart configuration

start on runlevel [2345]
stop on runlevel [06]


pre-start script
    exec 2>&1 > >(logger -t "nodejs")
    mkdir -p /var/log
    mkdir -p /var/www
    echo "Fetching app from $REPO"
    girror $REPO /var/www
    if [ -f /var/www/package.json ]; then
        echo "Installing npm modules"
        cd /var/www
        npm install
end script

post-stop script
    exec 2>&1 > >(logger -t "nodejs")
    echo "stopped"
end script

    exec 2>&1 > >(logger -t "nodejs")
    export NODE_ENV=production
    export port=80
    echo "Starting app.js on port 80"
    cd /var/www
    node app.js
end script

I am getting the error

/proc/self/fd/9: 2: /proc/self/fd/9: Syntax error: redirection unexpected

I suspect it's the line

exec 2>&1 > >(logger -t "nodejs")

Although it was working when I ran it in a normal shell script.

You know whats wrong ?

share|improve this question
Is the script being executed using sh? If so, you might expect errors. Execute the script using bash. – devnull Mar 6 '14 at 2:58
@devnull I'm not sure how upstart is executing it's scripts. Can I force it to use bash in any way ? I see that /bin/sh is actuallt pointing to dash – Michael Mar 6 '14 at 3:04

You must log in to answer this question.

Browse other questions tagged .