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"><<a href="mailto:kay@vrfy.org">kay@vrfy.org</a>></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 <<a href="mailto:pawelpastuszak@gmail.com">pawelpastuszak@gmail.com</a>> wrote:<br>
> I am not sure if i made my self clear, what i am doing is and custom distro<br>
> for an custom embedded device, which i want to have the ability to upgrade<br>
> the system in runtime, which i need to ability to to stop my custom driver<br>
> modules for the upgrade. So this is why i was asking what is the best way of<br>
> starting and stop modules.<br>
><br>
> Unless what your saying is replace the file and just reboot, instead of stop<br>
> the service and replace then start it again.<br>
<br>
</div>Oh, there is no general advice in the systemd context, I guess. It'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't.<br>
<font color="#888888"><br>
Kay<br>
</font></blockquote></div><br>