Friday 23 November 2018

linux - Fail to redirect log to /var/log/syslog

I have an upstart script that does the following


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

respawn

pre-start script
exec >/dev/kmsg 2>&1
REPO=git@github.com:blabla/bli
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
fi
end script

post-stop script
exec >/dev/kmsg 2>&1
echo "stopped"
end script

script
exec >/dev/kmsg 2>&1
export NODE_ENV=production
export port=80
echo "Starting app.js on port 80"
cd /var/www
node app.js
end script

I am running the script as root. The log files of the application suppose to go to /var/log/syslog but they don't go there.


However, I do see the app log when running dmesg | tail -f


Using kernel 3.5.0-46


Anyone know why it doesn't work ?

No comments:

Post a Comment

Where does Skype save my contact's avatars in Linux?

I'm using Skype on Linux. Where can I find images cached by skype of my contact's avatars? Answer I wanted to get those Skype avat...