[systemd-devel] Netconsole NG

Zbigniew Jędrzejewski-Szmek zbyszek at in.waw.pl
Mon Apr 7 10:55:54 PDT 2014


On Mon, Apr 07, 2014 at 05:34:10PM +0200, Lukáš Nykrýn wrote:
> The reason why this was not rewritten a long time ago is that the
> initscript tries to figure some of those values by itself (for
> example the MAC address). But yes, we need to do something with
> netconsole. It is a blocker for my initscripts evil plan.
Doesn't netconsole figure out most of those settings by itself, and
others default to sensible values, so if the network card is up
and has an address configured, only the device and target ip must be given?

> Dne 6.4.2014 17:59, poma napsal(a):
> >
> >/etc/sysconfig/netconsole:
> ># This is the EnvironmentFile for the netconsole service. Starting this
> ># service enables the capture of dmesg output on a destination machine.
> >
> ># Source port
> >SRC_PORT=12345
This should default to empty... Kernel will pick something.

> >
> ># Source IP address
> >SRC_IP=192.168.1.2
This should default to empty... Kernel will use configured address,
since we order after network.target anyway.

> ># Source network device
> >SRC_DEV=enp1s2
Maybe this can be made into a instance argument?

> ># Destination port
> >DST_PORT=12345
I think this should default to 514/syslog, and can be left unset.

> ># Destination IP address
> >DST_IP=192.168.1.1
> >
> ># Destination ethernet address
> >DST_EHA=00:11:22:33:44:55
This should default to unset. The kernel will query it if not set.

> >/usr/lib/systemd/system/netconsole.service:
> >[Unit]
> >Description=Adds the netconsole module with the configured parameters
> >After=network.target
> >
> >[Service]
> >EnvironmentFile=/etc/sysconfig/netconsole
This is Fedora/RH specific. But I don't know what the proper path should
be, so maybe this is OK for now.

> >Type=simple
This is the default... No need to specify.

> >RemainAfterExit=yes
> >ExecStart=/usr/sbin/modprobe netconsole
This should be /sbin/modprobe for compatibility with split root.

> >netconsole=${SRC_PORT}@${SRC_IP}/${SRC_DEV},${DST_PORT}@${DST_IP}/${DST_EHA}
> >ExecStop=/usr/sbin/modprobe -r netconsole
Ditto.

> >
> >[Install]
> >WantedBy=multi-user.target
That's a really late... But I don't see a better place unfortunately.

> >The original SysV netconsole service with related config - still in use,
> >https://git.fedorahosted.org/cgit/initscripts.git/plain/rc.d/init.d/netconsole
> >https://git.fedorahosted.org/cgit/initscripts.git/plain/sysconfig/netconsole
> >
> >Feel free to comment.
Looks like an improvement on status quo.

Zbyszek


More information about the systemd-devel mailing list