(Editorial note: Pretend this post is a Star Trek episode with folks spouting techno-babble, use the words as place holders, and feel the flow of the story...)
A while back, I built some anycasting DNS resolvers using bind on a loopback, and FRR talking OSPF to a router. I finally decided I should hammer together a script to turn off FRR if there was something wrong with the bind process so the servers would pull themselves out of service.
Why not try this new ChatGPT thingee?
I won't bore you with the code that was created, but you'll see my thoughts, and the input I gave to ChatGPT as I worked through this problem until... the end?
write a bash script that will check to see if a locally run bind dns server is running properly
- uses systemctl to see if the service is running
- runs 'ps' to check for a process
- uses netstat to see if port 53 is listening
add to the previous script the provision to shutdown the FRR service if bind it not running
rewrite the script to use 'ss' rather than 'netstat' for the port check
add a check of named that uses 'dig' to query for the RR localhost
rewrite the script in perl
now create a variable that tracks the state of the bind and frr processStore the value of this variable in /var/run/track-daemonsalways report the value stored in /var/run/track-daemons and the current value
modify the variable `$track_daemons` so that it has fours states representing the possible combinationsof good/bad for both daemons
(the chat died at this point)
But it just FEELS kinda strange right now.