Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question
    
If the K script is of the highest number, 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. –  mbrownnyc 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 1 '11 at 15:23
    
Take a look at this page, which seems to detail that usage of K scripts. –  mbrownnyc Nov 1 '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 2 '11 at 12:38
add comment

2 Answers

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).

share|improve this answer
    
I'm fine with it being at that point as long as the other rc0.d/K scripts have run. –  cjs226 Oct 31 '11 at 18:45
add comment

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.