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?
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)
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
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.