overthesun / simoc-sam

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

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

Open ezio-melotti opened 2 months ago

ezio-melotti commented 2 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);