You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
calculate-overlay/profiles/templates/3.6/3_ac_install_live/1-merge/sys-process/cronie/cronie-migrate

22 lines
720 B

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

# Calculate run=/bin/bash
# Шаблон миграции с vixie-cron на cronie
# Если пользователь не менял основной файл /etc/crontab, то замещает его на
# новый от cronie
# Завершает процесс vixie-cron и запускает службу cronie
origcrontab=/etc/crontab
cfgcrontab1=/etc/._cfg0000_crontab
cronpidfile=/run/cron.pid
if ! [[ -f $cfgcrontab1 ]] && [[ -f $cronpidfile ]]
then
CRONPID="$(<$cronpidfile)"
if [[ "$(cat /proc/$CRONPID/cmdline 2>/dev/null | tr -d '\0' )" == "/usr/sbin/cron" ]]
then
kill $CRONPID
rm -f $cronpidfile
fi
echo "Starting cronie instead vixie-cron ..."
/etc/init.d/cronie start &>/dev/null
fi