You are not logged in.

#1 2012-08-28 08:44:42

Wasser
Member
Registered: 2011-07-06
Posts: 23

[SOLVED] systemd: create a service file that loads a kernel module

Hi, I have a daemon that I want to convert to a service unit of systemd.

The daemon tests if a module is loaded, and if not, modprobes it.

I do not want to load that module at boot up, only if the service is launched.

Is there a "proper" way to add something like RequiredModule=xxx to a service unit?


Thanks!

Last edited by Wasser (2012-09-03 08:58:02)

Offline

#2 2012-08-28 08:52:24

progandy
Member
Registered: 2012-05-17
Posts: 5,322

Re: [SOLVED] systemd: create a service file that loads a kernel module

Maybe simply run modprobe with ExecStartPre. The command succeeds even if the module was already loaded.


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' | alias ENGLISH='LANG=C.UTF-8 ' |

Offline

#3 2012-09-03 08:58:17

Wasser
Member
Registered: 2011-07-06
Posts: 23

Re: [SOLVED] systemd: create a service file that loads a kernel module

That works for me, thanks!

Offline

#4 2012-09-03 16:19:15

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,111
Website

Re: [SOLVED] systemd: create a service file that loads a kernel module

Or just use modules-load.d.

Offline

Board footer

Powered by FluxBB