See below when sending a stop command through the script.
brandentanga tastynoodles$ tasty stop
./tastynoodles.rb:62:in `kill': No such process (Errno::ESRCH)
from ./tastynoodles.rb:62:in `stop'
from ./tastynoodles.rb:72:in `<main>'
brandentanga tastynoodles$ ls
LICENSE.txt README.txt status tastynoodles.tmproj
PID source_me.txt tastynoodles.rb
brandentanga tastynoodles$ ps aux | grep tasty
brandentanga 6001 0.0 0.0 2434892 548 s000 S+ 1:42AM 0:00.00 grep tasty
brandentanga 4942 0.0 0.0 2468412 1244 ?? S 12:55AM 0:00.00 ruby ./tastynoodles.rb start
brandentanga tastynoodles$ tasty kill -9 4942
This is the section of code where the failure occurs
def read_pid
pid = -1
begin
pid = File.read("./PID")
rescue Exception => e
my_puts "read_pid failed, error message is: #{e.message}"
end
return pid
end
See below when sending a stop command through the script.
This is the section of code where the failure occurs
Notice that the exception never gets called.