]> git.ipfire.org Git - people/stevee/guardian.git/log
people/stevee/guardian.git
8 years agoSocket.pm: Fix detection and deletion of an existing socket file.
Stefan Schantl [Mon, 23 Nov 2015 09:23:55 +0000 (10:23 +0100)] 
Socket.pm: Fix detection and deletion of an existing socket file.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
8 years agoAdd support for command line arguments and usage of "Config" module.
Stefan Schantl [Mon, 23 Nov 2015 08:57:25 +0000 (09:57 +0100)] 
Add support for command line arguments and usage of "Config" module.

guardian now can be called with some additional command line arguments, like
"--config" to specify a different config file than the default one. The optoions
"--help" and "--vesion" will display some help texts and version informations on
the console. The "--foreground" option is not supported/implemented yet and will
be used to keep the process in the foreground and not fork into background at a later
time.

The "Config" module now also is used to get all settings from the config file and
store them into a hash called mainsettings for a later usage.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
8 years agoUse socket module to provide an IPC mechanism.
Stefan Schantl [Fri, 20 Nov 2015 21:56:02 +0000 (22:56 +0100)] 
Use socket module to provide an IPC mechanism.

Guardian now supports inter-process-communication based on
an UNIX socket, which is based on the guardians socket module.

All recieved messages via socket automatically will be accepted
and parsed. If they are valid, the corresponding events will be
enqueued into the main event queue of guardian.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
8 years agoAdd "Socket" module.
Stefan Schantl [Fri, 20 Nov 2015 21:37:29 +0000 (22:37 +0100)] 
Add "Socket" module.

The Socket module provides an IPC mechanism for guardian, based
on a UNIX socket. It contains a server, a client and a message parser
function which easily can be re-used.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
8 years agoAdd "Config" module.
Stefan Schantl [Fri, 20 Nov 2015 20:56:49 +0000 (21:56 +0100)] 
Add "Config" module.

This module contains functions to read, validate and set various
configure options which are used in guardian.

The main functions called "UseConfig" allows to pass which config file
should be read and validates the input by calling a subfunction. The
validated settings will be returend as a hash.

The "CheckConfig" function directly can be called with a hash, which
contains the various config options and values and will return an
error message if there are any problems.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
8 years agoAdd "Logger" module.
Stefan Schantl [Fri, 20 Nov 2015 14:23:56 +0000 (15:23 +0100)] 
Add "Logger" module.

This module is responsible for logging any messages which are generated by
guaridan or one of its submodules during runtime and displays them on the
console or send them to the syslog.

When using the logger module, it has to be initialized as an object, which calls the
"New" function and requires the following settings:

* LogLevel - which has to be "off, err, info or debug"
* LogFacility - which currently supports "console or syslog"

After that, logging can be done, by using the "Log" function on the object, by providing
the type of the message (LogLevel) and the message self.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
8 years agoInitial checkin.
Stefan Schantl [Thu, 12 Nov 2015 22:07:44 +0000 (23:07 +0100)] 
Initial checkin.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>