makerplane / FIX-Gateway

Flight Information eXchange Gateway
GNU General Public License v2.0
10 stars 22 forks source link

Daemonization #10

Closed birkelbach closed 5 years ago

birkelbach commented 8 years ago

Allow the program to send itself to the background. i.e. run as a Daemon in the *nix world or a service in other worlds.

birkelbach commented 8 years ago

We've talked about having some kind of oversight program that would load FIX Gateway (and any other programs that needed to be running) and make sure that if they crashed or started using too many resources or hung up, they could be killed and restarted. If that is what we are going to do, does it make any sense to have FIX Gateway daemonize itself? In the past when I've done this, programs that daemonize themselves tend to disconnect from the parent. Which is kind of the point of the daemonization process. So the watchdog loses control. Watchdog programs can also monitor stdout and stderr and can log that information or use it to determine health. These are complex programs that have to be done correctly and are nearly impossible to be made cross-platform since process handling is a pretty low level detail of the OS.

I guess we could still daemonize FIX Gateway if configured to do so but be careful not to configure it if we are running under a watchdog program.

Is there already a watchdog program out there? I'm not sure if any of the new init systems (like systemd or upstart) can check memory or CPU usage. The program that I wrote years ago had some very specific requirements so I never went looking for anything else.

makerplane-jnicol commented 8 years ago

Hey Phil,

My thought is that we should do some stress testing to figure out if it is going to be a problem that needs to be solved? Daemons are useful for sure and I use them on my simulation network at work (Linux mainly, but can run on Windows) to let me know instantly if there is an issue with the running processes, or hardware. This particular system can be a real pain to install, set up and manage though. The daemons have a tendency to crash themselves and the specific ones I use are a bitch to troubleshoot and get running again. So what the app is for is to launch any process remotely from a master workstation and each client is a slave. It can launch calculator on all the workstations at once if you really wanted to. The daemon reports on hardware and running processes and presents a warning dialogue, or can send an email or sms if something goes wrong. It also has a traffic light set-up for all running daemons to let me know their health. All normal stuff I guess.

I think that if we ran a few stress tests to see how robust the apps are, then maybe we won’t need a daemonized app right away? Or maybe we do discover we do.

John

From: Phil Birkelbach [mailto:notifications@github.com] Sent: Wednesday, June 15, 2016 11:23 AM To: makerplane/FIX-Gateway FIX-Gateway@noreply.github.com Subject: Re: [makerplane/FIX-Gateway] Daemonization (#10)

We've talked about having some kind of oversight program that would load FIX Gateway (and any other programs that needed to be running) and make sure that if they crashed or started using too many resources or hung up, they could be killed and restarted. If that is what we are going to do, does it make any sense to have FIX Gateway daemonize itself? In the past when I've done this, programs that daemonize themselves tend to disconnect from the parent. Which is kind of the point of the daemonization process. So the watchdog loses control. Watchdog programs can also monitor stdout and stderr and can log that information or use it to determine health. These are complex programs that have to be done correctly and are nearly impossible to be made cross-platform since process handling is a pretty low level detail of the OS.

I guess we could still daemonize FIX Gateway if configured to do so but be careful not to configure it if we are running under a watchdog program.

Is there already a watchdog program out there? I'm not sure if any of the new init systems (like systemd or upstart) can check memory or CPU usage. The program that I wrote years ago had some very specific requirements so I never went looking for anything else.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/makerplane/FIX-Gateway/issues/10#issuecomment-226222072 , or mute the thread https://github.com/notifications/unsubscribe/AE8_n0dpGhXBZBeY9o1-hREL_yBR0-Amks5qMBjsgaJpZM4I2eAC . https://github.com/notifications/beacon/AE8_n7DQscktvdFUtqfnuJhxTRZiyFuUks5qMBjsgaJpZM4I2eAC.gif