From d020cadf81c0c7892f254a8026d0b0912f43e6e1 Mon Sep 17 00:00:00 2001 From: Stefan Saraev Date: Wed, 28 Aug 2013 21:19:56 +0300 Subject: [PATCH] busybox: cron: always start if not cinfigured via settings addon --- packages/sysutils/busybox/default.d/crond.conf | 0 packages/sysutils/busybox/install | 4 ++++ .../busybox/system.d.opt/cron-defaults.service | 11 +++++++++++ packages/sysutils/busybox/system.d.opt/cron.service | 2 ++ 4 files changed, 17 insertions(+) create mode 100644 packages/sysutils/busybox/default.d/crond.conf create mode 100644 packages/sysutils/busybox/system.d.opt/cron-defaults.service diff --git a/packages/sysutils/busybox/default.d/crond.conf b/packages/sysutils/busybox/default.d/crond.conf new file mode 100644 index 0000000000..e69de29bb2 diff --git a/packages/sysutils/busybox/install b/packages/sysutils/busybox/install index 79d4f6b2f9..925fe49734 100755 --- a/packages/sysutils/busybox/install +++ b/packages/sysutils/busybox/install @@ -84,6 +84,10 @@ USER_PWD="`$ROOT/$TOOLCHAIN/bin/cryptpw -m sha512 $USER_PASSWORD`" mkdir -p $INSTALL/lib/systemd/system cp $PKG_DIR/system.d.opt/cron.service $INSTALL/lib/systemd/system enable_service cron.service + mkdir -p $INSTALL/usr/share/services + cp -P $PKG_DIR/default.d/*.conf $INSTALL/usr/share/services + cp $PKG_DIR/system.d.opt/cron-defaults.service $INSTALL/lib/systemd/system + enable_service cron-defaults.service fi enable_service debug-shell.service diff --git a/packages/sysutils/busybox/system.d.opt/cron-defaults.service b/packages/sysutils/busybox/system.d.opt/cron-defaults.service new file mode 100644 index 0000000000..0ce24d37c9 --- /dev/null +++ b/packages/sysutils/busybox/system.d.opt/cron-defaults.service @@ -0,0 +1,11 @@ +[Unit] +Description=Cron defaults +After=local-fs.target + +ConditionPathExists=!/storage/.cache/services/crond.conf +ConditionPathExists=!/storage/.cache/services/crond.disabled + +[Service] +Type=oneshot +ExecStart=/bin/sh -c 'cp /usr/share/services/crond.conf /storage/.cache/services' +RemainAfterExit=yes diff --git a/packages/sysutils/busybox/system.d.opt/cron.service b/packages/sysutils/busybox/system.d.opt/cron.service index 7b83d269fc..39a8edeedd 100644 --- a/packages/sysutils/busybox/system.d.opt/cron.service +++ b/packages/sysutils/busybox/system.d.opt/cron.service @@ -1,5 +1,7 @@ [Unit] Description=Cron daemon +After=syslog.target cron-defaults.service +Requires=cron-defaults.service ConditionPathExists=/storage/.cache/services/crond.conf