0

I am replacing a windows app with linux command line app. It is supposed to output simple statistics so user can check if the app is alive.

In windows it is run 24/7 and you can connect to a desktop via RDP and see whats going on in the console window.

How can I achieve the same on linux (CentOS)?

The app must never be interrupted - it has to stay up as long as possible

2 Answers2

1

Applications that run 24/7 are generally considered services in my opinion.

Usually services on Linux get started by a process supervisor, typically at boot time, such as by the common default systemd or one of the alternatives listed here: https://en.wikipedia.org/wiki/Process_supervision

That supervisor can can then perform service/application restarts when needed and capture and log standard/error output so it won't be lost.

As a sysadmin you can then interact with either the logs or the process supervisor to check the status of your service.

Personally I prefer that services don't rely on the supervisor for all their logging, in other words that they do not only log to stdout and stderr. Services should only generate (copious amounts of) standard output (write to the console) when started with a (debug) switch and/or when throwing critical errors and dying. During normal operations services should have the option to maintain their own log file(s) to record requests, statistics, errors, statistics and other relevant events.
But that may be overkill for your application.

Bob
  • 6,366
0

Although I agree with idea to make it a service but some unconventional limitations beyond my control dictate it has to be an interactive session.

I resolved it by using screen