how to start and stop erlang daemon

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

how to start and stop erlang daemon

Max Lapshin-2
Hi.


I've written a bit unstructured thoughts about seamless start and stop of erlang daemon:


In short:

1) validate config before launching
2) control that daemon has started
3) find a way to notify why it hasn't started
4) use several ways to stop it and to ensure that it has stopped



_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: how to start and stop erlang daemon

Roman Galeev
IMO an application should validate configuration itself and loudly refuse to start if the required configuration is inconsistent or absent. Daemons start/stop/control procedures afaik are defined by each and every Linux distro out there already (iirc mostly by guessing/checking pids), how beam.smp is different?

On Tue, May 15, 2018 at 2:39 PM, Max Lapshin <[hidden email]> wrote:
Hi.


I've written a bit unstructured thoughts about seamless start and stop of erlang daemon:


In short:

1) validate config before launching
2) control that daemon has started
3) find a way to notify why it hasn't started
4) use several ways to stop it and to ensure that it has stopped



_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions




--
With best regards,
     Roman Galeev,
     +420 702 817 968

_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: how to start and stop erlang daemon

Max Lapshin-2

This is what have I written:  validate and loudly refuse to start before it is daemonized


_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: how to start and stop erlang daemon

Roman Galeev
Well, my point is that the application should validate its own config, but not an external tool/script, as you wrote in your medium article:

./contrib/validate_config.erl || exit $?


On Wed, May 16, 2018 at 3:33 PM, Max Lapshin <[hidden email]> wrote:

This is what have I written:  validate and loudly refuse to start before it is daemonized




--
With best regards,
     Roman Galeev,
     +420 702 817 968

_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: how to start and stop erlang daemon

Max Lapshin-2
How can you signal to system administrator that config is invalid?

_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: how to start and stop erlang daemon

Roger Lipscombe-2
On 18 May 2018 at 07:15, Max Lapshin <[hidden email]> wrote:
> How can you signal to system administrator that config is invalid?

We do a mixture of the following:

- Erlang node refuses to start; upstart (or systemd) or monit send an
error email and attempt to restart it.
- Erlang node reports an error; lager backend turns that into an error email.
- Erlang node fails to do whatever it's supposed to do; external check
notices (nagios can't connect to port, end-to-end smoke test fails,
e.g.), notifies administrator.

System administrator sees the spike in the error emails, takes a look,
fixes the problem.
_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions