commit f576ed041ccd50b1e87e0adf4a0774c2de6a5264 Author: Peter Volkov Date: Sun Apr 5 21:51:01 2009 +0400 Issue warning if cronjobs aren't automatically set Init script is supposed to set cronjobs automatically on start and remove them on stop. This works only with cron daemons that may hook at runtime scripts at ${DST_CRONSCRIPT_DIR} (e.g. sys-process/vixie-cron can). For other cron daemons it's safer to warn users and ask them to set cronjobs manually. diff --git a/etc/init.d/vz-gentoo.in b/etc/init.d/vz-gentoo.in index 8836768..465fab2 100755 --- a/etc/init.d/vz-gentoo.in +++ b/etc/init.d/vz-gentoo.in @@ -58,7 +58,23 @@ setup_cron() { [ -z "$SRC_CRONSCRIPT_DIR" ] && return [ -d "$SRC_CRONSCRIPT_DIR" ] || return - [ -d "$DST_CRONSCRIPT_DIR" ] || return + if [ ! -d "${DST_CRONSCRIPT_DIR}" ]; then + if [ "x${SKIP_CRON_WARNINGS}" != "xyes" ]; then + ewarn "Automatic setup of cron jobs works only if a system cron daemon can use" + ewarn "\${DST_CRONSCRIPT_DIR} (${DST_CRONSCRIPT_DIR}) as a spool directory" + ewarn "(e.g. sys-process/vixie-cron can). On your system ${DST_CRONSCRIPT_DIR}" + ewarn "is not a directory even, thus you need manually set the following cron jobs:" + echo + grep -E -v '(^#|^$)' ${SRC_CRONSCRIPT_DIR}/vz* + echo + ewarn "Alternatevely, please, set cron execution of scripts inside ${SRC_CRONSCRIPT_DIR}" + ewarn "so that modifications in those scripts be handled automatically." + ewarn + ewarn "If you already did that and wish to avoid this warning message put" + ewarn "SKIP_CRON_WARNINGS=yes into /etc/conf.d/vz." + fi + return + fi cat $SRC_CRONSCRIPT_DIR/vz* > $DST_CRONSCRIPT_DIR/vz && chmod 644 $DST_CRONSCRIPT_DIR/vz }