Writing rc.local as different user

Hello there.
I am creating a searx instance for my local use in an AppVM. I am able to do that with online documentation. But after restart I have to type atleast following 3 commands to get it running-

sudo -H -u searx -i
cd /usr/local/searx/searx-src
python3 searx/webapp.py

And after all this it works. I want to pass these arguments into rc.local so I don’t have to do that manually. Is there any way to do that.
Any help appreciated. I am not from Linux background. Thank you.

Hi @mebraska

AppVMs get their root filesystem from another qube (from TermplateVM), Fedora (or Debian), by default. So whenever you want to introduce changes into the root filesystem (including installing something or doing something with sudo) you have to do it in the corresponding template. After that you will have to shutdown the TemplateVM and reboot the AppVM. This is how Qubes’ isolation works.

More details:

Does putting this in /rw/config/rc.local work?

sudo -H -u searx -i bash -c 'cd /usr/local/searx/searx-src && python3 searx/webapp.py'

Might be better to create a systemd unit.

1 Like