I guess i would uses so custom logic to do this..<br><br>Thanks Kay for the help.<br><br>Pawel<br><br><div class="gmail_quote">On Mon, Mar 19, 2012 at 11:12 AM, Kay Sievers <span dir="ltr">&lt;<a href="mailto:kay@vrfy.org">kay@vrfy.org</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On Mon, Mar 19, 2012 at 16:02, Pawel Pastuszak &lt;<a href="mailto:pawelpastuszak@gmail.com">pawelpastuszak@gmail.com</a>&gt; wrote:<br>

&gt; I am not sure if i made my self clear, what i am doing is and custom distro<br>
&gt; for an custom embedded device, which i want to have the ability to upgrade<br>
&gt; the system in runtime, which i need to ability to to stop my custom driver<br>
&gt; modules for the upgrade. So this is why i was asking what is the best way of<br>
&gt; starting and stop modules.<br>
&gt;<br>
&gt; Unless what your saying is replace the file and just reboot, instead of stop<br>
&gt; the service and replace then start it again.<br>
<br>
</div>Oh, there is no general advice in the systemd context, I guess. It&#39;s<br>
also not systemd specific, and mostly handled inside the kernel. As<br>
mentioned, we generally do not support at all any kernel-module<br>
unloading with systemd-native infrastructure, but that should be no<br>
reason for custom logic inside a service to do that.<br>
<br>
Usually you need to stop the service/application using the device, and<br>
then you can unload the driver module. Most modules can only be<br>
unloaded when they are not in use. The most common exception is<br>
network driver modules, which for historic reasons do not pin the<br>
modules in use. This can either be managed by completely stopping and<br>
restarting the service, or by sending specific commands to a service<br>
to release the open()ed devices.<br>
<br>
Alternatively, if the service/app can handle hot-device removal, you<br>
can just unbind the driver from the device in<br>
/sys/bus/*/drivers/*/{bind,unbind}, and after that unload the module.<br>
But the service/app needs to be able to cope with devices<br>
disappearing; many services/apps don&#39;t.<br>
<font color="#888888"><br>
Kay<br>
</font></blockquote></div><br>