Home

Anonymous João Ricardo Lourenço

JKEEPALIVED -- A Daemon that makes sure your apps live.

WHAT IS IT?

JKEEPALIVED is a very simple daemon that takes an input file with a list of
applications and makes sure that they are always running.

It has three ways of knowing if the application is running:

[1] The application name -- JKEEPALIVED looks in linux's /proc
                directory and searches for an application's
                name. If it doesn't find it, then
                the app is considered not to be running.

[2] An application PID file -- JKEEPALIVED can fetch a file which is
                   supposed to contain the most up to date
                   PID of a given process, writen by the app
                   itself. If that PID isn't found, then
                   the app is considered not to be
                   running.
[3] A PID -- This is deprecated and several improvements could have
         been made to it. I didn't do it because this was plain
         stupid. Do not use it.

JKEEPALIVED searches for all this information in /etc/jkeepalived.d/jkeepalived.conf
This file has a simple syntax (# denotes a comment, inline comments are supported):
# freq type type_data start command arg1 arg2 ... argN

First, the frequency, freq, in seconds, of check. This means that after 'freq'
seconds, jkeepalived will check to see if an app is running.

Then, "type", determines the method to determine if the app is running. Possible
values are: "pid" (deprecated), "proc_name" or "pname", or "pid_file".
proc_name corresponds to [1], pid_file corresponds to [2] and pid corresponds
to [1].

Thirdly, "start command" determines the string to execute the app if it isn't
running.

Lastly, all arguments to the app can be defined and separated by spaces.
All arguments but "freq" can be quoted ("like this"), or unquoted(like_this).

Example file:

#   freq    type                 type_data                                    start command                arg1             arg2   ...     argN
3600    pid_file             "/home/jorl17/.jorl-package-updater.pid"     "jorl-package-updater"    --background
5       process_name         "pcmanfm"                                    "pcmanfm"
5       process_name         "volcontrol"                                 "volcontrol"

JKEEPALIVED logs its messages to syslogd.

WHY?

Why not? I wanted something to do this because some of my
background-applications are important. I don't want to check if they
have crashed or purely gone away. Hence, I decided to design my own
solution, knowing that there are many others.

GPLv3

All code is GPLv3. The source has the license info. The project
uses a function from dlib (Dillo Web Browser Lib).

Copyright (C) 2010 João Ricardo Lourenço (jorl17.8@gmail.com)


MongoDB Logo MongoDB