Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Direct STDERR output when listing crontab to /dev/null #20951

Merged

Conversation

danielatdattrixdotcom
Copy link
Contributor

Description (*)

When installing crontab on systems using fcron the output from STDERR is captured and inserted into the updated crontab. An example from a fresh install follows. While fcron does not outright complain about this when saving the file, it is messy and quite avoidable.

2019-02-03 13:18:18  INFO listing magento's fcrontab
#~ MAGENTO START 7cd0a74c421051ec6cce8936eb9edd02
* * * * * /usr/lib64/php7.2/bin/php /var/www/magento/bin/magento cron:run 2>&1 | grep -v "Ran jobs by schedule" >> /var/www/magento/var/log/magento.cron.log
* * * * * /usr/lib64/php7.2/bin/php /var/www/magento/update/cron.php >> /var/www/magento/var/log/update.cron.log
* * * * * /usr/lib64/php7.2/bin/php /var/www/magento/bin/magento setup:cron:run >> /var/www/magento/var/log/setup.cron.log
#~ MAGENTO END 7cd0a74c421051ec6cce8936eb9edd02

Fixed Issues (if relevant)

N/A

Manual testing scenarios (*)

  1. Use fcron as system cron daemon
  2. Execute cron:install command
  3. View crontab and see it littered with STDERR output

Contribution checklist (*)

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds on Travis CI are green)

When installing crontab on systems using fcron the output from STDERR is captured and inserted into the updated crontab. An example from a fresh install follows. While fcron does not outright complain about this when saving the file, it is messy and quite avoidable.

2019-02-03 13:18:18  INFO listing magento's fcrontab
#~ MAGENTO START 7cd0a74c421051ec6cce8936eb9edd02
* * * * * /usr/lib64/php7.2/bin/php /var/www/magento/bin/magento cron:run 2>&1 | grep -v "Ran jobs by schedule" >> /var/www/magento/var/log/magento.cron.log
* * * * * /usr/lib64/php7.2/bin/php /var/www/magento/update/cron.php >> /var/www/magento/var/log/update.cron.log
* * * * * /usr/lib64/php7.2/bin/php /var/www/magento/bin/magento setup:cron:run >> /var/www/magento/var/log/setup.cron.log
#~ MAGENTO END 7cd0a74c421051ec6cce8936eb9edd02
@magento-engcom-team
Copy link
Contributor

Hi @danielatdattrixdotcom. Thank you for your contribution
Here is some useful tips how you can test your changes using Magento test environment.
Add the comment under your pull request to deploy test or vanilla Magento instance:

  • @magento-engcom-team give me test instance - deploy test instance based on PR changes
  • @magento-engcom-team give me 2.3-develop instance - deploy vanilla Magento instance

For more details, please, review the Magento Contributor Assistant documentation

@magento-cicd2
Copy link
Contributor

magento-cicd2 commented Feb 3, 2019

CLA assistant check
All committers have signed the CLA.

@danielatdattrixdotcom
Copy link
Contributor Author

@magento-engcom-team give me test instance

@magento-engcom-team
Copy link
Contributor

Hi @danielatdattrixdotcom. Thank you for your request. I'm working on Magento instance for you

@magento-engcom-team
Copy link
Contributor

Hi @danielatdattrixdotcom, here is your new Magento instance.
Admin access: https://pr-20951.instances.magento-community.engineering/admin
Login: admin Password: 123123q

@magento-engcom-team
Copy link
Contributor

Hi @ihor-sviziev, thank you for the review.
ENGCOM-4124 has been created to process this Pull Request

@magento-engcom-team
Copy link
Contributor

@danielatdattrixdotcom thank you for contributing. Please accept Community Contributors team invitation here to gain extended permissions for this repository.

@magento-engcom-team
Copy link
Contributor

Hi @ihor-sviziev, thank you for the review.
ENGCOM-4124 has been created to process this Pull Request

@sivaschenko
Copy link
Member

I was not able to reproduce the issue. STDERR content generated during crontab command execution is not added to the crontab content.
I used an alias to emulate crontab output to STDERR (MacOS): alias crontab='_(){ (>&2 echo "error message" & crontab $1) }; _’

image

However, I think this pull request should be merged in order to ensure STDERR is not included in the crontab content on specific environments.

@nmalevanec nmalevanec self-assigned this Apr 1, 2019
@magento-engcom-team magento-engcom-team merged commit bd04930 into magento:2.3-develop Apr 9, 2019
@m2-assistant
Copy link

m2-assistant bot commented Apr 9, 2019

Hi @danielatdattrixdotcom, thank you for your contribution!
Please, complete Contribution Survey, it will take less than a minute.
Your feedback will help us to improve contribution process.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants