sandlock learn - howto
Hello, how should one use "learn" feature? I mean I can't run any GUI app, and simple terminal programs like htop or mc are broken with it, since it seems I can't pass any 'run' arguments to it. Can you provide some examples (I'm too dumb I think for this) to see what should it like to be at all?
A few things:
Passing arguments works. Everything after -- goes to the program:
sandlock learn -o profile.toml -- htop -d 50
If args aren't landing for you, please paste the exact command you ran.
htop/mc aren't broken, they just never exit. sandlock learn only writes the profile when the observed process terminates. Interactive TUIs run until you quit them, so learn looks stuck and emits nothing.
Fix: quit the app normally or use --timeout to auto-stop with a partial profile:
sandlock learn --timeout 6 -o htop.toml -- htop
sandlock run --profile-file htop.toml -- htop
GUI apps: not currently supported by learn.
I meant sandlock run arguments, so I can tune environment and reduce restrictions, like (broad example) sandlock run -r / -- mc. For now sandlock learn -- mc makes mc unusable after start. Maybe it should though, because learn was not planned for that sort of apps, it's not clear for me now.
GUI apps: not currently supported by learn.
Got it
Thanks for the report. I think it exposes a deeper problem: we didn't handle devices files correctly in COW and learn, so I created PR #210 .
Regarding the doc, please check out https://sandlock.io/docs/profiles.html