Skip to content
This repository has been archived by the owner on Nov 27, 2019. It is now read-only.

Ctrl-C doesn't terminate the Firefox process spawned by jpm run #120

Closed
XrXr opened this issue Jul 24, 2014 · 14 comments · Fixed by #121
Closed

Ctrl-C doesn't terminate the Firefox process spawned by jpm run #120

XrXr opened this issue Jul 24, 2014 · 14 comments · Fixed by #121

Comments

@XrXr
Copy link
Contributor

XrXr commented Jul 24, 2014

When using cfx run, using Ctrl-C in the terminal would end both cfx and the Firefox process it spawned.
Using Ctrl-C when jpm is in progress only ends jpm, not it's associated Firefox process.

jsantell added a commit that referenced this issue Jul 24, 2014
Kill Firefox process when main process ends, fixes #120
@XrXr
Copy link
Contributor Author

XrXr commented Jul 30, 2014

I'm still having the same issue on Windows with master at 88c37fe

@jsantell jsantell reopened this Jul 30, 2014
@jsantell
Copy link
Contributor

Hmm, wonder why this is.. I'll give this a go on a windows VM

@XrXr
Copy link
Contributor Author

XrXr commented Jul 30, 2014

I get this error when I Ctrl-C


fs.js:760
  return binding.unlink(pathModule._makeLong(path));
                 ^
Error: EBUSY, resource busy or locked '...\4b576ccc-12f3-45c4-b2e0-8c09db2818e4\cert8.db'
    at Object.fs.unlinkSync (fs.js:760:18)
    at Object.exports.rmdirSyncRecursive (...\npm\node_modules\jpm\node_modules\firefox-profile\node_modules\wrench\lib\wrench.js:164:16)
    at FirefoxProfile.deleteDir (...\npm\node_modules\jpm\node_modules\firefox-profile\lib\firefox_profile.js:137:44)
    at process.FirefoxProfile.onExit (...\npm\node_modules\jpm\node_modules\firefox-profile\lib\firefox_profile.js:117:12)
    at process.EventEmitter.emit (events.js:92:17)
    at Signal.wrap.onsignal (node.js:757:46)

Firefox doesn't quit.

@jsantell
Copy link
Contributor

jsantell commented Aug 1, 2014

Opened bug on firefox-profile-js

@saadtazi
Copy link

saadtazi commented Aug 2, 2014

Hi @XrXr
can you please try it with firefox-profile@0.2.11?

@XrXr
Copy link
Contributor Author

XrXr commented Aug 2, 2014

@saadtazi I now get this error

 console.warn('[firefox-profile] cannot delete profileDir on exit', profileDir
                                                                    ^
ReferenceError: profileDir is not defined
    at FirefoxProfile._cleanOnExit (...\npm\node_modules\jpm\node_modules\firefox-profile\lib\firefox_profile.js:200:74)
    at process.FirefoxProfile.onExit (...\npm\node_modules\jpm\node_modules\firefox-profile\lib\firefox_profile.js:119:12)
    at process.EventEmitter.emit (events.js:92:17)
    at Signal.wrap.onsignal (node.js:757:46)

@saadtazi
Copy link

saadtazi commented Aug 2, 2014

my bad. I run the test but it is not yet covered by the tests... Please try with 0.2.12.

@XrXr
Copy link
Contributor Author

XrXr commented Aug 2, 2014

@saadtazi Now I get

[firefox-profile] cannot delete profileDir on exit ...\AppData\Local\Temp\eac5238f-7f3c-4d13-ba57-ef023d65c952 { [Error: EBUSY, resource busy or locked '...\AppData\Local\Temp\eac5238f-7f3c-4d13-ba57-ef023d65c952\cert8.db']
  errno: 10,
  code: 'EBUSY',
  path: '...\\AppData\\Local\\Temp\\eac5238f-7f3c-4d13-ba57-ef023d65c952\\cert8.db',
  syscall: 'unlink' }

cfx doesn't clean up the temporary profiles it creates. Maybe this can use a different approach where the profile is logged then cleaned up on the next run

@saadtazi
Copy link

saadtazi commented Aug 3, 2014

So I would suggest then that jpm uses a profile that has fp.shouldDeleteOnExit(false) and the profile cleanup is done by jpm.
Another approach: we can add to firefox-profile-js a profileDir param to the constructor so jpm knows which folder it needs to cleanup when it exits (or when it starts?). @jsantell your thoughts?

@jsantell
Copy link
Contributor

jsantell commented Aug 4, 2014

That sounds fine -- we can just not delete things in tmp in jpm and let the OS handle it

@zombie
Copy link

zombie commented Aug 4, 2014

i don't think that's a good idea, afaik there is no automatic purging of temp dir on windows by default..

@saadtazi
Copy link

saadtazi commented Aug 9, 2014

firefox-profile 0.3.1 now allows you to specify the destination directory (so it no longer uses the tmp folder). I hope it can help fixing this issue.

@saadtazi
Copy link

saadtazi commented Sep 8, 2014

I just published v0.3.4 with @XrXr fix.

@erikvold erikvold added this to the First release milestone Oct 9, 2014
@erikvold erikvold removed this from the First release milestone Dec 16, 2014
@erikvold
Copy link
Contributor

This is resolved afaict, please re-open if that is not the case.

Thanks for working on this @XrXr !

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
5 participants