SIGHUP handling

This commit is contained in:
Ward Wouts 2003-06-24 19:04:26 +00:00
parent 249355b135
commit 3ba314298a
3 changed files with 14 additions and 7 deletions

View file

@ -1,4 +1,4 @@
# $Dwarf: CHANGELOG,v 1.24 2003/06/15 22:28:28 ward Exp $ # $Dwarf: CHANGELOG,v 1.25 2003/06/16 10:56:11 ward Exp $
# $Source$ # $Source$
from 0.2.1 to 0.2.2 from 0.2.1 to 0.2.2
@ -9,6 +9,7 @@ from 0.2.1 to 0.2.2
- fetch subjects sorted so you get a better chance at getting - fetch subjects sorted so you get a better chance at getting
full series full series
- now your TEMPDIR can be on another drive than your DATADIR - now your TEMPDIR can be on another drive than your DATADIR
- reread config on SIGHUP
from 0.2.0 to 0.2.1 from 0.2.0 to 0.2.1
- fail gracefully at a lack of configuration - fail gracefully at a lack of configuration

View file

@ -1,4 +1,4 @@
# $Dwarf: TODO,v 1.18 2003/06/15 21:37:27 ward Exp $ # $Dwarf: TODO,v 1.19 2003/06/23 07:38:07 ward Exp $
# $Source$ # $Source$
[ ] check for multiple servers (ip adresses) for each name and pick [ ] check for multiple servers (ip adresses) for each name and pick
@ -21,5 +21,4 @@
[ ] more regression tests [ ] more regression tests
[ ] update documentation [ ] update documentation
[ ] start useing file locking (needed for safe threading) [ ] start useing file locking (needed for safe threading)
[ ] reload config on HUP
[ ] implement include statement in config file [ ] implement include statement in config file

View file

@ -1,6 +1,6 @@
#!/usr/local/bin/ruby -w #!/usr/local/bin/ruby -w
# $Dwarf: ripnews.rb,v 1.70 2003/06/20 09:56:15 ward Exp $ # $Dwarf: ripnews.rb,v 1.71 2003/06/20 22:20:35 ward Exp $
# $Source$ # $Source$
require 'date' require 'date'
@ -472,13 +472,20 @@ end
############################################################################################# #############################################################################################
$stdout.sync=true # line buffered output $stdout.sync=true # line buffered output
defaults = {'-c' => "#{ENV['HOME']}/.ripnewsrc"} @defaults = {'-c' => "#{ENV['HOME']}/.ripnewsrc"}
defaults = parse_options(defaults) @defaults = parse_options(@defaults)
parse_config(defaults) parse_config(@defaults)
check_config check_config
lock lock
renice renice
trap("HUP") {
puts "Rereading config...\n"
parse_config(@defaults)
check_config
puts "Done reading config\n
}
@maxfilelength = get_max_file_length(@config[@config.keys[0]]["TEMPDIR"]) @maxfilelength = get_max_file_length(@config[@config.keys[0]]["TEMPDIR"])
print "\n$Id$\n" print "\n$Id$\n"