Go to the source code of this file.
Functions | |
void | init_files () |
Initialize the programs file variables. More... | |
void | finalize_files () |
Remove temporary files. More... | |
void | re_init_files () |
Reinitialize the programs file variables. More... | |
void | set_file_timestamp () |
Set the Runtime control file's last modified timestamp. More... | |
char * | find_rcfile () |
Search the system for the monit control file. More... | |
int | create_pidfile (char *pidfile) |
Create a program's pidfile - Such a file is created when in daemon mode. More... | |
int | is_rcfile_changed () |
Test the monit control file for changes. More... | |
time_t | file_changedtime (char *file) |
Get a files last modified timestamp. More... | |
int | check_rcfile (char *rcfile) |
Secure check the monitrc file. More... | |
int | isreg_file (char *file) |
Check if the file is a regular file. More... | |
int | exist_file (char *file) |
Definition in file files.c.
|
Secure check the monitrc file. The run control file must have the same uid as the REAL uid of this process, it must have permissions no greater than 700 and it must not be a symbolic link. We check these conditions here. (Inspired by code from fetchmail)
|
|
Create a program's pidfile - Such a file is created when in daemon mode. The file is created with mask = PIDMASK (usually 644).
|
|
Definition at line 318 of file files.c. Referenced by find_rcfile(), and get_pid(). |
|
Get a files last modified timestamp. This function returns the max of either st_mtime or st_ctime. If the file does not exist or is not a regular file FALSE is returned
Definition at line 225 of file files.c. References MAXIMUM. Referenced by get_process_uptime(). |
|
Remove temporary files.
Definition at line 95 of file files.c. References myrun::pidfile, and Run. |
|
Search the system for the monit control file. Try first ~/.monitrc, if that fails try ./monitrc and finally /etc/monitrc. Exit the application if the control file is not found.
Definition at line 134 of file files.c. References myrun::myenvironment::cwd, myrun::Env, error(), exist_file(), myrun::myenvironment::home, MONITRC, prog, Run, and xmalloc(). |
|
Initialize the programs file variables.
Definition at line 70 of file files.c. References myrun::Env, myrun::myenvironment::home, MYPIDDIR, MYPIDFILE, myrun::pidfile, Run, set_file_timestamp(), and xstrdup(). |
|
Test the monit control file for changes.
Definition at line 203 of file files.c. References myrun::controlfile, and Run. |
|
Check if the file is a regular file.
Definition at line 304 of file files.c. Referenced by get_md5sum(), and get_pid(). |
|
Reinitialize the programs file variables.
Definition at line 105 of file files.c. References set_file_timestamp(). |
|
Set the Runtime control file's last modified timestamp.
Definition at line 115 of file files.c. References myrun::controlfile, and Run. Referenced by init_files(), and re_init_files(). |