Code: Select all
sudo virsh net-start default
Code: Select all
virsh net-autostart default
So I want it to autostart with a delay.
Code: Select all
sudo virsh net-start default
Code: Select all
virsh net-autostart default
Code: Select all
/usr/bin/virsh
Code: Select all
#!/bin/bash
sleep 8 && sudo virsh net-start default
Thanks for this.shmu26 wrote: Thu Jan 25, 2024 3:20 am 4 steps:
1 allow this processto run as root without password prompt as described here:Code: Select all
/usr/bin/virsh
https://askubuntu.com/questions/159007/ ... a-password
Don't forget to write in the sudoers file the full path of the process: /usr/bin/virsh
But you don't write the command, just the process with path.
2 Create a startup script:3 Set the script to be executableCode: Select all
#!/bin/bash sleep 8 && sudo virsh net-start default
4 Set the script to run at login:
System settings/Startup and shutdown/Autostart/Add/Add login script
sudo is meant to run a program as root. You typically run a program as root because it's necessary to make some kind of change to the system or use a low-level system resource, like a reserved port. If you don't want java running as root, don't use sudo.RedSnt wrote: Wed Feb 07, 2024 7:46 am I wish one could restrict the use of this further, or done in another way, because I had to run a java application on startup that I've installed in /opt/, and giving java nopasswd sudo access seems risky.
Thanks for the firejail recommendation, I'll look into that. Luckily dolphin_oracle's recommendation works fine for me, and instead of launching the application in a terminal after KDE has launched, I'm just using "tail -f file.log" which is good enough for my use case.DukeComposed wrote: Wed Feb 07, 2024 8:06 amsudo is meant to run a program as root. You typically run a program as root because it's necessary to make some kind of change to the system or use a low-level system resource, like a reserved port. If you don't want java running as root, don't use sudo.RedSnt wrote: Wed Feb 07, 2024 7:46 am I wish one could restrict the use of this further, or done in another way, because I had to run a java application on startup that I've installed in /opt/, and giving java nopasswd sudo access seems risky.
Otherwise, consider running the java process with something like firejail, which allows you to restrict the resources it can access. This creates a chicken and egg problem, because you need to run firejail with elevated permissions in order for it be able to take those permissions away from another root process.