From a761d5fcd1880c8cee96f1f3198093fd92d08c77 Mon Sep 17 00:00:00 2001 From: Chen Qi Date: Wed, 3 Sep 2014 15:09:13 +0800 Subject: at: inherit update-rc.d to handle sysv init script Inherit update-rc.d.bbclass to handle sysv init script. Also make the 'at' daemon start in runlevel 2,3,4,5 instead of S. Signed-off-by: Chen Qi Signed-off-by: Richard Purdie --- meta/recipes-extended/at/at/S99at | 45 ----------------------------------- meta/recipes-extended/at/at/atd.init | 45 +++++++++++++++++++++++++++++++++++ meta/recipes-extended/at/at_3.1.15.bb | 11 +++++---- 3 files changed, 51 insertions(+), 50 deletions(-) delete mode 100644 meta/recipes-extended/at/at/S99at create mode 100644 meta/recipes-extended/at/at/atd.init diff --git a/meta/recipes-extended/at/at/S99at b/meta/recipes-extended/at/at/S99at deleted file mode 100644 index eca379b3cd..0000000000 --- a/meta/recipes-extended/at/at/S99at +++ /dev/null @@ -1,45 +0,0 @@ -#!/bin/sh -# -# Starts at daemon -# - -umask 077 - -# Source function library. -. /etc/init.d/functions - -start() { - echo -n "Starting atd: " - start-stop-daemon --start --quiet --pidfile /var/run/atd.pid --background --exec /usr/sbin/atd -- -f - echo "OK" -} -stop() { - echo -n "Stopping atd: " - start-stop-daemon --stop --quiet --pidfile /var/run/atd.pid - echo "OK" -} -restart() { - stop - start -} - -case "$1" in - start) - start - ;; - stop) - stop - ;; - restart|reload) - restart - ;; - status) - status /usr/sbin/atd - ;; - *) - echo $"Usage: $0 {start|stop|restart|status}" - exit 1 -esac - -exit $? - diff --git a/meta/recipes-extended/at/at/atd.init b/meta/recipes-extended/at/at/atd.init new file mode 100644 index 0000000000..eca379b3cd --- /dev/null +++ b/meta/recipes-extended/at/at/atd.init @@ -0,0 +1,45 @@ +#!/bin/sh +# +# Starts at daemon +# + +umask 077 + +# Source function library. +. /etc/init.d/functions + +start() { + echo -n "Starting atd: " + start-stop-daemon --start --quiet --pidfile /var/run/atd.pid --background --exec /usr/sbin/atd -- -f + echo "OK" +} +stop() { + echo -n "Stopping atd: " + start-stop-daemon --stop --quiet --pidfile /var/run/atd.pid + echo "OK" +} +restart() { + stop + start +} + +case "$1" in + start) + start + ;; + stop) + stop + ;; + restart|reload) + restart + ;; + status) + status /usr/sbin/atd + ;; + *) + echo $"Usage: $0 {start|stop|restart|status}" + exit 1 +esac + +exit $? + diff --git a/meta/recipes-extended/at/at_3.1.15.bb b/meta/recipes-extended/at/at_3.1.15.bb index 1080df44c5..0c37d6d912 100644 --- a/meta/recipes-extended/at/at_3.1.15.bb +++ b/meta/recipes-extended/at/at_3.1.15.bb @@ -20,7 +20,7 @@ SRC_URI = "${DEBIAN_MIRROR}/main/a/at/at_${PV}.orig.tar.gz \ file://posixtm.c \ file://posixtm.h \ file://file_replacement_with_gplv2.patch \ - file://S99at \ + file://atd.init \ file://atd.service \ ${@bb.utils.contains('DISTRO_FEATURES', 'pam', '${PAM_SRC_URI}', '', d)}" @@ -37,7 +37,10 @@ EXTRA_OECONF += "ac_cv_path_SENDMAIL=/bin/true \ --with-atspool=/var/spool/at/spool \ ac_cv_header_security_pam_appl_h=${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'yes', 'no', d)} " -inherit autotools-brokensep systemd +inherit autotools-brokensep systemd update-rc.d + +INITSCRIPT_NAME = "atd" +INITSCRIPT_PARAMS = "defaults" SYSTEMD_SERVICE_${PN} = "atd.service" @@ -51,9 +54,7 @@ do_install () { oe_runmake -e "IROOT=${D}" install install -d ${D}${sysconfdir}/init.d - install -d ${D}${sysconfdir}/rcS.d - install -m 0755 ${WORKDIR}/S99at ${D}${sysconfdir}/init.d/atd - ln -sf ../init.d/atd ${D}${sysconfdir}/rcS.d/S99at + install -m 0755 ${WORKDIR}/atd.init ${D}${sysconfdir}/init.d/atd # install systemd unit files install -d ${D}${systemd_unitdir}/system -- cgit 1.2.3-korg