How to share tmpfs location among multiple apps?

I have a ‘legacy’ app I need to run on a Legato system, and this app currently needs to write a file to /tmp (essentially doing the equivalent of the shell command touch /tmp/shutting-down). Actually, it’s not so important that the file be located in /tmp, the only requirements are:

  1. The file should not persist across reboots of the device, and:
  2. It should be possible for other applications to detect the existence of this file

We have a fairly complex build system that already contains some CMake functions my colleages wrote to create the required .adef files for our legacy apps. The resulting .adef file for my app contains this block:


         /proc /
         [rwx] /tmp /

Unfortunately, it doesn’t quite work for my needs, because the file winds up being written to /legato/systems/current/appsWriteable/parentApp/tmp/shutting-down, and I’m not sure how to make this location readable by other apps.

Can somebody give me a clue how to make this work, or point me to some example code that demonstrates how a tmpfs location can be shared between two different apps? Thanks!

UPDATE – Some more (possibly) relevant details: I probably should have mentioned that my app, as well as the other applications that need to access the tmp file written by my app, are all ‘child’ apps under the same ‘parent’ app. (Apologies if these aren’t the correct terms, this is just how it appears to me as a Legato n00b.)

The fact that my app’s tmp file showed up under /legato/systems/current/appsWriteable/parentApp/tmp/shutting-down—and not /legato/systems/current/appsWriteable/myApp/tmp/shutting-down (as I originally reported!)—makes me hopeful that this location might also be readable by my app’s ‘sibling’ apps if I simply include the same dir block as above? Maybe?

Unfortunately, I lent my hardware setup to a colleague and won’t be able to test this myself for a couple of days. If somebody reading this understands the context well enough to tell me before then that it’s a doomed exercise, I would be very much obliged! :pray:

I think the easiest way is to unsandboxed those two apps

Hmm. I’m afraid my colleagues won’t like that much. What are the ‘not so easy’ alternatives? When I look around in the bowels of our source tree, I see some setup scripts (for the overall system) that execute a few variations of this command (either on startup, or at install time, I’m not sure which):

/legato/systems/current/bin/xattr set security.SMACK64 "*" ${aperture_inc_config_path}

Is this a possible solution, perhaps? Can somebody explain what this means, or point me to some documentation?

Please have a look below.
One method is to use IPC communication.