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

Multiple instances of crond may be launched #22

Closed
ghost opened this issue Nov 16, 2018 · 6 comments
Closed

Multiple instances of crond may be launched #22

ghost opened this issue Nov 16, 2018 · 6 comments

Comments

@ghost
Copy link

ghost commented Nov 16, 2018

When crond is launched using systemd, one more instance may be launched using /usr/sbin/crond.
This is because of change at: 5b285b4
When crond launches, it checks whether it already runs or not by looking at the pid file at /var/run/, but this no longer is a correct way of checking for another instance.

@t8m
Copy link
Member

t8m commented Nov 16, 2018

I do not think this is a real issue. Running /usr/sbin/crond manually is a debugging thing and there is no point in limiting that in any way. Or, if you think otherwise, please propose how this should be really handled.

@ghost
Copy link
Author

ghost commented Nov 16, 2018

I also don't see any problem in launching the daemon manually. I see potential problems with having the daemon running twice at the same moment.
It hasn't been allowed until the mentioned commit to have multiple instances running at once and it seemed quite intentional.
I propose checking for other instances, should another instance be detected, then to terminate the process and log an error.
If a specific proposal of handling this is required, I can prepare a pull request.

@t8m
Copy link
Member

t8m commented Nov 16, 2018

What do you exactly mean by "checking for other instances"? That is the crucial question.

@ghost
Copy link
Author

ghost commented Nov 19, 2018

I'd suggest using pidof.
If pidof crond returns more than one pid, it means multiple instances are running.

@t8m
Copy link
Member

t8m commented Nov 19, 2018

You mean spawning pidof from crond? Please no. I really do not think this guard is needed. If someone is starting crond manually he should know what he is doing. He should know that he might need to shutdown the crond.service, etc.

@ghost
Copy link
Author

ghost commented Nov 19, 2018

Thank you for the explanation, I am closing this issue.

@ghost ghost closed this as completed Nov 19, 2018
This issue was closed.
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

1 participant