22:13 <@deBeuk> Dwarf: ripnews gaf een melding in mn logs met een verwijzing

naar http://procps.sf.net/faq.html
22:14 <@deBeuk> qua ps -aux zou depracated zijn

en wat ander cruft
This commit is contained in:
Ward Wouts 2004-03-03 21:18:50 +00:00
parent 1ea456360c
commit ca9fbd8029

View file

@ -1,6 +1,6 @@
#!/usr/local/bin/ruby -w #!/usr/local/bin/ruby -w
# $Dwarf: ripnews.rb,v 1.77 2003/08/14 15:33:04 ward Exp $ # $Dwarf: ripnews.rb,v 1.78 2003/09/23 14:43:26 ward Exp $
# $Source$ # $Source$
# #
@ -134,6 +134,8 @@ def usage
end end
def parse_config(default = {}) def parse_config(default = {})
print "Parsing config\n"
print "#{default[\"-c\"]}\n"
if FileTest.readable?("#{default[\"-c\"]}") if FileTest.readable?("#{default[\"-c\"]}")
file = File.new("#{default[\"-c\"]}") file = File.new("#{default[\"-c\"]}")
lines = file.readlines lines = file.readlines
@ -262,7 +264,7 @@ def lock
lock.close lock.close
if line if line
line.chomp! line.chomp!
psauxw = `ps -auxw` psauxw = `ps auxw`
if /^\S+\s+#{line}\s+/.match(psauxw) if /^\S+\s+#{line}\s+/.match(psauxw)
print "Already running, exiting...\n" print "Already running, exiting...\n"
exit exit
@ -492,7 +494,7 @@ 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)
@config = parse_config(@defaults) @config = parse_config(@defaults)
@ -502,14 +504,14 @@ lock
renice renice
trap("HUP") { trap("HUP") {
puts "Rereading config...\n" print "Rereading config...\n"
config = parse_config(@defaults) config = parse_config(@defaults)
if config != false if config != false
@config = config @config = config
check_config check_config
puts "Done reading config\n" print "Done reading config\n"
else else
puts "Keeping old config due to errors\n" print "Keeping old config due to errors\n"
end end
} }