- Notifications
You must be signed in to change notification settings - Fork88
Open
Labels
Description
Cronie is a cron implementation used in red-hat that supports the CRON_TZ prefix with which you can set a time zone of a cron statement
The service works well, but the crontab editor that comes with it gives a lot of permission problems, so we are going to install cronie by hand, leaving everything else the same
Compilation
qrms@pruebas-cron:~$ sudo su -[sudo] password for qrms: root@pruebas-cron:~# apt-get install -y build-essentialroot@pruebas-cron:~# wget https://github.com/cronie-crond/cronie/releases/download/cronie-1.7.0/cronie-1.7.0.tar.gzroot@pruebas-cron:~# tar xzf cronie-1.7.0.tar.gz root@pruebas-cron:~# cd cronie-1.7.0/root@pruebas-cron:~/cronie-1.7.0# ./configure root@pruebas-cron:~/cronie-1.7.0# makeCreating and mapping folders with links
root@pruebas-cron:~/cronie-1.7.0# mkdir -p /usr/local/var/spool/root@pruebas-cron:~/cronie-1.7.0# ln -s /var/run/ /usr/local/var/runroot@pruebas-cron:~/cronie-1.7.0# ln -s /var/spool/cron/crontabs/ /usr/local/var/spool/cronroot@pruebas-cron:~/cronie-1.7.0# ln -s /etc/cron.d/ /usr/local/etc/cron.dWe copy the binary to /usr/local/bin and modify the cron service in systemd so that it loads cronie
root@pruebas-cron:~/cronie-1.7.0# cp src/crond /usr/local/bin/root@pruebas-cron:~/cronie-1.7.0# vim /lib/systemd/system/cron.service[Unit]Description=Regular background program processing daemonDocumentation=man:cron(8)After=remote-fs.target nss-user-lookup.target[Service]EnvironmentFile=-/etc/default/cron# ExecStart=/usr/sbin/cron -f $EXTRA_OPTSExecStart=/usr/local/bin/crond -f $EXTRA_OPTSIgnoreSIGPIPE=falseKillMode=processRestart=on-failure[Install]WantedBy=multi-user.targetReload
root@pruebas-cron:~/cronie-1.7.0# systemctl daemon-reload root@pruebas-cron:~/cronie-1.7.0# systemctl restart cron.service root@pruebas-cron:~/cronie-1.7.0# systemctl status cron.service ● cron.service - Regular background program processing daemon Loaded: loaded (/lib/systemd/system/cron.service; enabled; vendor preset: enabled) Active: active (running) since Tue 2023-12-26 16:17:17 UTC; 4s ago Docs: man:cron(8) Main PID: 9520 (crond) Tasks: 1 (limit: 2256) Memory: 828.0K CGroup: /system.slice/cron.service └─9520 /usr/local/bin/crond -fdic 26 16:17:17 pruebas-cron systemd[1]: Started Regular background program processing daemon.dic 26 16:17:17 pruebas-cron crond[9520]: (CRON) STARTUP (1.7.0)dic 26 16:17:17 pruebas-cron crond[9520]: (CRON) INFO (Syslog will be used instead of sendmail.)dic 26 16:17:17 pruebas-cron crond[9520]: (CRON) INFO (RANDOM_DELAY will be scaled with factor 67% if used.)And it should be working now