0

I want to reload all Perl modules which our Catalyst application consists of, when we call our FCGI script with ?xxx=yyy parameter.

To reload I should use exit;, right?

What is the easiest way to detect URLs with ?xxx=yyy using Catalyst?

porton
  • 5,214
  • 11
  • 47
  • 95
  • If I call `exit;` after `$c->response->body("Stop called!");` then Internal Server Error happens. My crude hack is to use `print "Content-Type: text/plain\n\nStop called!"; exit;` – porton Jun 01 '16 at 22:24
  • Reloading modules usually results in various hard to detect problem. Your example shows that you might not want a reload, but exit and restart the server. Is this what you want? – Sebastian Jun 02 '16 at 14:29
  • I want my FastCGI script to restart, yes – porton Jun 02 '16 at 16:54
  • I'm going to close this as a duplicate because there is a very good answer on how to build an actual restarting script for FastCGI and Catalyst. But it's not using the URL parameter you want, which is a very insecure approach. You don't want anyone to accidentally stumble across this and restarting your server. One could write a script that constantly restarts your app, rendering it unusable. That would not be very desirable. A better approach would be to build a deployment scrpit that does that for you whenever you update your files. – simbabque Sep 17 '16 at 07:40

0 Answers0