2013/1/24 Larry Baker <[email protected]>: >... > Then it looks for evidence that the decnet kernel module is loaded by > testing for the file /proc/net/decnet. If necessary, it loads the decnet > kernel module and checks again for /proc/net/decnet. I have already built > the decnet kernel module and I can load it with modprobe. I do not wish to > force an unconditional load of the decnet kernel module using > /etc/modules-load.d/decnet.conf; I prefer the services that need it (dnetd > and phoned) trigger the load. However, I find no mention of the standard > systemd "load a kernel module" practice. I.e., there is no "systemd.module" > unit. What is the recommended method in the systemd framework to trigger a > unit that loads a kernel module? If the modprobe command fails, I presume > that will cause the systemd start command to fail. I would also like the > systemd start command to fail if /proc/net/decnet is not created (a sign > that the module has not initialized itself correctly). Is there a syntax in > a systemd unit for that as well?
I know this might not be the cleanest solution, but you could use ExecStartPre=/sbin/modprobe decnet ExecStartPre=/bin/test -e /proc/net/decnet in the decnet service file or create a [email protected] doing the modprobeing and make the decnet.service file like [Unit] Description=Decnet Daemon [email protected] [email protected] ConditionPathExists=/proc/net/decnet ConditionFileNotEmpty=/etc/decnet.conf [Service] #Do your stuff I am not an expert, neither am i god, these are just my 2c. Simon _______________________________________________ systemd-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/systemd-devel
