aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@tele2.at>2018-11-23 12:13:06 +0100
committerDavid Oberhollenzer <david.oberhollenzer@tele2.at>2018-11-23 12:24:26 +0100
commit49fe9bd77db951bf7daec435f69502807e41c2c4 (patch)
tree62c6033f1495d31507abc9135c0a479cf2eb21ef
parentb6c97e117c20a91e548966fa50411e7fe3dd8818 (diff)
Implement init/cron split
Signed-off-by: David Oberhollenzer <david.oberhollenzer@tele2.at>
-rw-r--r--.gitignore3
-rw-r--r--Makefile.am2
-rw-r--r--configure.ac6
-rw-r--r--crontab/Makemodule.am2
-rw-r--r--crontab/swclock.in2
-rw-r--r--services/Makemodule.am3
-rw-r--r--services/ntpsetdate.gcron.in7
-rw-r--r--services/swclocksave.gcron.in3
8 files changed, 10 insertions, 18 deletions
diff --git a/.gitignore b/.gitignore
index 20c4545..a82d534 100644
--- a/.gitignore
+++ b/.gitignore
@@ -26,9 +26,8 @@ services/sshd
services/sshd_keygen
services/swclock
services/swclocksave
-services/swclocksave.gcron
services/sysfs
services/mountusr
-services/ntpsetdate.gcron
services/tmpfsvar
+crontab/swclock
.#* \ No newline at end of file
diff --git a/Makefile.am b/Makefile.am
index 0cc0cd6..d397794 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -10,6 +10,7 @@ helper_SCRIPTS =
include scripts/Makemodule.am
include services/Makemodule.am
+include crontab/Makemodule.am
install-data-local:
$(MKDIR_P) $(DESTDIR)$(SVCDIR)
@@ -38,5 +39,4 @@ install-data-local:
$(LN_S) $(TEMPLATEDIR)/mountusr $(DESTDIR)$(SVCDIR)/mountusr
$(LN_S) $(TEMPLATEDIR)/tmpfsrun $(DESTDIR)$(SVCDIR)/tmpfsrun
$(LN_S) $(TEMPLATEDIR)/tmpfsvar $(DESTDIR)$(SVCDIR)/tmpfsvar
- $(MKDIR_P) $(DESTDIR)$(GCRONDIR)
$(LN_S) $(TEMPLATEDIR)/gcrond $(DESTDIR)$(SVCDIR)/gcrond
diff --git a/configure.ac b/configure.ac
index a91fbaf..edd9500 100644
--- a/configure.ac
+++ b/configure.ac
@@ -9,7 +9,7 @@ AC_PROG_MKDIR_P
AC_PROG_LN_S
AC_DEFINE_DIR(SVCDIR, sysconfdir/init.d, [Startup service directory])
-AC_DEFINE_DIR(GCRONDIR, sysconfdir/gcron.d, [Cron service directory])
+AC_DEFINE_DIR(GCRONDIR, sysconfdir/crontab.d, [Cron service directory])
AC_DEFINE_DIR(TEMPLATEDIR, datadir/init, [Service template directory])
AC_DEFINE_DIR(SCRIPTDIR, libexecdir/init, [Helper script directory])
@@ -29,16 +29,16 @@ AC_CONFIG_FILES([services/modules])
AC_CONFIG_FILES([services/hostapd])
AC_CONFIG_FILES([services/swclock])
AC_CONFIG_FILES([services/swclocksave])
-AC_CONFIG_FILES([services/swclocksave.gcron])
AC_CONFIG_FILES([services/nft])
AC_CONFIG_FILES([services/sshd])
AC_CONFIG_FILES([services/sshd_keygen])
AC_CONFIG_FILES([services/mountusr])
-AC_CONFIG_FILES([services/ntpsetdate.gcron])
AC_CONFIG_FILES([services/tmpfsvar])
AC_CONFIG_FILES([scripts/devfs.sh])
AC_CONFIG_FILES([scripts/ifrename.sh])
AC_CONFIG_FILES([scripts/ifcfg.sh])
AC_CONFIG_FILES([scripts/modules_load.sh])
+AC_CONFIG_FILES([crontab/swclock])
+
AC_OUTPUT([Makefile])
diff --git a/crontab/Makemodule.am b/crontab/Makemodule.am
new file mode 100644
index 0000000..2fe3424
--- /dev/null
+++ b/crontab/Makemodule.am
@@ -0,0 +1,2 @@
+crondir = @GCRONDIR@
+cron_DATA = crontab/swclock
diff --git a/crontab/swclock.in b/crontab/swclock.in
new file mode 100644
index 0000000..b5ae7af
--- /dev/null
+++ b/crontab/swclock.in
@@ -0,0 +1,2 @@
+5 */4 * * * @SCRIPTDIR@/setntpdate.sh > /dev/null
+@hourly date --utc +%%m%%d%%H%%M%%Y.%%S > @STATEFILESPATH@/swclock
diff --git a/services/Makemodule.am b/services/Makemodule.am
index e39e200..bb2d464 100644
--- a/services/Makemodule.am
+++ b/services/Makemodule.am
@@ -10,8 +10,7 @@ init_DATA += services/network services/hostapd services/swclock
init_DATA += services/swclocksave services/nft services/sigkill
init_DATA += services/sshd services/sshd_keygen services/consolefont
init_DATA += services/nginx services/usyslogd services/klogd
-init_DATA += services/swclocksave.gcron services/gcrond
-init_DATA += services/mountusr services/ntpsetdate.gcron
+init_DATA += services/gcrond services/mountusr
init_DATA += services/tmpfsrun services/tmpfsvar
EXTRA_DIST += services/sysinit services/vfs services/agetty services/hostname
diff --git a/services/ntpsetdate.gcron.in b/services/ntpsetdate.gcron.in
deleted file mode 100644
index 6f86bd5..0000000
--- a/services/ntpsetdate.gcron.in
+++ /dev/null
@@ -1,7 +0,0 @@
-hour */4
-minute 5
-dayofmonth *
-dayofweek *
-month *
-tty /dev/null
-exec "@SCRIPTDIR@/setntpdate.sh"
diff --git a/services/swclocksave.gcron.in b/services/swclocksave.gcron.in
deleted file mode 100644
index 24e162b..0000000
--- a/services/swclocksave.gcron.in
+++ /dev/null
@@ -1,3 +0,0 @@
-interval hourly
-tty truncate @STATEFILESPATH@/swclock
-exec date --utc +%%m%%d%%H%%M%%Y.%%S