views:

300

answers:

3

We have an xulrunner application that is running as a background html to pdf converter. This is essentially a commandline application and shows no user interface. However, xulrunner defaults to trying to share profiles and instances of the application. How can we run multiple instances of the application concurrently without hitting profile locking etc?

A: 

There is a forum posting here that refers to using the --disable-single-profile option (amongst others) for a similar purpose (running mozilla2ps):

Works like a charm most of the time, but when two documents are converted at the same time xulrunner complains that another window is still running. I have to prevent this. With the old mozilla suite this behaviour could be prevented with these options:

ac_add_options --disable-single-profile
ac_add_options --enable-profilesharing
ac_add_options --disable-profilelocking

These options are also supported by xulrunner, but xulrunner won't compile with the --disable-single-profile option. Does anybody know more about this problem? Or is there another way to let xulrunner ignore already running xulrunner processes and just start a new process instead?

Unfortunately I tested this and although xulrunner now compiles with that set of options, it still seemed to generate the sharing errors (I may be missing something here)

David Fraser
A: 

What seems to work (although it's slow and fairly wasteful) is to create a new profile for each invocation, and clean it up after termination: xulrunner -profile $tempdir -no-remote application.ini ... rm -fr $tempdir

David Fraser
A: 

If your application doesn't need any UI (just XPCom), I strongly encourage you to play with xpcshell (build your own XulRunner to have this executable).

For several instance of XulRunner, export MOZ_NO_REMOTE=1.

Paul Rouget
Thanks for the useful info, but although it doesn't display the UI it does actually need it, it is rendering html to pdf using a web browser, but it keeps it hidden.MOZ_NO_REMOTE=1 still has issues with profile locking as far as I can see
David Fraser