473,467 Members | 1,586 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Application monitor

Hi to all,

I'd like to have an app monitor that gets rid of another app, in the
way that if it closes unspectedly, the app monitor just wake it up one
more time, and viceversa.

I mean:

Main application starts
This one starts the App Monitor of itself. (This means that if Main
Application closes, the App Monitor restart it)

And viceversa means that if App Monitor closes, the Main application
restart it.

How can I accomplish this?

I've been thinking in wx.SingleInstanceChecker (from wxPython GUI
library). If it doesn't exist, then call os.system(<program_name>). But
I don't know if there's a better way.

Thanks

Daniel

Nov 7 '05 #1
7 1930
"dcrespo" <dc*****@gmail.com> writes:
Main application starts
This one starts the App Monitor of itself. (This means that if Main
Application closes, the App Monitor restart it)

And viceversa means that if App Monitor closes, the Main application
restart it.

How can I accomplish this?

I've been thinking in wx.SingleInstanceChecker (from wxPython GUI
library). If it doesn't exist, then call os.system(<program_name>). But
I don't know if there's a better way.


"Better" depends on what your requirements are. Personally, I use init
as an app monitor. It doesn't need monitoring - if it's dead, your
Unix has a lot worse problems than one application being down.

<mike
--
Mike Meyer <mw*@mired.org> http://www.mired.org/home/mwm/
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.
Nov 7 '05 #2
> Personally, I use init
as an app monitor. It doesn't need monitoring


What's "init"? Sorry about my ignorance.

Nov 8 '05 #3
"dcrespo" <dc*****@gmail.com> writes:
Personally, I use init as an app monitor. It doesn't need monitoring

What's "init"? Sorry about my ignorance.


init is the first Unix process, and all other processes are descended
from it. It is the alpha and the omega of Unix processes. Uh, wait a
second - I'm having biblical flashes here. Let's try again:

init is the first process started when a Unix system boots, and is
hand crafted by the boot process. Every other process on the system is
started by a fork (or a variant) system call, and are descendants of
init. Part of it's job is starting the various server processes on the
system that are appropriate for the system state. It notices when they
exit, and restarts them. On timesharing systems, it will start a login
process on every terminal, which would then exec it's way into a user
shell, which would exit - which init would notice, and launch another
login on that terminal. If init is dead, your Unix system is in a bad
way.

You can use this on modern Unix systems. You add an entry to init's
config file (/etc/inittab on SysV-like systems, and /etc/ttys on
BSD-derived systems), and init will launch a process for that
entry. If the process ever exits, init will launch it again.

For instance, I launch an ssh client to keep a couple of TCP tunnels
open to my ISPs server so I can access services that aren't available
from my current location. I run that via init. No need to worry about
hardening the ssh client, or writing a wrapper around it, or anny such
thing. init deals with all of that for me.

<mike
--
Mike Meyer <mw*@mired.org> http://www.mired.org/home/mwm/
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.
Nov 9 '05 #4
dcrespo wrote:
Hi to all,

I'd like to have an app monitor that gets rid of another app, in the
way that if it closes unspectedly, the app monitor just wake it up one
more time, and viceversa.


Twisted contains such a thing. I think it's called twisted.runner,
and no, it's not just for keeping Twisted processes running.
Nov 9 '05 #5
Many thanks for your answers.

Respect Init, I need a cross platform solution. Most of times my system
will run in Win98 and XP (more on XP than 98)

Respect Twisted... Mmm... I already started with another networking
library (TCPServer and SimpleXMLRPCServer), and I wouldn't like to mix
things because I don't know so much about those libraries. I know that
Twisted can do what I already have. But replacing it can be a hard
task. So I would like to have a function like FindPID(exename) --> PID,
or something more generic that could tell me the PID of a running
program, and kill him in a certain moment.

Daniel

Nov 9 '05 #6
Daniel Crespo wrote:
Respect Twisted... Mmm... I already started with another networking
library (TCPServer and SimpleXMLRPCServer), and I wouldn't like to mix
things because I don't know so much about those libraries. I know that
Twisted can do what I already have. But replacing it can be a hard
task. So I would like to have a function like FindPID(exename) --> PID,
or something more generic that could tell me the PID of a running
program, and kill him in a certain moment.


You *could* use twisted.runner for process control even if you
don't use twisted for your networking code. It does seem like
a funny thing to do, but there's nothing stopping you from doing
that. The example code in twisted.runner starts up a few shell
scripts that die on their own accord, and make sure they get
restarted, so it doesn't rely on twisted being used in the
processes it controls.
Nov 9 '05 #7
Magnus Lycka wrote:
You *could* use twisted.runner for process control even if you
don't use twisted for your networking code. It does seem like
a funny thing to do, but there's nothing stopping you from doing
that. The example code in twisted.runner starts up a few shell
scripts that die on their own accord, and make sure they get
restarted, so it doesn't rely on twisted being used in the
processes it controls.


Ok. I'll take a look. Thank you very much! :)

Daniel

Nov 9 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Ullas Chadaga | last post by:
Hi, Is it possible to develop a .Net app that can monitor response times of other windows applications (not necessarily developed in .Net) running on the same PC? If yes, what would be the...
4
by: John J. Hughes II | last post by:
Can one application consume an event from another running application? I would assume this is what is happen when an application monitors lets say a port. I have accomplished something similar...
9
by: Steve Buster | last post by:
All right, I have read every forum, newsgroup etc about this issue and no one seems to know how to fix it. I am getting a "Server Application Unavailable" exception running my .NET 1.1...
5
by: Kim Nørby Andersen | last post by:
Hello there I am lost. i receive the output in the bottom, from a site that runs excellently on our development server, but dies on the customer. We have had a first version running at the...
2
by: arfinmail | last post by:
I have 4 applications which are supposed to run 24/7. How can I make a monitor application to know if they're running fine? The best I can come up with is making them update a file/DB every X...
8
by: TrtnJohn | last post by:
I have an application where I would like to block waiting on an asynchronous event and still process messages. I can implement a hard loop to block such as: Do While StillWaiting...
3
by: Hitesh Bagchi | last post by:
We are migrating an application that uses DB2 UDB 8.1.3 as its database. It's an old application and the code is missing as usual. We are trying to find out the SQL the application is firing by...
5
by: Amit | last post by:
Hi I am developing an application in C#. The application creates a TCPListener object and listens to (incoming) data on a particular port. A simulator hardware writes data to this port. My...
3
by: =?Utf-8?B?RVF1QWw=?= | last post by:
Hi, We have an application developed in VC2005 with mixed code, primarily C++ but using a C# dll for database access (DBUploader), the dll exposes a C++ interface. We are experiencing...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.