You are not logged in.
Pages: 1
I'm using Devuan GNU/Linux 5 with runit.
I want to run a 'sudo' command at login. I guess it needs to be
started as a root command without having to provide a password.
How could i do that?
Last edited by chomwitt (2022-06-26 16:50:55)
Devuan(Chimaera)(Daedalus) DS+WM: XorgX11server+StumpVM
Offline
Are you familiar with cron jobs? That's one way to do it.
I have been Devuanated, and my practice in the art of Devuanism shall continue until my Devuanization is complete. Until then, I will strive to continue in my understanding of Devuanchology, Devuanprocity, and Devuanivity.
Veni, vidi, vici vdevuaned. I came, I saw, I Devuaned.
Offline
I want to run a 'sudo' command at login.
Why do you want to do that? What are you trying to achieve?
See also https://xyproblem.info/
Brianna Ghey — Rest In Power
Offline
Are you familiar with cron jobs? That's one way to do it.
I know it's purpose, not familiar but i'll manage.
I tried that so far:
$ less /etc/profile.d/enableqemunetworking.sh
#!/bin/sh
virsh net-start default &
but didnt work..
@HeadonStick i try to enable qemu networking but the command only works with sudo.
Last edited by chomwitt (2022-06-26 17:18:00)
Devuan(Chimaera)(Daedalus) DS+WM: XorgX11server+StumpVM
Offline
The command can be added to /etc/rc.local but that feels hacky af.
Have you tried
# virsh net-autostart default
^ I think that should enable it to auto start without having to run your command.
Reference: https://libvirt.org/sources/virshcmdref … start.html
Brianna Ghey — Rest In Power
Offline
@Head_on_a_Stick Thanks! that worked.
I wonder why thought the script in /etc/profile.d/enableqemunetworking.sh didnt seem to work.
Devuan(Chimaera)(Daedalus) DS+WM: XorgX11server+StumpVM
Offline
Was the script executable?
Brianna Ghey — Rest In Power
Offline
I made it executable but still nothing.
#!/bin/sh
export TESTPROFILEDOTD=1970
virsh net-start default &
The test var is changed but not the net default state.
I suspect that virt-manager and libvirtd process must have started first.
Devuan(Chimaera)(Daedalus) DS+WM: XorgX11server+StumpVM
Offline
virsh is a libvirt client, so yes, libvirtd must be started in order for virsh to work..
although this https://dev1galaxy.org/viewtopic.php?pid=36441#p36441 makes your command unnecessary.. (you can also change this from virt-manager/GUI).
Offline
virsh is a libvirt client, so yes, libvirtd must be started in order for virsh to work..
although this https://dev1galaxy.org/viewtopic.php?pid=36441#p36441 makes your command unnecessary.. (you can also change this from virt-manager/GUI).
Yes i understand that. But i was curious to see if indeed a 'root' command can be executed in profile.d
So i could make the script wait and poll the processes and when libvirt is executed then to execute the command!
Last edited by chomwitt (2022-06-27 17:39:03)
Devuan(Chimaera)(Daedalus) DS+WM: XorgX11server+StumpVM
Offline
Was the script executable?
Sorry, that was a stupid question. Files in /etc/profile.d/ are sourced rather than executed. D'oh!
Brianna Ghey — Rest In Power
Offline
Head_on_a_Stick wrote:Was the script executable?
Sorry, that was a stupid question. Files in /etc/profile.d/ are sourced rather than executed. D'oh!
That explains why other scripts in profile.d werent executable.
Generaly i realized that profile.d is for preparing the system wide enviroment (of bash only or more generally ?)
So a more sound approach would be to start libvirtd and then make sure the default networking is enabled .
Devuan(Chimaera)(Daedalus) DS+WM: XorgX11server+StumpVM
Offline
.. (you can also change this from virt-manager/GUI).
From where ? From general options or a VM options ? I didnt find anything.
Devuan(Chimaera)(Daedalus) DS+WM: XorgX11server+StumpVM
Offline
Reading here https://www.linuxfromscratch.org/blfs/v … ofile.html
it seems that profile.d is for scripts that set up the shell enviroments.
So if i wanted to setup an application and it's initial set up i should do it from somewhere else.
But i've just read an askubuntu post where network config is attempted from a profile.d script.
Last edited by chomwitt (2022-06-27 18:00:11)
Devuan(Chimaera)(Daedalus) DS+WM: XorgX11server+StumpVM
Offline
From where ? From general options or a VM options ? I didnt find anything.
Connection Options.
if you already connected virt-manager to local libvirtd : choose that (qemu:///system) connection and :
(menu) Edit -> Connection Details -> Virtual Networks tab -> choose network, and check "Autostart On Boot" on network Details.
Offline
chomwitt wrote:From where ? From general options or a VM options ? I didnt find anything.
Connection Options.
if you already connected virt-manager to local libvirtd : choose that (qemu:///system) connection and :
(menu) Edit -> Connection Details -> Virtual Networks tab -> choose network, and check "Autostart On Boot" on network Details.
I found it. Thanks!
Devuan(Chimaera)(Daedalus) DS+WM: XorgX11server+StumpVM
Offline
Interestingly invocation section of man page of bash dont refer to profile.d .
So maybe it started as a distro practice that stuck and now it's used a a global config-set up space ?
I found an interesting discussion here.
It seems that profile.d is used in some distros that use some shells that parse that folder for application specifics setups.
In my devuan installation:
/etc/profile.d$ ls
bash_completion.sh flatpak.sh gawk.sh vte.csh gawk.csh vte-2.91.sh
But that wont work in a case like mine but only if libvirtd was reading some shell enviroment
variable to determine what net setup to enable when started.
So i guess profile.d is one way to setup an 'enviroment' for applications that would look to certain env variables.
If an app looks only to a config file profile.d it's not needed.
In my case i found first here about a command that fixes
a network error in virt-manager. Now as @xinomilo told me that can be set either with a terminal command or a gui setting that changes a relative setting.
I propably was unlucky finding only the first 'solution' that make me understand that a command fixes an error . But now it seems it's just an application
setting that propably sitting in a config file and there are two ways to change that 'file' and propably to edit it by a text editor.
And maybe virt-manager shouldnt either report it as an error! That small detail could have put me into a different fix mentality and not in the 'config' mentality.
To sum it up. It was a setting issue masqueraded as a pseudo 'correct functioning' issue.
Last edited by chomwitt (2022-06-28 00:31:49)
Devuan(Chimaera)(Daedalus) DS+WM: XorgX11server+StumpVM
Offline
Pages: 1