I'm creating a HTTP server using Go. And whenever I work on a database maintenance, I want the server to redirect all the traffic to "current working on maintenance" page.
Currently, this is done by secret admin page (eg. http://myhome/secret) but I'm wondering if this can be done with signal -similar to TERM signal, but temporarily redirect rather than actually terminate the process.
/home/myhome> nohup startServer & ... /home/myhome> changeMyServerStatus "maintenance"
I assume there will be two executable.. "startServer" and "changeMyServerStatus"
So, this is similar to a service. (like reload) But, is this possible? If so, can you give me some hint please?