You are not logged in.

#1 2015-04-06 13:24:11

Sanjeev K Sharma
Member
Registered: 2013-08-14
Posts: 72

please critique a netconsole systemd unit file

I put netconsole in /etc/modules-load.d/netconsole.conf, like so:


$ cat /etc/modules-load.d/netconsole.conf 
netconsole

and I get this:

Apr 06 08:52:29 sam systemd-modules-load[214]: Failed to insert 'netconsole': No such device

here's my proposal to get the module loaded after the network comes up

$cat ~/doing/netconsole.service 

[Unit]
Description=kernel kmsg to network
Description=netconsole 
#Requires=network.target
Wants=network.target

[Service]
ExecStart=-/usr/bin/modprobe netconsole

[Install]
WantedBy=multi-user.target

and the module itself (using the entry that has mostly defaults)

$cat /etc/modprobe.d/netconsole 

#options netconsole netconsole=@/enp0s10,@192.168.12.101/72:d0:2f:20:f5:81
#options netconsole netconsole=6665@192.168.12.51/enp0s10,6666@192.168.12.101/74:d9:2b:29:f5:81
options netconsole netconsole=@192.168.12.101/eno1,@192.168.12.51/00:01:21:d9:10:2c

Last edited by Sanjeev K Sharma (2015-04-06 13:28:03)

Offline

#2 2015-04-06 14:49:18

berbae
Member
From: France
Registered: 2007-02-12
Posts: 1,304

Re: please critique a netconsole systemd unit file

Sanjeev K Sharma wrote:

to get the module loaded after the network comes up

You need:

[Unit]
Description=kernel kmsg to network
Description=netconsole 
Requires=network.target
After=network.target

[Service]
ExecStart=-/usr/bin/modprobe netconsole

[Install]
WantedBy=multi-user.target

You need to put this netconsole.service in '/etc/systemd/system', and enable it with:
# systemctl enable netconsole.service.

But are you sure the 'Failed to insert 'netconsole': No such device' is due to the module not loaded after the network is up and running?
Because the systemd-modules-load.service is just to do this sort of thing, as you have first try it.

You could also use a kernel command line parameter: see https://wiki.archlinux.org/index.php/Netconsole

Offline

#3 2015-04-06 23:16:09

Sanjeev K Sharma
Member
Registered: 2013-08-14
Posts: 72

Re: please critique a netconsole systemd unit file

berbae wrote:

are you sure the 'Failed to insert 'netconsole': No such device' is due to the module not loaded after the network is up and running?
Because the systemd-modules-load.service is just to do this sort of thing, as you have first try it.

I cannot be 100 % sure but there's no other device involved ...

berbae wrote:

You could also use a kernel command line parameter: see https://wiki.archlinux.org/index.php/Netconsole


I could not get it to work. 

I cannot get that set of parameters to work outside the kernel command either, with post-boot modprobe: Arch's current kernel does not seem to like identical ports on both sides.

I'll ask permission to update the wiki with my experience.

Offline

Board footer

Powered by FluxBB