Bug 39554

Summary: Задвоение в логах в anacron
Product: Sisyphus Reporter: mattaku <mattaku>
Component: anacronAssignee: placeholder <placeholder>
Status: NEW --- QA Contact: qa-sisyphus
Severity: normal    
Priority: P5 CC: glebfm, ldv, legion, placeholder, serega2005
Version: unstable   
Hardware: x86_64   
OS: Linux   
Bug Depends on:    
Bug Blocks: 37164    

Description mattaku@altlinux.org 2021-01-18 07:57:57 MSK
Задвоение в логах alt workstation 9 x86_64

Max ~ # journalctl -u anacron.service
-- Logs begin at Fri 2020-08-28 12:31:42 MSK, end at Mon 2021-01-18 07:55:22 MS>
сен 29 16:17:58 Max.0.2.15 systemd[1]: Started Run cron jobs that were left out>
сен 29 16:17:58 Max.0.2.15 anacron[6850]: Anacron 2.3 started on `2020-09-29 16>
сен 29 16:17:58 Max.0.2.15 anacron[6850]: Anacron 2.3 started on `2020-09-29 16>
сен 29 16:17:58 Max.0.2.15 anacron[6850]: Job `cron.daily' locked by another an>
сен 29 16:17:58 Max.0.2.15 anacron[6850]: Job `cron.weekly' locked by another a>
сен 29 16:17:58 Max.0.2.15 anacron[6850]: Job `cron.monthly' locked by another >
сен 29 16:17:58 Max.0.2.15 anacron[6850]: Normal exit (0 jobs run)
сен 29 16:17:58 Max.0.2.15 anacron[6850]: Job `cron.daily' locked by another an>
сен 29 16:17:58 Max.0.2.15 anacron[6850]: Job `cron.weekly' locked by another a>
сен 29 16:17:58 Max.0.2.15 anacron[6850]: Job `cron.monthly' locked by another >
сен 29 16:17:58 Max.0.2.15 anacron[6850]: Normal exit (0 jobs run)
lines 1-12/12 (END)...skipping...
-- Logs begin at Fri 2020-08-28 12:31:42 MSK, end at Mon 2021-01-18 07:55:22 MSK. --
сен 29 16:17:58 Max.0.2.15 systemd[1]: Started Run cron jobs that were left out due to downtime.
сен 29 16:17:58 Max.0.2.15 anacron[6850]: Anacron 2.3 started on `2020-09-29 16:17:58'
сен 29 16:17:58 Max.0.2.15 anacron[6850]: Anacron 2.3 started on `2020-09-29 16:17:58'
сен 29 16:17:58 Max.0.2.15 anacron[6850]: Job `cron.daily' locked by another anacron - skipping
сен 29 16:17:58 Max.0.2.15 anacron[6850]: Job `cron.weekly' locked by another anacron - skipping
сен 29 16:17:58 Max.0.2.15 anacron[6850]: Job `cron.monthly' locked by another anacron - skipping
сен 29 16:17:58 Max.0.2.15 anacron[6850]: Normal exit (0 jobs run)
сен 29 16:17:58 Max.0.2.15 anacron[6850]: Job `cron.daily' locked by another anacron - skipping
сен 29 16:17:58 Max.0.2.15 anacron[6850]: Job `cron.weekly' locked by another anacron - skipping
сен 29 16:17:58 Max.0.2.15 anacron[6850]: Job `cron.monthly' locked by another anacron - skipping
сен 29 16:17:58 Max.0.2.15 anacron[6850]: Normal exit (0 jobs run)
Comment 1 Dmitry V. Levin 2021-01-18 12:19:52 MSK
(In reply to mattaku@altlinux.org from comment #0)
> Задвоение в логах alt workstation 9 x86_64
> 
> Max ~ # journalctl -u anacron.service
> -- Logs begin at Fri 2020-08-28 12:31:42 MSK, end at Mon 2021-01-18 07:55:22
> MS>
> сен 29 16:17:58 Max.0.2.15 systemd[1]: Started Run cron jobs that were left
> out>
> сен 29 16:17:58 Max.0.2.15 anacron[6850]: Anacron 2.3 started on `2020-09-29
> 16>
> сен 29 16:17:58 Max.0.2.15 anacron[6850]: Anacron 2.3 started on `2020-09-29
> 16>

Его зачем-то запускают дважды, оттуда и задвоение.
Comment 2 serega2005 2022-01-02 15:35:55 MSK
Нет, это именно задвоение в логах.
Причина в файле anacron.service

А именно опция запуска
-d

Don't fork to the background. In this mode, Anacron will output informational messages to standard error, as well as to syslog. The output of jobs is mailed as usual.


Можно эту опцию убрать, тип изменить на Type= forking, опции про syslog в данном случае тоже можно убрать.

[Unit]
Description=Run cron jobs that were left out due to downtime
ConditionACPower=true
After=crond.service

[Service]
Type=forking 
RemainAfterExit=yes
IOSchedulingClass=idle
CPUSchedulingPolicy=batch
#StandardInput=null
#StandardOutput=syslog
#StandardError=syslog
ExecStart=/usr/sbin/anacron -s

[Install]
WantedBy=multi-user.target

Может я что-то упустил, но в таком варианте запускается и работает корректно.