overthesun / simoc-sam

Live backend for SAM at Biosphere 2
2 stars 1 forks source link

Make the `sam` alias work with `sudo` #108

Closed ezio-melotti closed 3 weeks ago

ezio-melotti commented 3 months ago

Some of the simoc-sam.py commands require root credential. simoc-sam.py is generally invoked through the sam alias, but it's not possible to use sudo with aliases, so sudo sam ... fails. There are a couple of solutions for this:

  1. Convert sam to an executable and make it globally available;
  2. Request the sudo password in the @needs_root decorator and use it to gain root credential before executing other commands (if possible);