summaryrefslogtreecommitdiffstats
path: root/server/monitor
Commit message (Collapse)AuthorAgeFilesLines
* Prevent races between dp startup and othersSimo Sorce2009-08-111-16/+26
| | | | Simply delay anything other service by 1 second only at startup.
* Change services identification mechanismSimo Sorce2009-08-114-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.
* Fix monitor ping timeoutStephen Gallagher2009-08-111-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.
* Simplify interfaces initializationSimo Sorce2009-08-104-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.
* merge server and connection structuresSimo Sorce2009-08-101-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.
* Cosmetic changesSimo Sorce2009-08-101-40/+40
| | | | | Rationalize and rename connection names in preparatoin for merging of server and connection structures.
* Remove redundant memory contextsSimo Sorce2009-08-101-17/+11
| | | | Simplify code by removing stuff that is never used or redundant.
* Minor cleanups in monitor.cStephen Gallagher2009-07-221-1/+5
| | | | | 1) Forgot to check for successful allocation 2) Used the wrong mem_ctx when allocating a timer event.
* Add option to add timestamps to debug outputSimo Sorce2009-07-201-4/+7
| | | | | use '--debug-timestamps' at the command line or set 'debug-timestamps = TRUE' in the configuration file.
* Implement resInit for monitor, NSS, PAM, DP and the backendsStephen Gallagher2009-07-201-1/+13
|
* Monitor resolv.conf for changesStephen Gallagher2009-07-203-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.
* Improvements to config file updatesStephen Gallagher2009-07-201-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.
* Adding wrappers to free data in INI API.Dmitri Pal2009-07-021-4/+2
| | | | See ticket #37 in sssd track.
* check pending_return after dbus_connection_send_with_replySumit Bose2009-07-021-4/+4
|
* Eliminate segfault on first start-upStephen Gallagher2009-06-301-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.
* Protect against segfault in service_signal_reloadStephen Gallagher2009-06-191-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.
* Fix segfault in update_monitor_configStephen Gallagher2009-06-191-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.
* Make Data Provider a mandatory serviceJakub Hrozek2009-05-281-0/+32
|
* Stop overwriting the stackSimo Sorce2009-05-261-2/+2
| | | | Actually use the buffer not it's location on the stack.
* Read the config before startup, fail if cannot be readJakub Hrozek2009-05-261-0/+26
|
* Treat the local provider as a special caseStephen Gallagher2009-05-151-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.
* Check for valid ID range, domains overlapJakub Hrozek2009-05-141-0/+36
|
* Fix warnings in monitor.c and confdb.cStephen Gallagher2009-05-121-6/+12
|
* Separate confdb API from confdb setupStephen Gallagher2009-05-111-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.
* Use tevent for shutdown signals, remove old pidfile, make sssd single-instance.Jakub Hrozek2009-05-081-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.
* Fix configuration corruption issueStephen Gallagher2009-04-291-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.
* Add common function to retrieve comma sep. listsSimo Sorce2009-04-141-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
* Make reconnection to the Data Provider a global settingStephen Gallagher2009-04-141-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"
* Fix a couple of segfaults and timeout checksSimo Sorce2009-04-131-1/+3
|
* Allow configuration of the SSSD through /etc/sssd/sssd.confStephen Gallagher2009-04-132-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.
* Redesign the the monitor's configuration to enable live reloadsStephen Gallagher2009-04-102-150/+618
| | | | Fixes requested during code review
* Make the monitor address a compile-time optionStephen Gallagher2009-04-091-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.
* Change the way we retrieve domainsSimo Sorce2009-04-081-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.
* Fix bug where services restarted by the monitor would be pinged more than ↵Stephen Gallagher2009-03-271-0/+8
| | | | once per cycle
* Enhance server_setupSimo Sorce2009-03-201-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.
* Simplify default configurationSimo Sorce2009-03-201-11/+65
| | | | | | | | | | Make confdb load a base ldif like sysdb to initialize the db, makes it simpler to understand at first sight what is the default configuration. Make the parameter "command" optional. Derive the default command from available information. Make the debug level a global by default so that enabling debug for all components is as easy as passing just -d X to the sssd binary.
* Remove references to FreeIPA from D-BUS interfacesStephen Gallagher2009-03-191-4/+4
| | | | | | Per discussion with the desktop team, using the org.freedesktop interface name will simplify adoption, as potential users won't feel like they're pulling in a FreeIPA dependency.
* Fix race condition with initial sysdb creationStephen Gallagher2009-03-071-0/+14
| | | | | | | | | When the sysdb LDB file does not exist on the system, the first attempt to connect to it will invoke a creation routine. However, both the NSS and the InfoPipe are started in parallel by the monitor, resulting in a race condition as they both try to initialize the sysdb. The easiest fix for this is to simply have the monitor create the sysdb before it launches NSS and InfoPipe.
* Implement CreateUser in InfoPipeStephen Gallagher2009-03-061-1/+1
| | | | | | | | | | | Changed the order of the arguments to CreateUser in the Introspection XML to match the other functions (domain belongs second on the list) A few other minor fixes as well: Fixed a typo in SYSDB_GETCACHED_FILTER and sysdb_transaction_end(). Added missing error handling in infp_do_user_set_uid().
* Fix confdb issues.Simo Sorce2009-02-281-2/+4
| | | | | | | | | | | Avoid uninitialized memory messages in valgrind (in _btreemap_get_keys). Do not free memory we just stored in the btree (in confdb_get_domains_list). Streamline confdb_get_domains() and remove extra calls when we already have all the information handy. Do not store basedn in domain info, the base dn is always calculated out of the domain name. Remove the "provider" attribute, it was really used only to distinguish between LOCAL and other domains, directly check for LOCAL as a special case instead.
* Refactor creation of domain_map into confdbStephen Gallagher2009-02-271-2/+3
| | | | | | | | | | | | | | | | | The NSS provider, the Data Provider backends and the InfoPipe all need access to the domain map provided by the confdb. Instead of reimplimenting it in multiple places, it is now provided in a pair of helper functions from the confdb. confdb_get_domains() returns a domain map by reference. Always returns the most up-to-date set of domains from the confdb. confdb_get_domains_list() returns an array of strings of all the domain names. Always returns the most up-to-date set of domains from the confdb. This patch also modifies the btreemap_get_keys() function to better handle memory and report allocation failures.
* Rebase the code to use talloc, tdb, tevent, ldb as externalSimo Sorce2009-02-262-20/+18
| | | | | | dependencies based on the latest samba code. Convert all references to the old events library to use the renamed tevent library.
* Proper fix for memory handling problem.Simo Sorce2009-02-241-10/+8
| | | | | | | | | | sbus_message_handler is not responsible anymore for sending back data in any case. Transfer this responsibility to the handler function called. This way both synchronous and asynchronous funstions use the interface the same way and can properly free memory referenced by the reply after the send buffer has been filled in and all copies are done in sbus_conn_send_reply()
* Revert "Fixing serious memory allocation bug in sbus_message_handler."Simo Sorce2009-02-241-3/+6
| | | | | | | | | | | | | | | This reverts commit 13421cbe0af4343f9d110600755ffa756690b282. Conflicts: server/infopipe/infopipe.c server/infopipe/infopipe.h While this solution fixed the contingent memory problem it introduced other problems in handling asynchronous replies. Reverting in preparation for a different way to solve it. Conflicts have been taken care of.
* Fixing serious memory allocation bug in sbus_message_handler.Stephen Gallagher2009-02-231-6/+3
| | | | | | | | | | | | dbus_message_append_args() adds a reference to memory that is not copied to the outgoing message until dbus_connection_send() is called. Since we compile our reply messages in functions and then return the reply, we need a mechanism for deleting allocated memory after invoking dbus_connection_send. I have changed the arguments to sbus_msg_handler_fn so that it takes a talloc ctx containing the sbus_message_handler_ctx and a pointer to a reply object. We can now allocate memory as a child of the reply context and free it after calling dbus_connection_send.
* If we find the service we are doneSimo Sorce2009-02-131-1/+2
|
* Add a separte global checker that does not depend on individualSimo Sorce2009-02-131-28/+91
| | | | services ping time.
* Add skeleton for InfoPipe serviceStephen Gallagher2009-01-271-0/+2
|
* Refactoring the monitor code and SBUS utility functions.Stephen Gallagher2009-01-275-0/+1203