<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<atom:link href="https://dev1galaxy.org/extern.php?action=feed&amp;tid=5100&amp;type=rss" rel="self" type="application/rss+xml" />
		<title><![CDATA[Dev1 Galaxy Forum / Running a privileged command at login.]]></title>
		<link>https://dev1galaxy.org/viewtopic.php?id=5100</link>
		<description><![CDATA[The most recent posts in Running a privileged command at login..]]></description>
		<lastBuildDate>Mon, 27 Jun 2022 23:46:50 +0000</lastBuildDate>
		<generator>FluxBB</generator>
		<item>
			<title><![CDATA[Re: Running a privileged command at login.]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=36462#p36462</link>
			<description><![CDATA[<p>Interestingly invocation section of man page of bash dont refer to profile.d .<br />So maybe it started as a distro practice that stuck&#160; and now it&#039;s used a a global config-set up space ?<br />I found an interesting discussion <a href="https://unix.stackexchange.com/questions/64258/what-do-the-scripts-in-etc-profile-d-do" rel="nofollow">here</a>.</p><p>It seems that profile.d is used in some distros that use some shells that parse that folder for application specifics setups.</p><p>In my devuan installation: </p><p>/etc/profile.d$ ls<br />bash_completion.sh&#160; &#160; &#160; &#160;flatpak.sh&#160; gawk.sh&#160; &#160; &#160; vte.csh&#160; gawk.csh&#160; &#160; vte-2.91.sh</p><p>But that wont work in a case like mine but only if libvirtd was reading some shell enviroment<br />variable to determine what net setup to enable when started.</p><p>So i guess profile.d is one way to setup an &#039;enviroment&#039; for applications that would look to certain env variables.<br />If an app looks only to a config file profile.d it&#039;s not needed.</p><p>In my case i found first <a href="https://www.xmodulo.com/network-default-is-not-active.html" rel="nofollow">here</a>&#160; about a command that fixes<br />a network error in virt-manager. Now as @xinomilo told me that can be set either with a terminal command or a gui setting&#160; &#160;that changes a relative setting.</p><p>I propably was unlucky finding only the first &#039;solution&#039;&#160; that make me understand that a command fixes an error . But now it seems it&#039;s just an application<br />setting that propably sitting in a config file and there are two ways to change that &#039;file&#039; and propably to edit it by a text editor.<br />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 &#039;config&#039; mentality.</p><p>To sum it up. It was a setting issue masqueraded as a&#160; pseudo &#039;correct functioning&#039; issue.</p>]]></description>
			<author><![CDATA[dummy@example.com (chomwitt)]]></author>
			<pubDate>Mon, 27 Jun 2022 23:46:50 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=36462#p36462</guid>
		</item>
		<item>
			<title><![CDATA[Re: Running a privileged command at login.]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=36461#p36461</link>
			<description><![CDATA[<div class="quotebox"><cite>xinomilo wrote:</cite><blockquote><div><div class="quotebox"><cite>chomwitt wrote:</cite><blockquote><div><p>From where ? From general options or a VM options ? I didnt find anything.</p></div></blockquote></div><p>Connection Options. <br />if you already connected virt-manager to local libvirtd : choose that (qemu:///system) connection and :<br />(menu) Edit -&gt; Connection Details -&gt; Virtual Networks tab -&gt; choose network, and check &quot;Autostart On Boot&quot;&#160; on network Details.</p></div></blockquote></div><p>I found it. Thanks!</p>]]></description>
			<author><![CDATA[dummy@example.com (chomwitt)]]></author>
			<pubDate>Mon, 27 Jun 2022 18:02:59 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=36461#p36461</guid>
		</item>
		<item>
			<title><![CDATA[Re: Running a privileged command at login.]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=36460#p36460</link>
			<description><![CDATA[<div class="quotebox"><cite>chomwitt wrote:</cite><blockquote><div><p>From where ? From general options or a VM options ? I didnt find anything.</p></div></blockquote></div><p>Connection Options. <br />if you already connected virt-manager to local libvirtd : choose that (qemu:///system) connection and :<br />(menu) Edit -&gt; Connection Details -&gt; Virtual Networks tab -&gt; choose network, and check &quot;Autostart On Boot&quot;&#160; on network Details.</p>]]></description>
			<author><![CDATA[dummy@example.com (xinomilo)]]></author>
			<pubDate>Mon, 27 Jun 2022 17:58:05 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=36460#p36460</guid>
		</item>
		<item>
			<title><![CDATA[Re: Running a privileged command at login.]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=36459#p36459</link>
			<description><![CDATA[<p>Reading here <a href="https://www.linuxfromscratch.org/blfs/view/11.0/postlfs/profile.html" rel="nofollow">https://www.linuxfromscratch.org/blfs/v … ofile.html</a><br />it seems that profile.d is for scripts that set up the shell enviroments.<br />So if i wanted to setup an application and it&#039;s initial set up i should do it from somewhere else.<br />But i&#039;ve just read an askubuntu <a href="https://askubuntu.com/questions/1090641/run-etc-profile-d-script-sh-as-root" rel="nofollow">post</a> where network config is attempted from a profile.d script.</p>]]></description>
			<author><![CDATA[dummy@example.com (chomwitt)]]></author>
			<pubDate>Mon, 27 Jun 2022 17:57:44 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=36459#p36459</guid>
		</item>
		<item>
			<title><![CDATA[Re: Running a privileged command at login.]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=36458#p36458</link>
			<description><![CDATA[<div class="quotebox"><cite>xinomilo wrote:</cite><blockquote><div><p>.. (you can also change this from virt-manager/GUI).</p></div></blockquote></div><p>From where ? From general options or a VM options ? I didnt find anything.</p>]]></description>
			<author><![CDATA[dummy@example.com (chomwitt)]]></author>
			<pubDate>Mon, 27 Jun 2022 17:49:15 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=36458#p36458</guid>
		</item>
		<item>
			<title><![CDATA[Re: Running a privileged command at login.]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=36457#p36457</link>
			<description><![CDATA[<div class="quotebox"><cite>Head_on_a_Stick wrote:</cite><blockquote><div><div class="quotebox"><cite>Head_on_a_Stick wrote:</cite><blockquote><div><p>Was the script executable?</p></div></blockquote></div><p>Sorry, that was a stupid question. Files in /etc/profile.d/ are sourced rather than executed. D&#039;oh!</p></div></blockquote></div><p>That explains why other scripts in profile.d werent executable.</p><p>Generaly i realized that profile.d is for preparing the system wide enviroment (of bash only or more generally ?)<br />So a more sound approach would be to start libvirtd and then make sure the default networking is enabled .</p>]]></description>
			<author><![CDATA[dummy@example.com (chomwitt)]]></author>
			<pubDate>Mon, 27 Jun 2022 17:43:05 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=36457#p36457</guid>
		</item>
		<item>
			<title><![CDATA[Re: Running a privileged command at login.]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=36455#p36455</link>
			<description><![CDATA[<div class="quotebox"><cite>Head_on_a_Stick wrote:</cite><blockquote><div><p>Was the script executable?</p></div></blockquote></div><p>Sorry, that was a stupid question. Files in /etc/profile.d/ are sourced rather than executed. D&#039;oh!</p>]]></description>
			<author><![CDATA[dummy@example.com (Head_on_a_Stick)]]></author>
			<pubDate>Mon, 27 Jun 2022 17:12:32 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=36455#p36455</guid>
		</item>
		<item>
			<title><![CDATA[Re: Running a privileged command at login.]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=36454#p36454</link>
			<description><![CDATA[<div class="quotebox"><cite>xinomilo wrote:</cite><blockquote><div><p>virsh is a libvirt client, so yes, libvirtd must be started in order for virsh to work.. <br />although this <a href="https://dev1galaxy.org/viewtopic.php?pid=36441#p36441" rel="nofollow">https://dev1galaxy.org/viewtopic.php?pid=36441#p36441</a> makes your command unnecessary.. (you can also change this from virt-manager/GUI).</p></div></blockquote></div><p>Yes i understand that. But i was curious to see if indeed a &#039;root&#039; command can be executed in profile.d<br />So i could make the script wait and poll the processes and when libvirt is executed then to execute the command!</p>]]></description>
			<author><![CDATA[dummy@example.com (chomwitt)]]></author>
			<pubDate>Mon, 27 Jun 2022 16:17:01 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=36454#p36454</guid>
		</item>
		<item>
			<title><![CDATA[Re: Running a privileged command at login.]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=36453#p36453</link>
			<description><![CDATA[<p>virsh is a libvirt client, so yes, libvirtd must be started in order for virsh to work.. <br />although this <a href="https://dev1galaxy.org/viewtopic.php?pid=36441#p36441" rel="nofollow">https://dev1galaxy.org/viewtopic.php?pid=36441#p36441</a> makes your command unnecessary.. (you can also change this from virt-manager/GUI).</p>]]></description>
			<author><![CDATA[dummy@example.com (xinomilo)]]></author>
			<pubDate>Mon, 27 Jun 2022 14:08:48 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=36453#p36453</guid>
		</item>
		<item>
			<title><![CDATA[Re: Running a privileged command at login.]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=36452#p36452</link>
			<description><![CDATA[<p>I made it executable but still nothing. </p><div class="quotebox"><blockquote><div><p>#!/bin/sh</p><p>export TESTPROFILEDOTD=1970<br />virsh net-start default&#160; &#160;&amp;</p></div></blockquote></div><p>The test var is changed but not the net default state.<br />I suspect that virt-manager and libvirtd process must have started first.</p>]]></description>
			<author><![CDATA[dummy@example.com (chomwitt)]]></author>
			<pubDate>Mon, 27 Jun 2022 14:03:09 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=36452#p36452</guid>
		</item>
		<item>
			<title><![CDATA[Re: Running a privileged command at login.]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=36444#p36444</link>
			<description><![CDATA[<p>Was the script executable?</p>]]></description>
			<author><![CDATA[dummy@example.com (Head_on_a_Stick)]]></author>
			<pubDate>Sun, 26 Jun 2022 17:54:57 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=36444#p36444</guid>
		</item>
		<item>
			<title><![CDATA[Re: Running a privileged command at login.]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=36443#p36443</link>
			<description><![CDATA[<p>@Head_on_a_Stick Thanks! that worked.<br />I wonder why thought the script in /etc/profile.d/enableqemunetworking.sh&#160; didnt seem to work.</p>]]></description>
			<author><![CDATA[dummy@example.com (chomwitt)]]></author>
			<pubDate>Sun, 26 Jun 2022 17:47:33 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=36443#p36443</guid>
		</item>
		<item>
			<title><![CDATA[Re: Running a privileged command at login.]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=36441#p36441</link>
			<description><![CDATA[<p>The command can be added to /etc/rc.local but that feels hacky af.</p><p>Have you tried</p><div class="codebox"><pre><code># virsh net-autostart default</code></pre></div><p>^ I think that should enable it to auto start without having to run your command.</p><p>Reference: <a href="https://libvirt.org/sources/virshcmdref/html/sect-net-autostart.html" rel="nofollow">https://libvirt.org/sources/virshcmdref … start.html</a></p>]]></description>
			<author><![CDATA[dummy@example.com (Head_on_a_Stick)]]></author>
			<pubDate>Sun, 26 Jun 2022 17:28:08 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=36441#p36441</guid>
		</item>
		<item>
			<title><![CDATA[Re: Running a privileged command at login.]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=36439#p36439</link>
			<description><![CDATA[<div class="quotebox"><cite>MiyoLinux wrote:</cite><blockquote><div><p>Are you familiar with cron jobs? That&#039;s one way to do it. <img src="https://dev1galaxy.org/img/smilies/smile.png" width="15" height="15" alt="smile" /></p></div></blockquote></div><p>I know it&#039;s purpose, not familiar but i&#039;ll manage. </p><p>I tried that so far:</p><p>$ less /etc/profile.d/enableqemunetworking.sh<br />#!/bin/sh<br />virsh net-start default&#160; &#160;&amp;</p><p>but didnt work..<br />@HeadonStick i try to enable qemu networking but the command only works with sudo.</p>]]></description>
			<author><![CDATA[dummy@example.com (chomwitt)]]></author>
			<pubDate>Sun, 26 Jun 2022 17:16:01 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=36439#p36439</guid>
		</item>
		<item>
			<title><![CDATA[Re: Running a privileged command at login.]]></title>
			<link>https://dev1galaxy.org/viewtopic.php?pid=36438#p36438</link>
			<description><![CDATA[<div class="quotebox"><cite>chomwitt wrote:</cite><blockquote><div><p>I want to run a &#039;sudo&#039; command at login.</p></div></blockquote></div><p>Why do you want to do that? What are you trying to achieve?</p><p>See also <a href="https://xyproblem.info/" rel="nofollow">https://xyproblem.info/</a></p>]]></description>
			<author><![CDATA[dummy@example.com (Head_on_a_Stick)]]></author>
			<pubDate>Sun, 26 Jun 2022 17:12:02 +0000</pubDate>
			<guid>https://dev1galaxy.org/viewtopic.php?pid=36438#p36438</guid>
		</item>
	</channel>
</rss>
