#include <map>
#include <signal.h>
#include <wait.h>
#include <pwd.h>
#include <dirent.h>
#include <syslog.h>
#include <errno.h>
#include <sys/poll.h>
#include "inotify-cxx.h"
#include "incrontab.h"
#include "usertable.h"
Defines | |
#define | DAEMON true |
Daemon yes/no. | |
#define | INCRON_APP_NAME "incrond" |
Application name. | |
#define | INCRON_LOG_OPTS (LOG_CONS | LOG_PID) |
Logging options (console as fallback, log PID). | |
#define | INCRON_LOG_FACIL LOG_CRON |
Logging facility (use CRON). | |
Typedefs | |
typedef std::map< std::string, UserTable * > | SUT_MAP |
User name to user table mapping definition. | |
Functions | |
void | on_signal (int signo) |
Handles a signal. | |
bool | check_user (const char *user) |
Checks whether an user exists and has permission to use incron. | |
void | load_tables (Inotify *pIn, EventDispatcher *pEd) throw (InotifyException) |
Attempts to load all user incron tables. | |
int | main (int argc, char **argv) |
Main application function. | |
Variables | |
SUT_MAP | g_ut |
User name to user table mapping table. | |
volatile bool | g_fFinish = false |
Finish program yes/no. |
inotify cron system
Copyright (C) 2006 Lukas Jelinek, <lukas@aiken.cz>
This program is free software; you can use it, redistribute it and/or modify it under the terms of the GNU General Public License, version 2 (see LICENSE-GPL).
|
Daemon yes/no.
|
|
Application name.
|
|
Logging facility (use CRON).
|
|
Logging options (console as fallback, log PID).
|
|
User name to user table mapping definition.
|
|
Checks whether an user exists and has permission to use incron. It searches for the given user name in the user database. If it failes it returns 'false'. Otherwise it checks permission files for this user (see InCronTab::CheckUser()).
|
|
Attempts to load all user incron tables. Loaded tables are registered for processing events.
|
|
Main application function.
|
|
Handles a signal. For SIGTERM and SIGINT it sets the program finish variable.
|
|
Finish program yes/no.
|
|
User name to user table mapping table.
|