Except doing explicit logging instructions like suggested in http://upst开发者_如何学Cart.ubuntu.com/wiki/Debugging, is there a way to enable output of what is happening with upstart?
- What event is raised
- What service changed its status (started/stopped/dead)
- What signal were emmited
- what output a service produced while starting
Ok, I've found one way to get it :
$ sudo initctl log-priority # gives the actual (default) logging level
$ sudo initctl log-priority --help # gives available logging levels
$ sudo initctl log-priority info # is enough to get :
$ tail -f /var/log/syslog # - log of upstart events
$ tail -f /var/log/boot.log # - log of services output
In newer versions, you can find the upstart logs at:
/var/log/upstart
It has a log for each process it tries to start.
initctl log-priority info
logs events, but ignores the program output.
If the program output is important to you, I think the complementary solution is to use logger in your init script:
script
myawesomeprog 2>&1 | logger -t myawesomeprog
end script
Because it's better to use syslog than manually manage /var/log
, like http://upstart.ubuntu.com/wiki/Debugging suggests (in 08/2012).
精彩评论