Bug 39554 - Задвоение в логах в anacron
Summary: Задвоение в логах в anacron
Status: NEW
Alias: None
Product: Sisyphus
Classification: Development
Component: anacron (show other bugs)
Version: unstable
Hardware: x86_64 Linux
: P5 normal
Assignee: placeholder@altlinux.org
QA Contact: qa-sisyphus
URL:
Keywords:
Depends on:
Blocks: 37164
  Show dependency tree
 
Reported: 2021-01-18 07:57 MSK by mattaku@altlinux.org
Modified: 2022-01-02 15:35 MSK (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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

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