3

I'm wanting the rsyslog service to run until the last moment to ensure we receive as much logging as possible on our central logging servers. On Ubuntu 11.04, rsyslog's stop line is set to "stop on runlevel [06]" so it stops before (at least) services stopped via rc0.d/K scripts. How can I achieve the equivalent of /etc/rc0.d/K99rsyslog?

cjs226
  • 61
  • 4
  • If the [K script is of the highest number](http://manpages.ubuntu.com/manpages/hardy/man8/update-rc.d.8.html), it should die in that order. You should be able to adjust the rc files to reflect the order as: `/etc/rc0.d/K99rsyslog` and `/etc/rc6.d/K99rsyslog` to take care proc kill handling of both Halt and Restart states. – brandeded Oct 31 '11 at 19:21
  • I failed to mention that rsyslog is an Upstart service in Ubuntu 11.04 so it doesn't have ha K script. – cjs226 Nov 01 '11 at 15:23
  • [Take a look at this page](http://upstart.ubuntu.com/cookbook/#shutdown-process), which seems to detail that usage of K scripts. – brandeded Nov 01 '11 at 18:29
  • The problem isn't with the usage of K scripts but Upstart stopping rsyslog before K scripts running/completing. – cjs226 Nov 02 '11 at 12:38

2 Answers2

1

Problem is that once the networking is taken down, rsyslog will most likely cease to function, so just terminating the operation LAST may not have the desired effect (if any).

mdpc
  • 11,856
  • 28
  • 53
  • 67
0

I decided to disable the shutdown of rsyslog altogether. To do this I commented out the stop line in /etc/init/rsyslog.conf and then and as init didn't automatically pick up the change nor did update it.

I wouldn't necessarily recommend this method for all use cases. This was for systems that are short lived - Auto Scaled Amazon EC2 instances that are spun up as needed then terminated.

cjs226
  • 61
  • 4