summaryrefslogtreecommitdiff
path: root/libdaemon/server
Commit message (Collapse)AuthorAgeFilesLines
* cov: remove unused headersZdenek Kabelac2022-07-111-1/+0
|
* clang: possible better compilation with musl cZdenek Kabelac2022-02-161-0/+1
| | | | | | Try to help resolving reported compilation problem with clang & musl C. https://github.com/lvmteam/lvm2/issues/61
* cov: mask some warning about leakageZdenek Kabelac2021-09-201-0/+2
| | | | Mask false-positive leak report.
* cov: use different variable nameZdenek Kabelac2021-09-201-6/+6
| | | | Better for Coverity to see no change for possibly opened handle.
* daemon-server: handle reaping threads betterZdenek Kabelac2021-04-061-10/+13
| | | | | Avoid sleeping in pselect when thread missed reap() handling. This speedup handling of daemon shutdown sequences.
* cov: drop checking for EWOULDBLOCKZdenek Kabelac2020-09-121-2/+1
| | | | | Reduce cov warning and remove this really ancient define as lvm2 was never compilable on such platform.
* cov: more checks for failing syscallsZdenek Kabelac2019-11-141-1/+2
|
* daemons: check for non-zero thread_idZdenek Kabelac2019-11-111-1/+2
| | | | Do not call pthread_join if thread_id would be 0.
* daemon: better error path handling for shutdownZdenek Kabelac2019-11-111-7/+16
| | | | | Report errors for open in better order. Ensure descriptors are not leaked.
* cov: missing checks of syscallsZdenek Kabelac2019-11-111-3/+6
| | | | Check for sigprocmask errors
* cov: check for socket_path being setZdenek Kabelac2019-08-091-1/+1
| | | | | As we check for existince on entering path let's ensure it's there also on exit path.
* cleanup: missed string specifierZdenek Kabelac2019-04-171-1/+1
|
* libdaemon: use pselect to avoid condition checking raceZdenek Kabelac2019-04-162-11/+29
| | | | | | | | | | To avoid tiny race on checking arrival of signal and entering select (that can latter remain stuck as signal was already delivered) switch to use pselect(). If it would needed, we can eventually add extra code for older systems without pselect(), but there are probably no such ancient systems in use.
* makefiles: drop unneeded LIBS addZdenek Kabelac2018-12-171-2/+0
|
* headers: use configure.h as 1st. headerZdenek Kabelac2018-12-142-5/+1
| | | | | | | | | | | Ensure configure.h is always 1st. included header. Maybe we could eventually introduce gcc -include option, but for now this better uses dependency tracking. Also move _REENTRANT and _GNU_SOURCE into configure.h so it doesn't need to be present in various source files. This ensures consistent compilation of headers like stdio.h since it may produce different declaration.
* device_mapper: remove dbg_malloc.Joe Thornber2018-06-082-8/+8
| | | | | I wrote dbg_malloc before we had valgrind. These days there's just no need.
* build: Don't generate symlinks in include/ dirJoe Thornber2018-05-143-4/+4
| | | | | | | As we start refactoring the code to break dependencies (see doc/refactoring.txt), I want us to use full paths in the includes (eg, #include "base/data-struct/list.h"). This makes it more obvious when we're breaking abstraction boundaries, eg, including a file in metadata/ from base/
* tidy: Add missing underscores to statics.Alasdair G Kergon2017-10-182-6/+6
|
* deamonize: restore detection of errorsZdenek Kabelac2017-09-061-6/+13
| | | | | Keep forked environment for daemon more strick and check even for nearly impossible to happen errors.
* daemonize: more unified codeZdenek Kabelac2017-08-251-6/+15
| | | | | | | | | | ATM we have several instances of daemonizing code. Each has its 'special' logic so not completely easy to unify them all into a single routine. Start to unify them and use one strategy for rediricting all input/outpus to /dev/null - use 'dup2' function for this and open /dev/null before fork to make sure it's available.
* lvmetad: Suppress accept error on clean shutdownAlasdair G Kergon2017-07-061-3/+4
| | | | Also fix error message after pthread_create() error in handle_connect().
* mem: add extra mem pages for pthread stackZdenek Kabelac2017-02-111-1/+1
| | | | | | | | | Some archs can use even 64K pages and then lvm2 runs into trouble if the stack is 'too small' to fit extra page capturing stack overwrite. So when lvm2 limits stack - add extra mem page - be it 4K or 64K. Relates to ppc64le bug: https://bugzilla.redhat.com/1387279
* config: use config_tree_from_string_without_dup_node_check throughout code ↵Peter Rajnoha2016-09-211-1/+1
| | | | to construct metadata trees
* libdaemon: add errno to error messageDavid Teigland2016-08-191-2/+2
|
* pre-releasev2_02_161Alasdair G Kergon2016-07-151-1/+1
|
* cleanup: local static functions with _Zdenek Kabelac2016-07-151-9/+9
|
* coverity: close socket before closing appZdenek Kabelac2016-07-151-0/+4
| | | | | | Opened socket descriptor goes out-of-sight still opened. Close it - but since this happens before app exit, it just fixed valgrind report.
* lvmetad: process new connections after shutdown signalDavid Teigland2016-06-201-5/+11
| | | | | | | | | | | | | | Currently, a shutdown signal will cause lvmetad to quit responding to new connections, but not actually exit until all connections are gone. If a program is maintaining a long running connection (e.g. lvmlockd, or even an lvm command) when lvmetad gets a shutdown signal, then all further commands will hang indefinately waiting for a response that won't be sent. With this patch, make lvmetad continue handling new connections even after a shutdown signal. It will exit once all connections are gone.
* doc: change fsf addressZdenek Kabelac2016-01-215-5/+5
| | | | | Hmm rpmlint suggest fsf is using a different address these days, so lets keep it up-to-date
* libdaemon: fix typo in last log enable commitDavid Teigland2015-10-211-1/+1
|
* libdaemon: allow all debug levels for stderrDavid Teigland2015-10-211-2/+8
| | | | | | The parsing code for log levels was missing some levels. Also ignore an unrecognized level name rather than failing.
* cleanup: move var declarationZdenek Kabelac2015-08-181-1/+1
|
* include: Standardise around new tool.h.Alasdair G Kergon2015-07-062-2/+21
|
* Add lvmlockddev-dct-lvmlockd-AZDavid Teigland2015-07-021-2/+3
|
* libdaemon: add comment about using main and initDavid Teigland2015-06-241-0/+5
|
* libdaemon: allow main processing function to be specifiedDavid Teigland2015-06-232-1/+8
|
* libdaemon: fprintf(stderr...) -> ERROR()Ondrej Kozina2015-05-151-1/+1
| | | | | log data structures are ready. so why not pass error messages through ERROR()
* libdaemon: suggest daemon already runningOndrej Kozina2015-05-151-1/+3
| | | | | when dm_creat_lockfile fails, it's probably due to another instance is holding the same pid file...
* libdaemon: Fix socket reuse error paths.Alasdair G Kergon2015-05-131-3/+3
| | | | | | Invert S_ISSOCK validation. Fail instead of replacing a symlink with a new socket. After failure, skip calling fcntl with invalid socket_fd.
* libdaemon: shutdown on idle also in non-systemd environmentOndrej Kozina2015-05-121-2/+2
|
* libdaemon: introduce support for exit on idleOndrej Kozina2015-04-292-2/+58
| | | | | | | | works with systemd activated daemons only as of now each daemon implementation may decide to signalize its internal idle state (i.e. all background tasks unrelated to client threads are finished)
* libdaemon: map error level properlyOndrej Kozina2015-03-101-0/+1
| | | | | internal daemon error log level was wrongly mapped to debug syslog level causing most error messages were lost in non-debug mode.
* libdaemon: set CLOEXEC flag on systemd socketOndrej Kozina2015-02-021-3/+5
| | | | | | | all sockets opened by a daemon or handed over by systemd have to have CLOEXEC flag set. Otherwise we get nasty warnings about leaking descriptors in processes spawned by daemon.
* libdaemon: set CLOEXEC on client socket fdOndrej Kozina2015-02-021-0/+3
|
* cleanup: avoid double assignZdenek Kabelac2014-08-191-1/+1
| | | | | Skip setting a value to a variable which is never used and overwritten/set afterwards.
* coverity: fix issues reported by coverityPeter Rajnoha2014-06-241-1/+2
|
* cleanup: rename variable waitZdenek Kabelac2014-06-191-2/+2
| | | | With older system headers (sys/wait.h) this shadows declaration.
* libdaemon: Keep track of client threads, wait before shutdown.Petr Rockai2014-06-092-25/+52
|
* libdaemon: header cleanupZdenek Kabelac2014-04-182-3/+2
| | | | | | | Ensure daemon-io.h is used as a generic header included with configure defines before other headers. (In future all lvm2 libraries should settle on a single lib.h header) Rename couple defines to better match header file names.
* lvmetad: extend socket/pid file handlingAlasdair G Kergon2013-11-291-3/+43
| | | | | | | | | | | | | | | Make it easier to run a live lvmetad in debugging mode and to avoid conflicts if multiple test instances need to be run alongside a live one. No longer require -s when -f is used: use built-in default. Add -p to lvmetad to specify the pid file. No longer disable pidfile if -f used to run in foreground. If specified socket file appears to be genuine but stale, remove it before use. On error, only remove lvmetad socket file if created by the same process. (Previous code removes socket even while a running instance is using it!)