Skip to content

Hepler with system functions overrides inside a snap

License

Notifications You must be signed in to change notification settings

canonical/snap-preload

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

snap-preload

Helper library with system functions overrides inside a snap

Currently the library overrides the following functions:

  • initgroups and setgroups to no-op
  • shm_open and shm_unlink to prefix the name with snap.$SNAP_INSTANCE_NAME., as required by snaps
  • sem_open and sem_unlink, also fixes the names

Manual install

To build and install the library run

$ make
$ make install DESTDIR=/some/path

Run applications with the preload library.

The snap-preload.so library is intended to be used under LD_PRELOAD, e.g.

$ LD_PRELOAD=/usr/lib/snap-preload.so /usr/bin/myapp ...

Use in a snap

Add the following entries to snapcraft.yaml to include the library and automatically provide the preload to all applications in the snap

environment:
  LD_PRELOAD: $SNAP/usr/lib/snap-preload.so

apps:
  snap-preload:
    plugin: make
    source: https://github.com/canonical/snap-preload
    source-type: git

About

Hepler with system functions overrides inside a snap

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published