Bug 1415850

Summary: Shouldn't /etc/cron.hourly/docker-cleanup be run under systemd to capture stdout/stderr in the logs?
Product: Red Hat Enterprise Linux 7 Reporter: Peter Portante <pportant>
Component: dockerAssignee: Lokesh Mandvekar <lsm5>
Status: CLOSED WONTFIX QA Contact: atomic-bugs <atomic-bugs>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 7.3CC: amurdaca, aos-bugs, jokerman, lsm5, mmccomas, pasik, pportant, rhowe, tkatarki, tsweeney, vgoyal
Target Milestone: rcKeywords: Extras
Target Release: 7.3   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: docker-1.12.6-16.el7_3 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-01-15 07:31:05 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1441450    

Description Peter Portante 2017-01-23 23:36:21 UTC
We found that with BZ https://bugzilla.redhat.com/show_bug.cgi?id=1347821, the hourly docker-cleanup script emits messages to stderr when run, and they are emailed to the root account only.  There are logs that show up in the normal log stream, but not from the cron job.

Shouldn't we be running this cron job as a systemd repeating service so that its output will be properly logged through journald?

Comment 3 Vivek Goyal 2017-02-10 18:13:05 UTC
Peter, running it as a service might be little heavy weight. And I am not sure if service infrastructure allows periodic invocation.

If you are concerned about logging to journal, I think that might be fixable. I found an article talking about using systemd-cat to connect stdout of the program to journal.

Comment 4 Peter Portante 2017-02-10 18:38:41 UTC
(In reply to Vivek Goyal from comment #3)
> Peter, running it as a service might be little heavy weight. And I am not
> sure if service infrastructure allows periodic invocation.

Now sure how that is any heavier weight that the current cron job.

Seems straightforward to do, https://wiki.archlinux.org/index.php/Systemd/Timers#As_a_cron_replacement

> 
> If you are concerned about logging to journal, I think that might be
> fixable. I found an article talking about using systemd-cat to connect
> stdout of the program to journal.

If we just make this a systemd service, we get it for free.

Comment 6 Ryan Howe 2017-04-26 21:58:39 UTC
Looks like this was removed. 

# rpm -ql docker-common-1.12.5-14.el7.x86_64
/etc/cron.hourly/docker-cleanup
/etc/docker/daemon.json
/etc/sysconfig/docker
/usr/bin/docker
/usr/bin/docker-containerd
/usr/bin/docker-containerd-shim
/usr/libexec/docker
/usr/share/doc/docker-common-1.12.5
/usr/share/doc/docker-common-1.12.5/README-docker-common


# rpm -ql docker-common-1.12.6-16.el7.x86_64
/etc/sysconfig/docker
/usr/bin/docker
/usr/bin/docker-containerd
/usr/bin/docker-containerd-shim
/usr/bin/dockerd
/usr/libexec/docker
/usr/share/doc/docker-common-1.12.6
/usr/share/doc/docker-common-1.12.6/README-docker-common

Comment 7 Javier Ramirez 2017-07-04 09:47:16 UTC
Just to mention that I can see there is already a docker-cleanup systemd timer in docker-1.12.6-16.el7.x86_64

# rpm -ql docker-1.12.6-16.el7.x86_64 | grep -i docker-cleanup
/usr/lib/systemd/system/docker-cleanup.service
/usr/lib/systemd/system/docker-cleanup.timer

Comment 11 RHEL Program Management 2021-01-15 07:31:05 UTC
After evaluating this issue, there are no plans to address it further or fix it in an upcoming release.  Therefore, it is being closed.  If plans change such that this issue will be fixed in an upcoming release, then the bug can be reopened.

Comment 12 Red Hat Bugzilla 2023-09-15 00:01:06 UTC
The needinfo request[s] on this closed bug have been removed as they have been unresolved for 500 days