unikraft / pykraft

Python library for configuring and building unikernels
Other
177 stars 42 forks source link

Support doas as an alternative to sudo #110

Open tonyyzy opened 2 years ago

tonyyzy commented 2 years ago

Is your feature request related to a problem? Please describe. qemu-guest only supports sudo as a way of running with root privilege. Would be good if doas is supported too.

Describe the solution you'd like qemu-guest runs when doas is installed.

Add another conditional here: https://github.com/unikraft/kraft/blob/b9893d7df365f5eb77d9a5e95bfc095cc90c6330/scripts/qemu-guest#L356-L368

Describe alternatives you've considered both doas kraft run and sudo kraft run fail due to

Traceback (most recent call last):
  File "/home/tony/.local/bin/kraft", line 33, in <module>
    sys.exit(load_entry_point('kraft==0.5.0.dev491', 'console_scripts', 'kraft')())
  File "/home/tony/.local/bin/kraft", line 22, in importlib_load_entry_point
    for entry_point in distribution(dist_name).entry_points
  File "/usr/lib/python3.10/importlib/metadata/__init__.py", line 957, in distribution
    return Distribution.from_name(distribution_name)
  File "/usr/lib/python3.10/importlib/metadata/__init__.py", line 548, in from_name
    raise PackageNotFoundError(name)
importlib.metadata.PackageNotFoundError: No package metadata was found for kraft