I'd like a perl job to monitor its own source and take action when those files change. I think i want to answer the following questions:
I have what i hope will be a long-running perl daemon that runs in conjunction with a user's X11 session. The daemon is currently is smart enough to be able to respond to a SIGHUP and re-exec itself cleanly without interrupting the user's experience.
The daemon is implemented as a (very simple) user-facing perl script in /usr/bin and a handful of specialized modules in the usual spots (e.g. /usr/share/perl5/...blah.pm on a debian system).
It's possible that the daemon itself (the script in /usr/bin and the specialized modules) will be updated while one or more instances are running. I'd like a running instance to detect when this happens, and decide (maybe prompting the user, though that's irrelevant to this question) to HUP itself.
I'd be happy to get suggestions for other ways of thinking about this problem too. FWIW, my primary concern with this tool is a GNU/Linux-based desktop environment, followed by other free software desktops. But more portable suggestions would be happily entertained.
In reply to how can i detect updates to running code? by dkg
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |