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

plugin init example at docker start causes duplicated cron #64

Closed
kstange opened this issue Dec 15, 2014 · 5 comments
Closed

plugin init example at docker start causes duplicated cron #64

kstange opened this issue Dec 15, 2014 · 5 comments

Comments

@kstange
Copy link

kstange commented Dec 15, 2014

The suggested documentation for creating a cron entry says to set up a script at plugins/init. Every time the container is restarted, the script is run, which causes the example script to stack an additional cron job into the crontab. Running the recurring tasks cron many times at once causes a lot of duplicate tasks.

Presumably the correct options are to either make it so plugins/init only runs at initial configuration or to make a suggested script that doesn't insert a new cron if there's an existing entry.

@kstange
Copy link
Author

kstange commented Dec 15, 2014

One possible solution would be to replace the proposed crontab command with:

crontab -u redmine -l 2>/dev/null | grep -v redmine:recur_tasks >/tmp/cron.redmine

@kstange kstange changed the title plugin init runs at docker start plugin init exmaple at docker start causes duplicated cron Dec 15, 2014
@kstange kstange changed the title plugin init exmaple at docker start causes duplicated cron plugin init example at docker start causes duplicated cron Dec 15, 2014
@b-a-t
Copy link

b-a-t commented Dec 16, 2014

I've pointed on the same problem in #50 with the filtering solution....

@sameersbn
Copy link
Owner

@kstange The plugin init mechanism is present mainly to allow for custom operations users may want to run when the image is started. All necessary check should be done by the user who install the plugin init script. In this case it would involve, getting the current list of cron jobs for the redmine user, grep for some pattern, install cron job is pattern is not found.

@kstange
Copy link
Author

kstange commented Dec 17, 2014

I recognize that, my main objective is just to provide a point of feedback on your documentation, such that other people who follow it to the letter don't end up running into issues.

@sameersbn
Copy link
Owner

@kstange yep you are right. I did not realize that line was mentioned in the docs

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

No branches or pull requests

3 participants