summaryrefslogtreecommitdiffstats
path: root/daemons/dmeventd
Commit message (Collapse)AuthorAgeFilesLines
* cleanup: add error message and simplify creationZdenek Kabelac2012-08-231-7/+3
| | | | | Report error for malloc failure, and use zeroed allocation to initialize handler structure.
* cleanup: drop unneeded included header filesZdenek Kabelac2012-08-234-8/+0
| | | | | This headers were not resolving anything used for compiled .c files. Remove unused util.c file.
* configure: run directory configuration cleanupPeter Rajnoha2012-06-271-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There were several hard-coded values for run directory around the code. Also, some tools are DM specific only, others are LVM specific and there was no distinction made here before. With this patch applied, we have this cleaned up a bit (subsystem in brackets, defaults in parentheses): [common] configurable PID_DIR (/var/run) lvm [lvm] configurable RUN_DIR (/var/run/lvm) configurable locking dir (/var/lock/lvm) clvmd [lvm] configurable pid file (PID_DIR/clvmd.pid) socket (RUN_DIR/clvmd.sock) lvmetad [lvm] configurable pid file (PID_DIR/lvmetad.pid) socket (RUN_DIR/lvmetad.socket) dm [dm] configurable DM_RUN_DIR (/var/run) cmirrord [dm] configurable pid file (PID_DIR/cmirrord.pid) dmeventd [dm] configurable pid file (PID_DIR/dmeventd.pid) server fifo (DM_RUN_DIR/dmeventd-server) client fifo (DM_RUN_DIR/dmeventd-client) The changes briefly: - added configure --with-default-pid-dir - added configure --with-default-dm-run-dir - added configure --with-lvmetad-pidfile - by default, using one common pid directory for everything (only lvmetad was not following this before)
* cleanup: replace memset with struct initilizationZdenek Kabelac2012-06-221-9/+3
| | | | | Simplifies the code, properly detects too long socket paths, drops unused parameter.
* dmeventd: Improve comment about repeated DIE msgsAlasdair G Kergon2012-06-081-1/+4
|
* Synchronize with self-destruction of dmeventdZdenek Kabelac2012-04-241-0/+7
| | | | | | | | In some occasional case dmevent restart was experiencing problems with obtaining pid lockfile. So this patch tries to send several more kill message until daemon kills itself so there is would reponse. With this small loop the restart seems to work reliable, although the loopsize and usleep are just randomly picked for now.
* Commit ID 46a75dedb4f6aa815a804f27cafbd3fd16a62011 consolidated code from theJonathan Earl Brassow2012-04-101-0/+5
| | | | | | | | | | | various dmeventd plug-ins into a new function called 'dmeventd_lvm2_command', but the new function did not strip off the "_mlog" extentions that the mirror plug-in had been doing. This created bug 794904 - failure to replace devices in a redundant log. The test suite did catch this scenario because it performs repair tests (mainly) through the CLI and not dmeventd. It's also not easy to test because the test itself will hang if the bug is encountered.
* Update debug messageZdenek Kabelac2012-03-231-1/+1
| | | | (compiled only with special debug define)
* Fix check for passed in path for dmeventd startupZdenek Kabelac2012-03-201-2/+2
| | | | | Check passed in executable path for dmeventd instead of predefined compiled in path which is not the thing to be executed.
* Remove dmeventd fifos on exit if they are not managed by systemd.Peter Rajnoha2012-03-151-2/+11
|
* Use SD_ACTIVATION env. var. in systemd units to better detect systemd in use.Peter Rajnoha2012-03-141-0/+6
| | | | | | | | LISTEN_PID and LISTEN_FDS environment variables are defined only during systemd "start" action. But we still need to know whether we're activated during "reload" action as well - we use the reload action to call "dmeventd -R"/"lvmetad -R" for statefull daemon restart. We can't use normal "restart" as that is simply composed of "stop" and "start" and we would lose any state the daemon has.
* Do not run a new dmeventd instance on restart if there's no existing one.Peter Rajnoha2012-03-141-2/+2
|
* We need longer window for checking read from fifo.Zdenek Kabelac2012-03-121-1/+1
| | | | | Seems like some dmeventd startups are taking more time then expected, so make the time window longer here.
* Remove some whitespaces.Milan Broz2012-03-101-1/+1
| | | | (test commit)
* Code refactoringZdenek Kabelac2012-03-021-14/+16
| | | | | | Properly test for dm_asprintf result. Keep unlocking of mutex in the same function and do not spread lock and unlock over functions.
* List _thread_registry missed mutexZdenek Kabelac2012-03-021-2/+4
| | | | | Operation on _thread_registry needs to be covered by mutex. Cosmetic move a die code after free for valgind short leak list.
* Skip zero length messagesZdenek Kabelac2012-03-011-3/+4
| | | | | In case of zero length message, there would be a memory leak on return path from _do_process_request.
* Improve loggingZdenek Kabelac2012-03-011-22/+21
| | | | | Use %m for strerror. Switch to use 0 for fail return code.
* Few more close and dev_close traceZdenek Kabelac2012-03-011-1/+1
| | | | Adding (void) where we cannot really report an error.
* More useful debug messageZdenek Kabelac2012-03-011-1/+1
|
* Log fail of pthread_joinZdenek Kabelac2012-03-011-1/+5
| | | | Syslog error outside of mutex section.
* Reflect new file locations, include file updates etc.Alasdair Kergon2012-02-283-3/+3
|
* Better detection of missing dmeventd fifo connectionZdenek Kabelac2012-02-281-6/+2
|
* Add log_sys_error for closeZdenek Kabelac2012-02-281-16/+16
|
* Add FIXME for misuse in case of dm_event_mask enum.Zdenek Kabelac2012-02-272-0/+4
| | | | Using enum for bitmask is not proper solution here.
* Systemd is linux-specific - move the supporting code under the 'ifdef linux'.Peter Rajnoha2012-02-271-70/+74
| | | | | Some 'defines' used in this specific code were already under an ifdef so this patch just completes it.
* The lvmetad client-side integration. Only active when use_lvmetad = 1 is set inPetr Rockai2012-02-233-3/+3
| | | | lvm.conf *and* lvmetad is running.
* Detect failing fifoZdenek Kabelac2012-02-151-0/+8
| | | | | If the fifo died because of dmeventd restart - do not wait for 20s in select - it will not get better and return error immediately.
* Make sure dereferenced words[0] and words[1] are definedZdenek Kabelac2012-02-131-1/+2
|
* Check for missing reply_uuidZdenek Kabelac2012-02-131-0/+4
|
* Check for allocation failureZdenek Kabelac2012-02-131-2/+9
|
* Fix message checkZdenek Kabelac2012-02-101-3/+3
| | | | | Check pointer from strchr for NULL instead of crash later. Badly formated message would have crash dmeventd otherwise.
* Remove unreachable codeZdenek Kabelac2012-02-101-1/+0
|
* Remove unneeded assignmentsZdenek Kabelac2012-02-081-3/+1
| | | | Variables have (or will have) those values set.
* Add boundary test for number of mirror devs and logsZdenek Kabelac2012-02-081-2/+5
| | | | | | | As atoi may return negative value - test for both limits. Test log_args for limits before calling alloca(). Code from dmeventd mirror plugin should probably share same code as we have in mirrored.c.
* Remove a dubious log message ("another thread is handling an event") from LVMPetr Rockai2012-02-011-4/+1
| | | | dmeventd plugins. Fixes RHBZ 771419.
* Thin forgotten initialisation of pointer to NULLZdenek Kabelac2012-01-201-1/+1
| | | | Since the code may go in error path, set to defined NULL.
* Thin use consistentely metadataZdenek Kabelac2012-01-191-9/+9
| | | | | Do not shortcut to 'meta' and stay with 'metadata' Also matches kernel doc for dm API then.
* Use new dmeventd_lvm2_command function in dmeventd plugins.Zdenek Kabelac2011-12-223-71/+54
| | | | | | | For snapshot, prepare whole command in front into private buffer. Add also some missing '\n' for syslog messages. For raid and mirror only convert creation of command line string. This should avoid any unbound growth of mempool for dm_split_names.
* Thin use helper functionZdenek Kabelac2011-12-221-14/+17
| | | | | | Fix some minor outstading issue from thin plugin introduction - Call dmeventd_lvm2_exit() in failpath for registration. Add some missing '\n' in syslog messages.
* Add helper function dmeventd_lvm2_command().Zdenek Kabelac2011-12-223-0/+27
| | | | Since this code is in all plugins - create a common helper function.
* Updated documentation for dmeventd.Zdenek Kabelac2011-12-221-4/+5
| | | | | | Update man page style. Mention raid and thin plugins. Update help text printed by command to match man page.
* Exported functions from thin pluginZdenek Kabelac2011-12-211-0/+3
|
* Thin add dmeventd supportZdenek Kabelac2011-12-213-1/+327
| | | | | This is basic version with still few unresolved issue mainly in case, when the pool resize is failing.
* Fix missing thread list manipulationZdenek Kabelac2011-12-211-0/+4
| | | | | For manipulation with thread list to avoid race with timeout thread, take also _timeout_mutex.
* Add policy based automated repair of RAID logical volumesJonathan Earl Brassow2011-12-061-1/+36
| | | | | | | | The RAID plug-in for dmeventd now calls 'lvconvert --repair' to address failures of devices in a RAID logical volume. The action taken can be either to "warn" or "allocate" a new device from any spares that may be available in the volume group. The action is designated by setting 'raid_fault_policy' in lvm.conf - the default being "warn".
* Fix a bug in dmeventd snapshot monitoring code where the monitoring thresholdPetr Rockai2011-11-211-8/+29
| | | | would grow with subsequent snapshot extensions (RHBZ 754198).
* Make dmsetup.static and lvm.static build when dmeventd is disabled.Alasdair Kergon2011-11-141-2/+2
| | | | | | | | udev may also need to be disabled if you didn't build it statically too. dmeventd.static could be fixed with some more work but I don't really see the point: without dlopen() it's useless, and if you have dlopen(), why not support normal shared libraries too?
* Remove a redundant (and in some cases, misleading) message about snapshotPetr Rockai2011-10-191-5/+1
| | | | | extension, in the snapshot dmeventd plugin. The reporting is done as needed by the LVM command nowadays.
* Keep the LVM-based dmeventd plugins from trying to manipulate the dmeventdPetr Rockai2011-10-191-0/+1
| | | | | | | | | monitoring state of the logical volumes they are currently acting on. Until now, every time a logical volume has been changed by a dmeventd plugin, this plugin would have called back to dmeventd through the external FIFO mechanism. I am fairly sure this was superfluous, inefficient and possibly even dangerous.