Description of problem: foreman-maintain creates loong redundant output when it is redirected to a file # foreman-maintain service stop > fm.log # cat fm.log | tr '\r' '\n' Running Stop Services ================================================================================ Check if command is run as root user: [OK] -------------------------------------------------------------------------------- Stop applicable services: Stopping the following service(s): rh-mongodb34-mongod, postgresql, qdrouterd, qpidd, squid, pulp_celerybeat, pulp_resource_manager, pulp_streamer, pulp_workers, smart_proxy_dynflow_core, tomcat, dynflowd, httpd, puppetserver, foreman-proxy | / / - stopping foreman-proxy - stopping foreman-proxy \ stopping puppetserver \ stopping puppetserver | stopping httpd | stopping httpd / stopping httpd - stopping httpd \ stopping httpd | stopping httpd / stopping httpd ... \ stopping postgresql | stopping postgresql / stopping postgresql - stopping postgresql \ stopping postgresql | stopping postgresql / stopping postgresql - stopping rh-mongodb34-mongod - All services stopped [OK] -------------------------------------------------------------------------------- It could be simply: Running Stop Services ================================================================================ Check if command is run as root user: [OK] -------------------------------------------------------------------------------- Stop applicable services: Stopping the following service(s): rh-mongodb34-mongod, postgresql, qdrouterd, qpidd, squid, pulp_celerybeat, pulp_resource_manager, pulp_streamer, pulp_workers, smart_proxy_dynflow_core, tomcat, dynflowd, httpd, puppetserver, foreman-proxy - stopping foreman-proxy - stopping puppetserver - stopping httpd - stopping dynflowd - stopping tomcat - stopping smart_proxy_dynflow_core - stopping pulp_workers - stopping pulp_streamer - stopping pulp_resource_manager - stopping pulp_celerybeat - stopping squid - stopping qpidd - stopping qdrouterd - stopping postgresql - stopping rh-mongodb34-mongod - All services stopped [OK] -------------------------------------------------------------------------------- Version-Release number of selected component (if applicable): rubygem-foreman_maintain-0.2.11-1.el7sat.noarch
This would be really, really great to get fixed, including for *ALL* foremain-maintain subcommands. The same issue (albeit on a much larger scale) shows up when running a Satellite backup in a Cron job via foremain-maintain, the output of which by default is sent via e-mail to the root user on the system. The e-mail sent by Cron is completely unreadable (see below for examples) and is so long that the e-mail actually gets truncated (most of the output is completely lost), making it useless. I've since made the decision to redirect the backup command to /dev/null so it's output doesn't get captured by cron and sent over e-mail, but it'd be really nice if the output could be sent over e-mail again in a readable state (without the spinner causing issues). It would also probably be good to not use any formatting that only works correctly in a terminal (like colors), unless a terminal is being used for stdout, so you don't get strange characters and formatting in the files/e-mails/etc. There were never any issues with this prior to the backup commands being absorbed into foremain-maintain (with the added spinner actions and formatting). Example: ... -------------------------------------------------------------------------------- Generate metadata: | Checking connection to the Mongo DB / Collecting metadata / Collecting system release info / Collecting system release info - Collecting list of plugins - Collecting list of plugins \ Collecting list of plugins | Collecting list of plugins ... ... #### (repeats 50+ times) #### ... ... | Collecting list of plugins / Collecting list of plugins - Collectin! g list of! proxy features - Collecting list of proxy features \ Collecting list of proxy features | Collecting installed RPMs | Collecting installed RPMs / Collecting installed RPMs ... ... \ Collecting installed RPMs | Collecting installed RPMs / Collecting installed RPMs - Saving metadata to metadata.yml [! 32m[1m[O! K][0m -------------------------------------------------------------------------------- Backup config files: - Saving metadata to metadata.yml \ Collecting config files to backup \ Collecting config files to backup | Collecting config files to backup ... ... #### (repeats 100's of times) #### ... ... | Collecting config files to backup / Collecting config files to backup - Collecting config files to backup \ Collecting config files to backup | Collecting config files to backup / Collecting config files to backup - Collecting config files to backup \ Collecting config files to backup #### -> e-mail ends (truncated)
Upstream bug assigned to lzap
Moving this bug to POST for triage into Satellite 6 since the upstream issue https://projects.theforeman.org/issues/28281 has been resolved.
Verified Verified with: - Satellite 6.8.0 snap 10 - rubygem-foreman_maintain-0.6.8-1.el7sat.noarch Test steps: - "foreman-maintain service status > /tmp/test.log" executed from cron. Observation: - Readable output, and spinner is not visible.
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory (Satellite 6.8 Satellite Maintenance Release), and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2020:4365