MarcusBarnes / mik

The Move to Islandora Kit is an extensible PHP command-line tool for converting source content and metadata into packages suitable for importing into Islandora (or other digital repository and preservations systems).
GNU General Public License v3.0
34 stars 11 forks source link

Work on #392. #396

Closed mjordan closed 7 years ago

mjordan commented 7 years ago

Github issue: (#392)

What does this Pull Request do?

Changes shutdown hook scripts from running in the background to running in the foreground.

What's new?

As per the discussion in #392, we can't think of any reason to have shutdown hook scripts run as background processes. This PR replaces the code that allowed the scripts to run as a background process with a simple PHP exec() call.

How should this be tested?

This PR requires a smoke test; there are no PHPUnit tests to cover it.

To test:

  1. Check out the issue-392 branch.
  2. Unzip the attached file into your /tmp directory.
  3. Move (mv) all the files in the unzipped directory starting with issue-392* into your mik directory.
  4. Run ./mik -c issue-392.ini. You should see the following ouput:
./mik -c issue-392.ini
Commencing MIK.
Creating 5 Islandora ingest packages. Please be patient.
====================================================================================================> 100%
Running shutdown hook # ./issue-392-script1.sh
Running shutdown hook # ./issue-392-script2.sh
Done. Output packages are in /tmp/issue_392_output. Log is at /tmp/issue_392_output/mik.log

and your /tmp/directory should contain a file /tmp/hey.txt.

Additional Notes

We will need to update https://github.com/MarcusBarnes/mik/wiki/Shutdown-hooks.

Interested parties

@jpeak5 @MarcusBarnes

MarcusBarnes commented 7 years ago

@mjordan I don't see the link to the attached test files mentioned in point two of the how to test section. Would you please attach the files when you get a moment? Thank you in advance.

mjordan commented 7 years ago

Woops, sorry, file is now attached below.

issue-392.zip

MarcusBarnes commented 7 years ago

Appears to work as expected. Thank you @mjordan.