summaryrefslogtreecommitdiff
path: root/server/monitor
AgeCommit message (Collapse)AuthorFilesLines
2009-10-05add utility call check_and_open_readonlySumit Bose1-1/+1
Use this new utility call to ensure that the config file is safe to read from.
2009-09-25Send debug messages to logfileJakub Hrozek1-3/+15
Introduces a new option --debug-to-files which makes SSSD output its debug information to a file instead of stderr, which is still the default. Also introduces a new confdb option debug_to_files which does the same, but can be specified per-service in the config file. The logfiles are stored in /var/log/sssd by default. Changes the initscript to log to files by default.
2009-09-25Upgrade confdb to version 2Stephen Gallagher3-35/+25
This converts a great many configuration options to the new standard format.
2009-09-25Temporarily disable automatic config file rereadStephen Gallagher1-1/+7
The backends do not honor the reloadConfig SBUS message right now, so if an admin changes the sssd.conf file, it will update only the monitor, potentially leaving the SSSD as a whole in a bad state. This patch will simply comment out monitor_config_file() for the time being until https://fedorahosted.org/sssd/ticket/91 is fixed.
2009-09-24Handle suspend casesSimo Sorce1-6/+13
When a laptop is suspended it may be dormant for hours. Do not check just the kast time a ping was successful, keep a counter with the failed pings instead.
2009-09-23Revert "Use syslog for logging error conditions in SSSD"Stephen Gallagher2-102/+95
This reverts commit 8c50bd085c0efe5fde354deee2c8118887aae29d. Amended: commit 1016af2b1b97ad4290ccce8fa462cc7e3c191b2e also made use of the SYSLOG_ERROR() macro, so those portions of that code also needed to be reverted.
2009-09-21Use syslog for logging error conditions in SSSDJakub Hrozek2-95/+102
This is just a band-aid until ELAPI is fully functional and ready to use.
2009-09-11Exit if the sssd is launched as a user other than rootStephen Gallagher1-0/+9
2009-09-11Fix first-time confdb generationStephen Gallagher1-1/+1
We were talloc_free()-ing the cdb_file string too early.
2009-09-10Read the configuration parsing before daemonizationStephen Gallagher2-83/+106
We will now parse the config file and validate the confdb contents before processing the rest of the monitor startup. This will allow us to return an appropriate error code to the shell if the configuration is invalid.
2009-09-10Remove unused event context argument from confdb_initStephen Gallagher1-1/+1
Because the confdb always operates synchronously, it maintains its own private event context internally. The event context argument passed to it is never used, so we'll remove it to avoid confusion.
2009-09-08Split database in multiple filesSimo Sorce1-10/+7
The special persistent local database retains the original name. All other backends now have their own cache-NAME.ldb file.
2009-09-02remove the concept of a backend nameSumit Bose1-2/+2
The data provider backends stored a name value besides the domain name to identify themselves to the data provider. This was the name of the id provider. Currently the backends can have different providers for id, authentication etc. So the name may be missleading. Also when there are more domains with the same id provider the name is not enough to identify the backend but the domain name is. As a consequence the backend name is removed completely and only the domain name is used for identification.
2009-08-18Ensure that only one local domain is configuredStephen Gallagher1-1/+32
2009-08-17Fix reconnection codeSimo Sorce3-35/+10
Remove redundant reconnection code that was interfeering with the sbus reconnection code. Consolidate include files for sbus relates operations. Make pamsrv code similar to nsssrv code.
2009-08-11Prevent races between dp startup and othersSimo Sorce1-16/+26
Simply delay anything other service by 1 second only at startup.
2009-08-11Change services identification mechanismSimo Sorce4-198/+371
Let services identify themselves voiluntarily as the first operation instead of polling from the monitor. Also consolidate some common functions and make them available as monitor helpers.
2009-08-11Fix monitor ping timeoutStephen Gallagher1-1/+4
Our configuration specifies the monitor config timeout as seconds, but we were passing it directly to dbus commands that require milliseconds. Fixing this in get_monitor_config(). Also, the default value of -1 for the timeout resulted in a timeout much too short to be useful, so I'm making it 10s instead. This fix solves the problem where a busy backend (for example, one that is enumerating a large number of LDAP entries) would fail to respond to the ping in time.
2009-08-10Simplify interfaces initializationSimo Sorce4-87/+37
Make as much as possible static, and remove use of talloc_reference and allocation/deallocation of memory when not necessary. Fix also responder use of rctx->conn, was mistakenly used for both monitor and dp connections.
2009-08-10merge server and connection structuresSimo Sorce1-4/+3
This reduce code duplication as it allows to use one set of watch and timeout functions, and at the same time also allow not to use a secondary structure just to unify these functions.
2009-08-10Cosmetic changesSimo Sorce1-40/+40
Rationalize and rename connection names in preparatoin for merging of server and connection structures.
2009-08-10Remove redundant memory contextsSimo Sorce1-17/+11
Simplify code by removing stuff that is never used or redundant.
2009-07-22Minor cleanups in monitor.cStephen Gallagher1-1/+5
1) Forgot to check for successful allocation 2) Used the wrong mem_ctx when allocating a timer event.
2009-07-20Add option to add timestamps to debug outputSimo Sorce1-4/+7
use '--debug-timestamps' at the command line or set 'debug-timestamps = TRUE' in the configuration file.
2009-07-20Implement resInit for monitor, NSS, PAM, DP and the backendsStephen Gallagher1-1/+13
2009-07-20Monitor resolv.conf for changesStephen Gallagher3-126/+234
This patch updates the monitor_config_file() functions so that they can monitor any number of files and invoke a specified callback whenever they are modified. When inotify is available, we will add an additional watch descriptor to the inotify file descriptor. When inotify is not available, the polling function will simply loop to check each file in the monitor list. When changes are discovered in resolv.conf, the monitor will send a "resInit" signal to all of its known children. They are only required to handle this function if they need updated DNS information. Services that do not implement resInit should return DBUS_ERROR_UNKNOWN_METHOD (rather than timing out) with no ill effects.
2009-07-20Improvements to config file updatesStephen Gallagher1-40/+150
1) Some text editors will create a new file and move it into place on top of the existing file. When this happens, the kernel issues an IN_IGNORE inotify event and automatically removes the watch descriptor for that file. We'll handle the event and create a new watch descriptor for the new file. We will attempt to rewatch the file six times at five-second intervals. 2) Some scripts may append new data to the config file in several steps (such as calling echo "foo" >> sssd.conf several times). In order to handle these scripts safely, we'll defer processing of inotify events for one second after the first is detected. This should be ample time for the remainder of the script to complete.
2009-07-02Adding wrappers to free data in INI API.Dmitri Pal1-4/+2
See ticket #37 in sssd track.
2009-07-02check pending_return after dbus_connection_send_with_replySumit Bose1-4/+4
2009-06-30Eliminate segfault on first start-upStephen Gallagher1-6/+19
There was a typo in the confdb setup portion of the monitor_process_init that was attempting to use the wrong cdb object to initialize. This patch also adds some missing talloc_free() calls on error.
2009-06-19Protect against segfault in service_signal_reloadStephen Gallagher1-0/+9
There is a potential race condition where the monitor may attempt to signal a reload of a child process before the communication sbus channel is available. If this happens, we will just exit this function and let the monitor kill and restart the child process.
2009-06-19Fix segfault in update_monitor_configStephen Gallagher1-8/+26
We were stealing the memory context of only the first value in the linked-list of domains (and also services). This patch adds a memory context to hold the lists so that can be stolen along with all of the entries.
2009-05-28Make Data Provider a mandatory serviceJakub Hrozek1-0/+32
2009-05-26Stop overwriting the stackSimo Sorce1-2/+2
Actually use the buffer not it's location on the stack.
2009-05-26Read the config before startup, fail if cannot be readJakub Hrozek1-0/+26
2009-05-15Treat the local provider as a special caseStephen Gallagher1-1/+16
The local provider needs no backend, so we'll create a special provider entry for it called "local" that will not attempt to retrieve provider configuration but will remain in the service list so it can be updated when the config file changes.
2009-05-14Check for valid ID range, domains overlapJakub Hrozek1-0/+36
2009-05-12Fix warnings in monitor.c and confdb.cStephen Gallagher1-6/+12
2009-05-11Separate confdb API from confdb setupStephen Gallagher1-0/+1
Refactoring the confdb so that the setup code can be linked separately from the access API. This is being done so that our plugins do not need to link against the collection and ini_config libraries.
2009-05-08Use tevent for shutdown signals, remove old pidfile, make sssd single-instance.Jakub Hrozek1-0/+70
Use tevent signal handling facilities for handlong SIGTERM and SIGINT in the monitor. Remove pidfile on SIGTERM and SIGINT. Make sssd single-instance by checking if we suceeded in signaling the process in the pidfile.
2009-04-29Fix configuration corruption issueStephen Gallagher1-2/+20
In the event that the configuration was corrupt the first time the SSSD is started, it would write in the special data for attributes and indexes, but it would fail before writing the version. Subsequent reloads (even with correct configuration files) would fail, since they would try again to write the attributes and indexes and fail since they were already present.
2009-04-14Add common function to retrieve comma sep. listsSimo Sorce1-50/+4
Also convert all places where we were using custom code to parse config arguments. And fix a copy&paste error in nss_get_config
2009-04-14Make reconnection to the Data Provider a global settingStephen Gallagher1-1/+1
Previously, every DP client was allowed to set its own "retries" option. This option was ambiguous, and useless. All DP clients will now use a global option set in the services config called "reconnection_retries"
2009-04-13Fix a couple of segfaults and timeout checksSimo Sorce1-1/+3
2009-04-13Allow configuration of the SSSD through /etc/sssd/sssd.confStephen Gallagher2-13/+347
The SSSD now links with the ini_config and collection libraries in the common directory. The monitor will track changes to the /etc/sssd/sssd.conf file using inotify on platforms that support it, or polled every 5 seconds on platforms that do not. At startup or modification of the conf file, the monitor will purge the existing confdb and reread it completely from the conf file, to ensure that there are no lingering entries. It does this in a transaction, so there should be no race condition with the client services. A new option has been added to the startup options for the SSSD. It is now possible to specify an alternate config file with the -c <file> at the command line.
2009-04-10Redesign the the monitor's configuration to enable live reloadsStephen Gallagher2-150/+618
Fixes requested during code review
2009-04-09Make the monitor address a compile-time optionStephen Gallagher1-20/+10
Previously it was runtime-selectable in the confdb, but this is not a sensible approach, as if it were to change during runtime, it would cause problems communicating with the child services.
2009-04-08Change the way we retrieve domainsSimo Sorce1-11/+10
To be able to correctly filter out duplicate names when multiple non-fully qualified domains are in use we need to be able to specify the domains order. This is now accomplished by the configuration paramets 'domains' in the config/domains entry. 'domains' is a comma separated list of domain names. This paramter allows also to have disbaled domains in the configuration without requiring to completely delete them. The domains list is now kept in a linked list of sss_domain_info objects. The first domain is also the "default" domain.
2009-03-27Fix bug where services restarted by the monitor would be pinged more than ↵Stephen Gallagher1-0/+8
once per cycle
2009-03-20Enhance server_setupSimo Sorce1-3/+4
Now it can load from scratch default configuration that is valid for all daemons. First thing, make it possible for each daemon/provider to set its own debug level in its configuration entry.