Deleting ~/QubesIncoming on Shutdown

I would like to run a script on shutdown that deletes the contents of /home/user/QubesIncoming, I have tried some systemd ideas as this centos - kick off a systemd service just before shutdown - Unix & Linux Stack Exchange and linux - How to run a script with systemd right before shutdown? - Unix & Linux Stack Exchange but neither have worked. Any ideas on how to do this?

1 Like

Hi @oli. Welcome! I have renamed the title to your ultimate goal. Creating a script is just a path to reach that. There may be a better way other than a script. But feel free to revert it if you disagree.

This is also a question that interests me.

1 Like

Cleanest approach I think is to just replace ~/QubesIncoming with a symlink pointing to a directory on the root image. For example /var/tmp/QubesIncoming.

If you create an empty /var/tmp/QubesIncoming on the template, then no scripting is required. Or you can have the AppVM’s rc.local create an empty /var/tmp/QubesIncoming on startup.