http://www.perlmonks.org?node_id=1006549

xaka has asked for the wisdom of the Perl Monks concerning the following question:

Hi there,

Let's say you have a remote connection (host, user, pass) and a lot of services that use it (some of them sit in child processes to don't block master process). The service is a Perl module.

At some point you decide you need to change user/pass that means you need to re-establish the connection with new credentials.

What would you do with the services (especially with those ones that sit in child processes)?

How would you tell them "you need to start over"? Events? Server reboot? Which one design approach would you go with?

  • Comment on How would you notify services (perl modules) to start over when shared connection has been updated?

Replies are listed 'Best First'.
Re: How would you notify services (perl modules) to start over when shared connection has been updated?
by RichardK (Parson) on Dec 01, 2012 at 16:31 UTC

    It's common practice for unix services to re-read their config file when they get a SIGHUP signal.

    But if you don't intend to change your username/password too often then just shutting down the app and restarting it is easier.

Re: How would you notify services (perl modules) to start over when shared connection has been updated?
by CountZero (Bishop) on Dec 01, 2012 at 18:04 UTC
    Isn't that something for which signals were invented?

    CountZero

    A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James

    My blog: Imperial Deltronics
Re: How would you notify services (perl modules) to start over when shared connection has been updated?
by Anonymous Monk on Dec 01, 2012 at 18:23 UTC