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

Background long running processes with Windows #813

Open
ghost opened this issue Jun 21, 2017 · 1 comment
Open

Background long running processes with Windows #813

ghost opened this issue Jun 21, 2017 · 1 comment

Comments

@ghost
Copy link

ghost commented Jun 21, 2017

Server software

Windows Server 2012 R2
Apache 2.4: web server runs as a service started by a non-privileged user. The user can log on as a service and log on as a batch job.
PHP 5.6
Omeka 2.4.1

Problem

Neither CSVImport Plugin nor BulkEditor Plugin can send long running processes to background. We don't want to change to synchronous (foreground) running. After take a look to error logs and debug, I've found out a problem in this file:
Omeka/application/libraries/Omeka/Job/Process/Dispatcher.php
line 157: exec("$command > /dev/null 2>&1 &");

This line sends the process to background (linux style). In our server, it fails and doesn't execute the command.

My temporary fix

If I make this change it works:
exec("$command > NUL");
In fact, Windows execute the command in foreground with the apache user account, so it starts cmd.exe and closes when the process finishes. To run in background under Windows, maybe: exec("START /B $command > NUL");

@luku
Copy link
Contributor

luku commented Feb 8, 2018

I was using this pclose(popen("start /B {$command}", 'r')); in one project.

I was briefly checking and there are more Linux specific cmds, like file, which, kill, ... So Windows port would require rewriting all these as well.

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