phosphor-event: Convert options to config file
The systemd unit file for phosphor-event currently hard
codes the maximum buffer size. Convert this to a systemd
EnvironmentFile so that it can more easily be replaced or
changed on individual systems.
Resolves openbmc/openbmc#216.
Change-Id: I17d471a872248190ca6eace41bc2ea41eb60bee6
Signed-off-by: Sergey Solomin <sergey.solomin@us.ibm.com>
diff --git a/meta-phosphor/common/recipes-phosphor/obmc-phosphor-event/files/eventd.conf b/meta-phosphor/common/recipes-phosphor/obmc-phosphor-event/files/eventd.conf
new file mode 100644
index 0000000..b50dfbc
--- /dev/null
+++ b/meta-phosphor/common/recipes-phosphor/obmc-phosphor-event/files/eventd.conf
@@ -0,0 +1,4 @@
+LOG_SIZE_LIMIT="197376"
+LOG_COUNT_LIMIT="128"
+
+OPTIONS="-s ${LOG_SIZE_LIMIT} -t ${LOG_COUNT_LIMIT}"
diff --git a/meta-phosphor/common/recipes-phosphor/obmc-phosphor-event/files/obmc-phosphor-event.service b/meta-phosphor/common/recipes-phosphor/obmc-phosphor-event/files/obmc-phosphor-event.service
index 065cc55..a93fce0 100644
--- a/meta-phosphor/common/recipes-phosphor/obmc-phosphor-event/files/obmc-phosphor-event.service
+++ b/meta-phosphor/common/recipes-phosphor/obmc-phosphor-event/files/obmc-phosphor-event.service
@@ -2,8 +2,9 @@
Description=Phosphor OpenBMC event management daemon
[Service]
+EnvironmentFile=-/etc/default/eventd/eventd.conf
Restart=always
-ExecStart=/usr/sbin/obmc-phosphor-eventd -s 200000 -t 128
+ExecStart=/usr/sbin/obmc-phosphor-eventd $OPTIONS
[Install]
WantedBy=multi-user.target
diff --git a/meta-phosphor/common/recipes-phosphor/obmc-phosphor-event/obmc-phosphor-event.bb b/meta-phosphor/common/recipes-phosphor/obmc-phosphor-event/obmc-phosphor-event.bb
index eeb4a79..2ab7ce5 100644
--- a/meta-phosphor/common/recipes-phosphor/obmc-phosphor-event/obmc-phosphor-event.bb
+++ b/meta-phosphor/common/recipes-phosphor/obmc-phosphor-event/obmc-phosphor-event.bb
@@ -12,6 +12,7 @@
TARGET_CPPFLAGS += "-std=c++11 -fpic"
SRC_URI += "git://github.com/openbmc/phosphor-event"
+SRC_URI += "file://eventd.conf"
SRCREV = "4dad23916e69d55d692eca7389d67eb023c5ca66"
@@ -26,4 +27,6 @@
install -d ${D}/var/lib/obmc/events/
install -m 0755 -d ${D}${sbindir}
install -m 0755 ${S}/${INSTALL_NAME} ${D}/${sbindir}/obmc-phosphor-eventd
+ install -m 0755 -d ${D}${sysconfdir}/default/eventd
+ install -m 0644 ${WORKDIR}/eventd.conf ${D}${sysconfdir}/default/eventd/eventd.conf
}