summaryrefslogtreecommitdiffstats
path: root/daemons/dmeventd/dmeventd.c
Commit message (Collapse)AuthorAgeFilesLines
* cleanup: drop unneeded included header filesZdenek Kabelac2012-08-231-2/+0
| | | | | This headers were not resolving anything used for compiled .c files. Remove unused util.c file.
* 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.
* 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
|
* 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.
* Log fail of pthread_joinZdenek Kabelac2012-03-011-1/+5
| | | | Syslog error outside of mutex section.
* 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.
* Check for allocation failureZdenek Kabelac2012-02-131-2/+9
|
* Remove unreachable codeZdenek Kabelac2012-02-101-1/+0
|
* Remove unneeded assignmentsZdenek Kabelac2012-02-081-3/+1
| | | | Variables have (or will have) those values set.
* 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.
* 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.
* Keep the old-style function definitionZdenek Kabelac2011-09-141-1/+1
|
* Fix resource leak when strdup failsZdenek Kabelac2011-08-311-2/+4
| | | | Static analyzer noticed, strdup failing path leaks dmt structure.
* Add support for systemd file descriptor handover in dmeventd.Peter Rajnoha2011-07-281-4/+91
| | | | | | | | | | | | | Systemd preloads file descriptors for us and passes them in for newly spawned daemon when using on-demand fifo (or socket) based activation. This patch adds checks for file descriptors preloaded by systemd and uses them instead of opening the FIFOs again to properly support on-demand FIFO-based activation. (We'll change FIFOs to sockets soon - but still this part of the code will stay almost the same.)
* Add support for new oom killer adjustment interface (oom_score_adj).Peter Rajnoha2011-07-281-19/+42
| | | | | | | | | The filename to adjust the oom score was changed in 2.6.36. We should use oom_score_adj instead of oom_adj (which is still there under /proc, but it's scheduled for removal in August 2012). New oom_score_adj uses a range from -1000 (OOM_SCORE_ADJ_MIN, disable oom killing) to 1000 (OOM_SCORE_ADJ_MAX).
* Add rudimentary versioning to the dmevend protocol, allowing us to detect thePetr Rockai2011-04-041-3/+12
| | | | | | (protocol) version of the running dmeventd on the client side. Right now this is only used in dmeventd -R.
* Add attribute printfZdenek Kabelac2011-03-291-0/+1
| | | | | gcc suggested to add these attributes to instrumentat printf arguments. Adding it for internal functions as well.
* Fix -Wold-style-definition gcc warningsZdenek Kabelac2011-03-291-2/+1
|
* Do not run past the end of an array in dmeventd's _handle_request when facedPetr Rockai2011-03-021-2/+2
| | | | with an unknown command ID.
* As requested in BZ 454618:Petr Rockai2011-03-021-4/+5
| | | | | | - dmeventd -R will continue to start up even if no dmeventd is currently running + a test for this behaviour - add -R to dmeventd manpage
* Test result of dm_task_set_uuidZdenek Kabelac2011-02-281-2/+5
|
* Remove DEBUGLOG from dmeventd.Milan Broz2011-01-171-21/+1
|
* Add check for unlink errorsZdenek Kabelac2010-12-201-1/+2
|
* Add new dm_prepare_selinux_context fn to libdevmapper and use it throughout.Peter Rajnoha2010-12-131-5/+23
| | | | | | | | | | | Detect existence of new SELinux selabel interface during configure. Use new dm_prepare_selinux_context instead of dm_set_selinux_context. We should set the SELinux context before the actual file system object creation. The new dm_prepare_selinux_context function sets this using the selabel_lookup fn in conjuction with the setfscreatecon fn. If selinux/label.h interface (that should be a part of the selinux library) is not found during configure, we fallback to the original matchpathcon function instead.
* Use one fprintf call for usage printZdenek Kabelac2010-11-291-8/+6
| | | | Replace multiple fprintf calls with multiline one.
* Remove dead assignment in 'main'Zdenek Kabelac2010-11-291-2/+1
| | | | 'ret' is never read anywhere - remove it.
* Update C declaration () -> (void)Zdenek Kabelac2010-10-261-2/+2
|
* Fix clang warning for ntohl(*((uint32_t *)buf))Zdenek Kabelac2010-10-251-8/+9
| | | | | | | We cast (char*) to (uint32_t*) that changes alignment requierements. For our case the code has been correct as alloca() returns properly aligned buffer, however this patch make it cleaner and more readable and avoids warning generation.
* Implement dmeventd -R, allowing dmeventd to be restarted without losingPetr Rockai2010-10-201-3/+142
| | | | monitoring state.
* Add dm_zalloc and use it and dm_pool_zalloc throughout.Alasdair Kergon2010-09-301-4/+2
|
* Remove superfluous NULL pointer tests before dm_free from dmeventd.Alasdair Kergon2010-08-161-14/+7
|
* Add dm_create_lockfile to libdm to handle pidfiles for all daemons.Fabio M. Di Nitto2010-07-131-42/+9
| | | | | | Switch dmeventd to use dm_create_lockfile and drop duplicate code. Allow clvmd pidfile to be configurable. Switch cmirrord and clvmd to use dm_create_lockfile.
* Use __attribute__ consistently throughout.Alasdair Kergon2010-07-091-4/+4
|
* Use -d to control level of messages sent to syslog by dmeventd.Alasdair Kergon2010-05-141-8/+14
| | | | | Change -d to -f to run dmeventd in foreground. (mornfall)
* pre-releaseAlasdair Kergon2010-04-141-1/+1
|
* pre-releaseAlasdair Kergon2010-04-141-2/+2
|
* Add error diagnostic for setenv failure.Zdenek Kabelac2010-04-131-1/+2
|
* Don't kill the parent if debugging.Mikulas Patocka2010-03-311-1/+2
| | | | | | | | | | If dmeventd runs with -d flag, it doesn't fork into backgroud. The command kill(getppid(), SIGTERM) attempts to kill the parent dmeventd process, however, if there is no parent, it kills whatever process spawned dmeventd. In case of debugging with gdb, the parent is gdb, thus kill(getppid(), SIGTERM) kills the debugger. Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
* Force C localeZdenek Kabelac2010-03-301-0/+7
| | | | As we need to use mlockall() enforce "C" locales for dmeventd.
* Fix resouce leak in error pathZdenek Kabelac2010-03-301-1/+2
| | | | | | If the error path of _register_for_event() calls _free_thread_status() _lib_put() call is missing. To make thing simpler move this _lib_put() into common error path code.
* Remove mlockall() form dmeventdZdenek Kabelac2010-03-301-8/+0
| | | | | | | | | As the header file <sys/mman.h> was not included in dmeventd.c thus missed definition of MCL_CURRENT so this patch only makes it obvious we were not locking memory here. This patch has no functional change. Later part of this patch set handles mlockall() via memlock_inc_daemon().
* more fixesAlasdair Kergon2008-11-041-1/+0
|