I have a simple upstart script that runs a process and respawns it if it crashes. The problem is if it crashes I want the user to be alerted that it crashed (because they may need to take an action to prevent it from crashing again). Here's my script:
start on runlevel  stop on runlevel  chdir /opt respawn respawn limit 5 10 exec /usr/bin/gulp --gulpfile ./lib/vendor/node/gulpfile.js 2>&1 > /var/log/gulp.log
Not that I redirect standard error into the console (2>&1) and standard out a log file. The log file redirection WORKS. But the standard error to the console does NOT. This error redirection does work if I run the command directly from the shell.
Things I've tried so far: - Adding 'console output' to the script (which supposedly redirects output to /dev/console) - Using exec start-stop-daemon --start -c myuser --exec command (thinking that because I run the upstart job with sudo the /dev/console points somewhere else) **this script just crashes won't even run
Any other ideas? I really need error output to be put into the console for the user.