我在 Ubuntu 18.04.2 上运行,并使用 cron 进行各种脚本管理和看门狗。特别是我每晚都会重新启动一些 daemontools 进程。出于某种未知原因,每天早上我都会发现 cron 的双重实例
ps -A | grep cron
我可以手动杀死它,当然也可以自动化它,但我不明白为什么。
我查看了 /etc/cron.* 并没有发现意外的双重脚本。
Ubuntu 的哪个部分规则是 cron?
pgrep -a cron;
1221 /usr/sbin/cron -f
3811 /usr/sbin/CRON -f
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 Wed 2019-04-17 00:50:51 UTC; 1 day 13h ago
Docs: man:cron(8)
Main PID: 1221 (cron)
Tasks: 16
Memory: 544.0M
CPU: 1d 11h 10min 53.180s
CGroup: /system.slice/cron.service
├─ 1221 /usr/sbin/cron -f
├─ 3811 /usr/sbin/CRON -f
├─ 3814 /bin/sh -c /root/civilia/general/admin_server/minuteRoutine.sh
├─ 3815 /bin/sh /root/civilia/general/admin_server/minuteRoutine.sh
├─ 3816 /bin/sh /root/civilia/Candiac/tech/parkingMonitoring-LoRa/prediction.sh
├─ 3817 /usr/lib/R/bin/exec/R --slave --no-restore --file=/root/civilia/Candiac/tech/parkingMonitoring-LoRa//prediction.R
├─ 6069 /bin/sh -c /root/civilia/general/admin_server/minuteRoutine.sh
├─ 6070 /bin/sh /root/civilia/general/admin_server/minuteRoutine.sh
├─ 6071 /bin/sh /root/civilia/Candiac/tech/parkingMonitoring-LoRa/prediction.sh
├─ 6073 /usr/lib/R/bin/exec/R --slave --no-restore --file=/root/civilia/Candiac/tech/parkingMonitoring-LoRa//prediction.R
├─27218 /usr/sbin/CRON -f
├─27221 /bin/sh -c /root/civilia/general/admin_server/minuteRoutine.sh
├─27222 /bin/sh /root/civilia/general/admin_server/minuteRoutine.sh
├─27538 /bin/bash /root/civilia/STS/gtfs-rt/scripts/watchDog.sh
├─28014 bash /var/svc.d/STSAG-create-gtfs-rt/esclave.sh rs
└─28028 sleep 5
Apr 18 14:36:02 VM-001 CRON[24186]: pam_unix(cron:session): session opened for user root by (uid=0)
Apr 18 14:36:02 VM-001 CRON[24187]: pam_unix(cron:session): session opened for user root by (uid=0)
Apr 18 14:36:02 VM-001 CRON[24188]: (root) CMD (php /var/www/html/public_html/portail-Civilia/cron/disconnectionTracker.php > /dev/null )
Apr 18 14:36:02 VM-001 CRON[24189]: (root) CMD (/root/civilia/general/admin_server/minuteRoutine.sh)
Apr 18 14:36:02 VM-001 CRON[24186]: pam_unix(cron:session): session closed for user root
Apr 18 14:36:10 VM-001 CRON[24187]: pam_unix(cron:session): session closed for user root
Apr 18 14:38:02 VM-001 CRON[27217]: pam_unix(cron:session): session opened for user root by (uid=0)
Apr 18 14:38:02 VM-001 CRON[27219]: (root) CMD (php /var/www/html/public_html/portail-Civilia/cron/disconnectionTracker.php > /dev/null )
Apr 18 14:38:02 VM-001 CRON[27218]: pam_unix(cron:session): session opened for user root by (uid=0)
Apr 18 14:38:02 VM-001 CRON[27221]: (root) CMD (/root/civilia/general/admin_server/minuteRoutine.sh)