From 972dcfcdbfe75dcfeb777150c136576cf1a71e99 Mon Sep 17 00:00:00 2001 From: Tudor Florea Date: Fri, 9 Oct 2015 22:59:03 +0200 Subject: initial commit for Enea Linux 5.0 arm Signed-off-by: Tudor Florea --- meta/recipes-extended/cronie/cronie/crond.init | 58 +++++++++++++++ meta/recipes-extended/cronie/cronie/crond.service | 11 +++ .../cronie/cronie/crond_pam_config.patch | 19 +++++ meta/recipes-extended/cronie/cronie/crontab | 10 +++ .../cronie/cronie/fix-out-of-tree-build.patch | 31 ++++++++ meta/recipes-extended/cronie/cronie_1.4.11.bb | 85 ++++++++++++++++++++++ 6 files changed, 214 insertions(+) create mode 100755 meta/recipes-extended/cronie/cronie/crond.init create mode 100644 meta/recipes-extended/cronie/cronie/crond.service create mode 100644 meta/recipes-extended/cronie/cronie/crond_pam_config.patch create mode 100644 meta/recipes-extended/cronie/cronie/crontab create mode 100644 meta/recipes-extended/cronie/cronie/fix-out-of-tree-build.patch create mode 100644 meta/recipes-extended/cronie/cronie_1.4.11.bb (limited to 'meta/recipes-extended/cronie') diff --git a/meta/recipes-extended/cronie/cronie/crond.init b/meta/recipes-extended/cronie/cronie/crond.init new file mode 100755 index 0000000000..53b8514caa --- /dev/null +++ b/meta/recipes-extended/cronie/cronie/crond.init @@ -0,0 +1,58 @@ +#!/bin/sh +### BEGIN INIT INFO +# Provides: crond crontab +# Default-Start: 2345 +# Default-Stop: 016 +# Short-Description: run cron daemon +# Description: cron is a standard UNIX program that runs user-specified +# programs at periodic scheduled times. vixie cron adds a +# number of features to the basic UNIX cron, including better +# security and more powerful configuration options. +### END INIT INFO + +CROND=/usr/sbin/crond +CONFIG=/etc/sysconfig/crond + +[ -f $CONFIG ] || exit 1 +[ -x $CROND ] || exit 1 + +. $CONFIG + +# Source function library. +. /etc/init.d/functions + +case "$1" in + start) + echo -n "Starting crond: " + start-stop-daemon --start --quiet --exec $CROND -- $CRONDARGS + RETVAL=$? + if [ $RETVAL -eq 0 ] ; then + echo "OK" + else + echo "FAIL" + fi + ;; + stop) + echo -n "Stopping crond: " + start-stop-daemon --stop --quiet --pidfile /var/run/crond.pid + RETVAL=$? + if [ $RETVAL -eq 0 ] ; then + echo "OK" + else + echo "FAIL" + fi + ;; + status) + status crond + exit $? + ;; + restart) + $0 stop && sleep 1 && $0 start + ;; + *) + echo "Usage: /etc/init.d/crond {start|stop|status|restart}" + exit 1 +esac + +exit 0 + diff --git a/meta/recipes-extended/cronie/cronie/crond.service b/meta/recipes-extended/cronie/cronie/crond.service new file mode 100644 index 0000000000..d435a6eb34 --- /dev/null +++ b/meta/recipes-extended/cronie/cronie/crond.service @@ -0,0 +1,11 @@ +[Unit] +Description=Periodic Command Scheduler + +[Service] +EnvironmentFile=/etc/sysconfig/crond +ExecStart=@SBINDIR@/crond -n $CRONDARGS +ExecReload=@BASE_BINDIR@/kill -HUP $MAINPID +Restart=always + +[Install] +WantedBy=multi-user.target diff --git a/meta/recipes-extended/cronie/cronie/crond_pam_config.patch b/meta/recipes-extended/cronie/cronie/crond_pam_config.patch new file mode 100644 index 0000000000..675872c3cf --- /dev/null +++ b/meta/recipes-extended/cronie/cronie/crond_pam_config.patch @@ -0,0 +1,19 @@ +password-auth is the Fedora's common pam configure file, use oe common pam +configure files instead. + +Upstream-Status: Pending + +Signed-off-by: Wenzong Fan +--- cronie-1.4.7/pam/crond.orig 2010-12-16 16:59:02.000000000 +0800 ++++ cronie-1.4.7/pam/crond 2011-07-20 09:47:16.080819203 +0800 +@@ -4,7 +4,7 @@ + # + # No PAM authentication called, auth modules not needed + account required pam_access.so +-account include password-auth ++account include common-account + session required pam_loginuid.so +-session include password-auth +-auth include password-auth ++session include common-session-noninteractive ++auth include common-auth diff --git a/meta/recipes-extended/cronie/cronie/crontab b/meta/recipes-extended/cronie/cronie/crontab new file mode 100644 index 0000000000..cc9169eda9 --- /dev/null +++ b/meta/recipes-extended/cronie/cronie/crontab @@ -0,0 +1,10 @@ +# /etc/crontab: system-wide crontab +# Unlike any other crontab you don't have to run the `crontab' +# command to install the new version when you edit this file +# and files in /etc/cron.d. These files also have username fields, +# that none of the other crontabs do. + +SHELL=/bin/sh +PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin + +# m h dom mon dow user command diff --git a/meta/recipes-extended/cronie/cronie/fix-out-of-tree-build.patch b/meta/recipes-extended/cronie/cronie/fix-out-of-tree-build.patch new file mode 100644 index 0000000000..7384a0bad4 --- /dev/null +++ b/meta/recipes-extended/cronie/cronie/fix-out-of-tree-build.patch @@ -0,0 +1,31 @@ +For an out of tree build, the cronie-common.h file was not being +found correctly, so point it to the top_srcdir + +Upstream-Status: Submitted + +Signed-off-by: Saul Wold + +Index: cronie-1.4.11/anacron/Makefile.am +=================================================================== +--- cronie-1.4.11.orig/anacron/Makefile.am ++++ cronie-1.4.11/anacron/Makefile.am +@@ -9,6 +9,7 @@ common_nodist = anacron-paths.h + nodist_anacron_SOURCES = $(common_nodist) + BUILT_SOURCES = $(common_nodist) + ++AM_CFLAGS = -I$(top_srcdir) + + LDADD = $(LIBSELINUX) $(LIBPAM) $(LIBAUDIT) + +Index: cronie-1.4.11/src/Makefile.am +=================================================================== +--- cronie-1.4.11.orig/src/Makefile.am ++++ cronie-1.4.11/src/Makefile.am +@@ -15,6 +15,7 @@ nodist_crond_SOURCES = $(common_nodist) + nodist_crontab_SOURCES = $(common_nodist) + BUILT_SOURCES = $(common_nodist) + ++AM_CFLAGS = -I$(top_srcdir) + + LDADD = $(LIBSELINUX) $(LIBPAM) $(LIBAUDIT) + diff --git a/meta/recipes-extended/cronie/cronie_1.4.11.bb b/meta/recipes-extended/cronie/cronie_1.4.11.bb new file mode 100644 index 0000000000..02234f6a36 --- /dev/null +++ b/meta/recipes-extended/cronie/cronie_1.4.11.bb @@ -0,0 +1,85 @@ +SUMMARY = "Cron daemon for executing programs at set times" +DESCRIPTION = "Cronie contains the standard UNIX daemon crond that runs \ +specified programs at scheduled times and related tools. It is based on the \ +original cron and has security and configuration enhancements like the \ +ability to use pam and SELinux." +HOMEPAGE = "https://fedorahosted.org/cronie/" +BUGTRACKER = "mmaslano@redhat.com" + +# Internet Systems Consortium License +LICENSE = "ISC & BSD" +LIC_FILES_CHKSUM = "file://COPYING;md5=963ea0772a2adbdcd607a9b2ec320c11 \ + file://src/cron.c;endline=20;md5=b425c334265026177128353a142633b4 \ + file://src/popen.c;beginline=3;endline=31;md5=edd50742d8def712e9472dba353668a9" + +SECTION = "utils" + + +SRC_URI = "https://fedorahosted.org/releases/c/r/cronie/cronie-${PV}.tar.gz \ + file://fix-out-of-tree-build.patch \ + file://crond.init \ + file://crontab \ + file://crond.service \ + ${@bb.utils.contains('DISTRO_FEATURES', 'pam', '${PAM_SRC_URI}', '', d)}" + +PAM_SRC_URI = "file://crond_pam_config.patch" +PAM_DEPS = "libpam libpam-runtime pam-plugin-access pam-plugin-loginuid" + +SRC_URI[md5sum] = "2ba645cf54de17f138ef70312843862f" +SRC_URI[sha256sum] = "fd08084cedddbb42499f80ddb7f2158195c3555c2ff40ee11d4ece2f9864d7be" + +inherit autotools update-rc.d useradd systemd + + +PACKAGECONFIG ?= "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'pam', '', d)}" + +PACKAGECONFIG[audit] = "--with-audit,--without-audit,audit," +PACKAGECONFIG[pam] = "--with-pam,--without-pam,libpam,${PAM_DEPS}" + + +INITSCRIPT_NAME = "crond" +INITSCRIPT_PARAMS = "start 90 2 3 4 5 . stop 60 0 1 6 ." + +USERADD_PACKAGES = "${PN}" +GROUPADD_PARAM_${PN} = "--system crontab" + +SYSTEMD_SERVICE_${PN} = "crond.service" + +do_install_append () { + install -d ${D}${sysconfdir}/sysconfig/ + install -d ${D}${sysconfdir}/init.d/ + install -m 0644 ${S}/crond.sysconfig ${D}${sysconfdir}/sysconfig/crond + install -m 0755 ${WORKDIR}/crond.init ${D}${sysconfdir}/init.d/crond + + # install systemd unit files + install -d ${D}${systemd_unitdir}/system + install -m 0644 ${WORKDIR}/crond.service ${D}${systemd_unitdir}/system + sed -i -e 's,@BASE_BINDIR@,${base_bindir},g' \ + -e 's,@SBINDIR@,${sbindir},g' \ + ${D}${systemd_unitdir}/system/crond.service + + # below are necessary for a complete cron environment + install -d ${D}${localstatedir}/spool/cron + install -m 0755 ${WORKDIR}/crontab ${D}${sysconfdir}/ + mkdir -p ${D}${sysconfdir}/cron.d + mkdir -p ${D}${sysconfdir}/cron.hourly + mkdir -p ${D}${sysconfdir}/cron.daily + mkdir -p ${D}${sysconfdir}/cron.weekly + mkdir -p ${D}${sysconfdir}/cron.monthly + touch ${D}${sysconfdir}/cron.deny + + # below setting is necessary to allow normal user using crontab + + # setgid for crontab binary + chown root:crontab ${D}${bindir}/crontab + chmod 2755 ${D}${bindir}/crontab + + # allow 'crontab' group write to /var/spool/cron + chown root:crontab ${D}${localstatedir}/spool/cron + chmod 770 ${D}${localstatedir}/spool/cron + + chmod 600 ${D}${sysconfdir}/crontab +} + +FILES_${PN} += "${sysconfdir}/cron*" + -- cgit v1.2.3-54-g00ecf