Comment 72 for bug 1643706

Revision history for this message
RichardNeill (ubuntu-richardneill) wrote :

How do you handle this when the user running the snap application is actually a daemon?

I've got a webservice, where one of the tasks is for Apache/PHP to invoke firefox --screenshot.
[This is the only way to get openstreetmap to give you a .png]
It's now impossible, because snap won't let you use your own choice of $HOME.
But Systemd won't let Apache use /home either.

For reference, the code required is:

home=/tmp/my_app_firefox_home #"/tmp" is really inside systemd's private tmp for apache.
mkdir $home
export HOME=$home
timeout 60 xvfb-run -a flock -w 50 $home firefox --screenshot $home/outfile.png $url

Given that every one of the browser-automation tools like phantomjs, casperjs, slimerjs, and wkhtmltopdf is now defunct, how exactly are we supposed to do this task?

This is a simple PHP script; it shouldn't need to create a dedicated user, or do system-level hacks with bind mounts.