From 921d2e8ec024912ec69ce4f0760d01a685721376 Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Sat, 9 Feb 2013 10:46:57 +0100 Subject: [PATCH] systemd/watchdog: Use systemd as watchdogd daemon when available Provide custom systemd config files to enable the watchdog handling. For systemd we depend on the image containing and using systemd as init script. In case we build images without systemd we will need to install the old watchdog. Maybe it is time to create a MACHINE_FEATURE for watchdog. --- conf/machine/include/sysmobts.inc | 8 +++- .../systemd/systemd/sysmobts-v1/system.conf | 43 +++++++++++++++++++ .../systemd/systemd/sysmobts-v2/system.conf | 43 +++++++++++++++++++ recipes-fixes/systemd/systemd_sysmocom.inc | 9 +++- 4 files changed, 100 insertions(+), 3 deletions(-) create mode 100644 recipes-fixes/systemd/systemd/sysmobts-v1/system.conf create mode 100644 recipes-fixes/systemd/systemd/sysmobts-v2/system.conf diff --git a/conf/machine/include/sysmobts.inc b/conf/machine/include/sysmobts.inc index e26e8ce..b0f609c 100644 --- a/conf/machine/include/sysmobts.inc +++ b/conf/machine/include/sysmobts.inc @@ -19,7 +19,7 @@ MACHINE_FEATURES = "kernel26 serial" MACHINE_ESSENTIAL_EXTRA_RDEPENDS = "\ busybox-ifplugd \ - watchdog \ + ${@['watchdog', ''][d.getVar('DISTRO_FEATURES_INITMAN', True) == 'systemd']} \ kernel \ kernel-module-davinci-wdt \ kernel-module-dspdl \ @@ -34,7 +34,11 @@ MACHINE_ESSENTIAL_EXTRA_RDEPENDS = "\ IMAGE_FSTYPES ?= "tar.bz2 cpio.gz ubifs ubi jffs2" -MACHINE_EXTRA_RDEPENDS = "task-sysmocom-bts sysmobts-firmware watchdog" +MACHINE_EXTRA_RDEPENDS = "\ + task-sysmocom-bts \ + sysmobts-firmware \ + ${@['watchdog', ''][d.getVar('DISTRO_FEATURES_INITMAN', True) == 'systemd']} \ + " #MACHINE_EXTRA_RRECOMMENDS = "dsplink-module" require conf/machine/include/tune-arm926ejs.inc diff --git a/recipes-fixes/systemd/systemd/sysmobts-v1/system.conf b/recipes-fixes/systemd/systemd/sysmobts-v1/system.conf new file mode 100644 index 0000000..04b57dc --- /dev/null +++ b/recipes-fixes/systemd/systemd/sysmobts-v1/system.conf @@ -0,0 +1,43 @@ +# This file is part of systemd. +# +# systemd is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation; either version 2.1 of the License, or +# (at your option) any later version. +# +# See systemd.conf(5) for details + +[Manager] +#LogLevel=info +#LogTarget=journal-or-kmsg +#LogColor=yes +#LogLocation=no +#DumpCore=yes +#CrashShell=no +#ShowStatus=yes +#CrashChVT=1 +#CPUAffinity=1 2 +#DefaultControllers=cpu +#DefaultStandardOutput=journal +#DefaultStandardError=inherit +#JoinControllers=cpu,cpuacct,cpuset net_cls,net_prio +RuntimeWatchdogSec=45 +#ShutdownWatchdogSec=10min +#CapabilityBoundingSet= +#TimerSlackNSec= +#DefaultLimitCPU= +#DefaultLimitFSIZE= +#DefaultLimitDATA= +#DefaultLimitSTACK= +#DefaultLimitCORE= +#DefaultLimitRSS= +#DefaultLimitNOFILE= +#DefaultLimitAS= +#DefaultLimitNPROC= +#DefaultLimitMEMLOCK= +#DefaultLimitLOCKS= +#DefaultLimitSIGPENDING= +#DefaultLimitMSGQUEUE= +#DefaultLimitNICE= +#DefaultLimitRTPRIO= +#DefaultLimitRTTIME= diff --git a/recipes-fixes/systemd/systemd/sysmobts-v2/system.conf b/recipes-fixes/systemd/systemd/sysmobts-v2/system.conf new file mode 100644 index 0000000..04b57dc --- /dev/null +++ b/recipes-fixes/systemd/systemd/sysmobts-v2/system.conf @@ -0,0 +1,43 @@ +# This file is part of systemd. +# +# systemd is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation; either version 2.1 of the License, or +# (at your option) any later version. +# +# See systemd.conf(5) for details + +[Manager] +#LogLevel=info +#LogTarget=journal-or-kmsg +#LogColor=yes +#LogLocation=no +#DumpCore=yes +#CrashShell=no +#ShowStatus=yes +#CrashChVT=1 +#CPUAffinity=1 2 +#DefaultControllers=cpu +#DefaultStandardOutput=journal +#DefaultStandardError=inherit +#JoinControllers=cpu,cpuacct,cpuset net_cls,net_prio +RuntimeWatchdogSec=45 +#ShutdownWatchdogSec=10min +#CapabilityBoundingSet= +#TimerSlackNSec= +#DefaultLimitCPU= +#DefaultLimitFSIZE= +#DefaultLimitDATA= +#DefaultLimitSTACK= +#DefaultLimitCORE= +#DefaultLimitRSS= +#DefaultLimitNOFILE= +#DefaultLimitAS= +#DefaultLimitNPROC= +#DefaultLimitMEMLOCK= +#DefaultLimitLOCKS= +#DefaultLimitSIGPENDING= +#DefaultLimitMSGQUEUE= +#DefaultLimitNICE= +#DefaultLimitRTPRIO= +#DefaultLimitRTTIME= diff --git a/recipes-fixes/systemd/systemd_sysmocom.inc b/recipes-fixes/systemd/systemd_sysmocom.inc index 9d73f44..a179f8d 100644 --- a/recipes-fixes/systemd/systemd_sysmocom.inc +++ b/recipes-fixes/systemd/systemd_sysmocom.inc @@ -1,10 +1,13 @@ S_THISDIR := "${@os.path.dirname(bb.data.getVar('FILE', d, True))}" FILESPATH =. "${@base_set_filespath(["${S_THISDIR}/${PN}"], d)}:" -PRINC="13" +PRINC="16" SRC_URI += "file://journald.conf" +SRC_URI_append_sysmobts-v1 = " file://system.conf" +SRC_URI_append_sysmobts-v2 = " file://system.conf" + # Disable depedency on dbus RDEPENDS_${PN} = "" @@ -34,4 +37,8 @@ pkg_postinst_${PN}_append () { do_install_append() { install -m 0644 ${WORKDIR}/journald.conf ${D}${sysconfdir}/systemd/ + + if [ -e ${WORKDIR}/system.conf ]; then + install -m 0644 ${WORKDIR}/system.conf ${D}${sysconfdir}/systemd/ + fi }