Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 682556 - dmeventd exits after 1 hour, with success retcode
Summary: dmeventd exits after 1 hour, with success retcode
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Robin Johnson
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-04-04 22:57 UTC by Robin Johnson
Modified: 2019-04-17 07:26 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2019-04-04 22:57:30 UTC
Reported by williamh@gentoo.org.

dmeventd is exiting after 1 hour running during idle periods, when it's expected to still be online.

Reading the source quickly, there is condition to exit on idle time exceeding 1 hour.

1. The idle timer should be reset on activity (_process_request after _client_read && cmd != DM_EVENT_CMD_DIE)
2. The idle timeout should be configurable.

williamh:
Can you please provide more detail about how your environment is using dmeventd, esp. if any plugins are loaded.
Comment 1 William Hubbs gentoo-dev 2019-04-04 23:18:06 UTC
The idle timeout should also be able to be infinite, so that dmeventd
never exits.
Comment 2 Alasdair Kergon 2019-04-04 23:44:50 UTC
Well the idea was that if the daemon had no work to do, it would exit - what's the point in tying up system resources with a process that has nothing to do?  If something needs it again, it should restart it transparently on demand.
Comment 3 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2019-04-05 02:22:07 UTC
@agk: I think williamh's enduser case might be doing something "creative" in querying dmeventd that doesn't end up resetting the idle timer presently.
Comment 4 Austin English (RETIRED) gentoo-dev 2019-04-08 16:43:55 UTC
(In reply to Robin Johnson from comment #3)
> @agk: I think williamh's enduser case might be doing something "creative" in
> querying dmeventd that doesn't end up resetting the idle timer presently.

Nothing terribly creative; it's the default config that's installed by lvm2. The issue is that on some machines we have the dmeventd service set to default, but not all of them have lvm devices to monitor, so dmeventd fails.

We don't really need the service to be supervised upstream, but the current initd doesn't support supervision.

I simplified the script to:
#!/sbin/openrc-run
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

# Use variables instead:
command=/sbin/dmeventd
start_stop_daemon_args="--pidfile /run/${RC_SVCNAME}.pid"

depend() {
	# As of .67-r1, we call ALL lvm start/stop scripts with --sysinit, that
	# means dmeventd is NOT notified, as it cannot be safely running
	after lvm device-mapper
}

which allows us to supervise by putting the appropriate settings in /etc/conf.d/dmeventd.

While supervising a crashed process may not make sense to some, it settles our use case (and allows others to supervise dmeventd without having to fork the init script).
Comment 5 Larry the Git Cow gentoo-dev 2019-04-17 07:26:46 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=04b17140f5801dc924927a418f43cfe765afc778

commit 04b17140f5801dc924927a418f43cfe765afc778
Author:     Robin H. Johnson <robbat2@gentoo.org>
AuthorDate: 2019-04-17 07:04:10 +0000
Commit:     Robin H. Johnson <robbat2@gentoo.org>
CommitDate: 2019-04-17 07:25:38 +0000

    sys-fs/lvm2: improve dmeventd init
    
    Upstream dmeventd has an exit-on-idle behavior that leads openrc to
    decide that it has crashed, when it just exited "normally".
    
    Provide multiple ways around this:
    - supervisor support in the init script
    - patch the daemon to make the idle timeout configurable (submitted upstream)
    
    Co-authored-by: William Hubbs <williamh@gentoo.org>
    Fixes: https://bugs.gentoo.org/682556
    Package-Manager: Portage-2.3.62, Repoman-2.3.12
    Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>

 sys-fs/lvm2/files/dmeventd.initd-2.02.184-r2       | 21 +++++++
 .../lvm2-2.02.184-dmeventd-no-idle-exit.patch      | 68 ++++++++++++++++++++++
 sys-fs/lvm2/lvm2-2.02.184-r2.ebuild                |  3 +-
 3 files changed, 91 insertions(+), 1 deletion(-)