solo-io / bumblebee

Get eBPF programs running from the cloud to the kernel in 1 line of bash
Apache License 2.0
1.27k stars 78 forks source link

Docs issue with `setcap` #61

Closed lgadban closed 2 years ago

lgadban commented 2 years ago

Version

n/a

Linux Version

Linux 5.4.0-1060-gcp #64~18.04.1-Ubuntu SMP Fri Jan 7 04:02:54 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

Describe the bug

setcap on README doesn't work correctly

Steps to reproduce the bug

$ sudo setcap cap_sys_resource,cap_sys_admin,cap_bpf+eip $(which bee)
fatal error: Invalid argument
usage: setcap [-q] [-v] (-r|-|<caps>) <filename> [ ... (-r|-|<capsN>) <filenameN> ]

 Note <filename> must be a regular (non-symlink) file.

Expected Behavior

need to doc correct way to setcap on a default ubuntu 18.04 LTS (this example from GCP)

Additional Context

No response

tnorlin commented 2 years ago

Terminal/shell issue? Enclosing in quotation marks (due to '+')? At least below works on Fedora 33 and Ubuntu 21.04

$ sudo setcap "cap_sys_resource,cap_sys_admin+eip" $(which bee)

lgadban commented 2 years ago

Unfortunately that doesn't seem to be the problem on the machine I was testing on:

$ sudo setcap "cap_sys_resource,cap_sys_admin,cap_bpf+eip" ~/.bumblebee/bin/bee
fatal error: Invalid argument
usage: setcap [-q] [-v] (-r|-|<caps>) <filename> [ ... (-r|-|<capsN>) <filenameN> ]

 Note <filename> must be a regular (non-symlink) file.
$ sudo setcap "cap_sys_resource,cap_sys_admin,cap_bpf+eip" $(which bee)
fatal error: Invalid argument
usage: setcap [-q] [-v] (-r|-|<caps>) <filename> [ ... (-r|-|<capsN>) <filenameN> ]

 Note <filename> must be a regular (non-symlink) file.
lgadban commented 2 years ago

CAP_BPF is a relatively recent capability and when it is missing attempting to add it will result in the Invalid argument error. To prevent getting started issues, going to opt for documenting more permissive caps but call out that this can be more specific.