-
Notifications
You must be signed in to change notification settings - Fork 155
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
Lockfile permissions not set #86
Comments
I think the assumption is that there is only a single app/website running on a machine. So there is only a single user that needs to run jobby. I could see this as a problem in a shared host environment, or if a machine is hosting multiple PHP apps. The solution would not to be to open permissions on the lock file. The lock file name would have to differ among users so multiple lock files could exist at the same time. |
I run into this issue too. |
Any updates ? |
Currently I use a workarround right before initializing jobby: |
Any updates? I'm having the same issue on shared hosting. A solution would be to namespace the lock files with a unique namespace. The namespace could be configurable through one of the options passed to the Jobby constructor. It could default to EDIT /**
* @return string
*/
protected function getLockFile()
{
$tmp = $this->tmpDir;
$job = $this->helper->escape($this->job);
if (!empty($this->config['environment'])) {
$env = $this->helper->escape($this->config['environment']);
return "$tmp/$env-$job.lck";
} else {
return "$tmp/$job.lck";
}
} It seems that it is already implemented. The lock files are prefixed with the namespce defined by the |
I've run into a permissions issue when running crons from multiple users due to lockfile ownership. When user_a runs jobby the lockfile is created and owned by user_a. When user_b later goes to run, it can't use the lockfile because it doesn't have write permissions.
IMO the mode should be set to 0666.
Is this intended functionality? If not, I'll gladly send a PR for a chmod in Helper :)
The text was updated successfully, but these errors were encountered: