Re: [systemd-devel] Netconsole NG
On 08.04.2014 23:27, poma wrote: On 08.04.2014 14:25, Tom Gundersen wrote: On Tue, Apr 8, 2014 at 2:10 PM, poma pomidorabelis...@gmail.com wrote: On 08.04.2014 04:03, poma wrote: On 07.04.2014 19:55, Zbigniew Jędrzejewski-Szmek wrote: 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 Shall we still leave something for users to configure. Thanks for your review. $ cat /usr/lib/systemd/system/netconsole-zbyszek.service [Unit] Description=Adds the netconsole module with the configured parameters After=network.target [Service] EnvironmentFile=/etc/sysconfig/netconsole-zbyszek RemainAfterExit=yes ExecStart=/sbin/modprobe netconsole netconsole=@/${SRC_DEV},@${DST_IP}/ ExecStop=/sbin/modprobe -r netconsole [Install] WantedBy=multi-user.target ~~~ $ cat /etc/sysconfig/netconsole-zbyszek # This is the EnvironmentFile for the netconsole service. Starting this # service enables the capture of dmesg output on a destination machine. # Source network device SRC_DEV=enp1s2 # Destination IP address DST_IP=192.168.1.1 ~~~ $ dmesg | grep netcon [ 24.361611] netpoll: netconsole: local port 6665 [ 24.361764] netpoll: netconsole: local IPv4 address 0.0.0.0 [ 24.361893] netpoll: netconsole: interface 'enp1s2' [ 24.362061] netpoll: netconsole: remote port [ 24.362344] netpoll: netconsole: remote IPv4 address 192.168.1.1 [ 24.362635] netpoll: netconsole: remote ethernet address ff:ff:ff:ff:ff:ff [ 24.362909] netpoll: netconsole: no IP address for enp1s2, aborting [ 24.363186] netconsole: cleaning up ~ This turns out to be a bare minimum, i.e. # modprobe netconsole netconsole=@/enp1s2,@192.168.1.1/ but that is also squeeze breeze ... ~ $ cat /usr/lib/systemd/system/netconsole-poma.service [Unit] Description=Adds the netconsole module with the configured parameters After=network.target [Service] EnvironmentFile=/etc/sysconfig/netconsole-poma RemainAfterExit=yes ExecStart=/sbin/modprobe netconsole netconsole=@${SRC_IP}/${SRC_DEV},@${DST_IP}/ ExecStop=/sbin/modprobe -r netconsole [Install] WantedBy=multi-user.target $ cat /etc/sysconfig/netconsole-poma # This is the EnvironmentFile for the netconsole service. Starting this # service enables the capture of dmesg output on a destination machine. # Source IP address SRC_IP=192.168.1.2 # Source network
Re: [systemd-devel] Netconsole NG
On 08.04.2014 04:03, poma wrote: On 07.04.2014 19:55, Zbigniew Jędrzejewski-Szmek wrote: 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 Shall we still leave something for users to configure. Thanks for your review. $ cat /usr/lib/systemd/system/netconsole-zbyszek.service [Unit] Description=Adds the netconsole module with the configured parameters After=network.target [Service] EnvironmentFile=/etc/sysconfig/netconsole-zbyszek RemainAfterExit=yes ExecStart=/sbin/modprobe netconsole netconsole=@/${SRC_DEV},@${DST_IP}/ ExecStop=/sbin/modprobe -r netconsole [Install] WantedBy=multi-user.target ~~~ $ cat /etc/sysconfig/netconsole-zbyszek # This is the EnvironmentFile for the netconsole service. Starting this # service enables the capture of dmesg output on a destination machine. # Source network device SRC_DEV=enp1s2 # Destination IP address DST_IP=192.168.1.1 ~~~ $ dmesg | grep netcon [ 24.361611] netpoll: netconsole: local port 6665 [ 24.361764] netpoll: netconsole: local IPv4 address 0.0.0.0 [ 24.361893] netpoll: netconsole: interface 'enp1s2' [ 24.362061] netpoll: netconsole: remote port [ 24.362344] netpoll: netconsole: remote IPv4 address 192.168.1.1 [ 24.362635] netpoll: netconsole: remote ethernet address ff:ff:ff:ff:ff:ff [ 24.362909] netpoll: netconsole: no IP address for enp1s2, aborting [ 24.363186] netconsole: cleaning up ~ This turns out to be a bare minimum, i.e. # modprobe netconsole netconsole=@/enp1s2,@192.168.1.1/ but that is also squeeze breeze ... ~ $ cat /usr/lib/systemd/system/netconsole-poma.service [Unit] Description=Adds the netconsole module with the configured parameters After=network.target [Service] EnvironmentFile=/etc/sysconfig/netconsole-poma RemainAfterExit=yes ExecStart=/sbin/modprobe netconsole netconsole=@${SRC_IP}/${SRC_DEV},@${DST_IP}/ ExecStop=/sbin/modprobe -r netconsole [Install] WantedBy=multi-user.target $ cat /etc/sysconfig/netconsole-poma # This is the EnvironmentFile for the netconsole service. Starting this # service enables the capture of dmesg output on a destination machine. # Source IP address SRC_IP=192.168.1.2 # Source network device SRC_DEV=enp1s2 # Destination IP address DST_IP=192.168.1.1 ~~~ $ dmesg | grep netcon [ 23.156730] netpoll: netconsole: local port 6665 [
Re: [systemd-devel] Netconsole NG
On Tue, Apr 8, 2014 at 2:10 PM, poma pomidorabelis...@gmail.com wrote: On 08.04.2014 04:03, poma wrote: On 07.04.2014 19:55, Zbigniew Jędrzejewski-Szmek wrote: 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 Shall we still leave something for users to configure. Thanks for your review. $ cat /usr/lib/systemd/system/netconsole-zbyszek.service [Unit] Description=Adds the netconsole module with the configured parameters After=network.target [Service] EnvironmentFile=/etc/sysconfig/netconsole-zbyszek RemainAfterExit=yes ExecStart=/sbin/modprobe netconsole netconsole=@/${SRC_DEV},@${DST_IP}/ ExecStop=/sbin/modprobe -r netconsole [Install] WantedBy=multi-user.target ~~~ $ cat /etc/sysconfig/netconsole-zbyszek # This is the EnvironmentFile for the netconsole service. Starting this # service enables the capture of dmesg output on a destination machine. # Source network device SRC_DEV=enp1s2 # Destination IP address DST_IP=192.168.1.1 ~~~ $ dmesg | grep netcon [ 24.361611] netpoll: netconsole: local port 6665 [ 24.361764] netpoll: netconsole: local IPv4 address 0.0.0.0 [ 24.361893] netpoll: netconsole: interface 'enp1s2' [ 24.362061] netpoll: netconsole: remote port [ 24.362344] netpoll: netconsole: remote IPv4 address 192.168.1.1 [ 24.362635] netpoll: netconsole: remote ethernet address ff:ff:ff:ff:ff:ff [ 24.362909] netpoll: netconsole: no IP address for enp1s2, aborting [ 24.363186] netconsole: cleaning up ~ This turns out to be a bare minimum, i.e. # modprobe netconsole netconsole=@/enp1s2,@192.168.1.1/ but that is also squeeze breeze ... ~ $ cat /usr/lib/systemd/system/netconsole-poma.service [Unit] Description=Adds the netconsole module with the configured parameters After=network.target [Service] EnvironmentFile=/etc/sysconfig/netconsole-poma RemainAfterExit=yes ExecStart=/sbin/modprobe netconsole netconsole=@${SRC_IP}/${SRC_DEV},@${DST_IP}/ ExecStop=/sbin/modprobe -r netconsole [Install] WantedBy=multi-user.target $ cat /etc/sysconfig/netconsole-poma # This is the EnvironmentFile for the netconsole service. Starting this # service enables the capture of dmesg output on a destination machine. # Source IP address SRC_IP=192.168.1.2 # Source network device SRC_DEV=enp1s2 # Destination IP address DST_IP=192.168.1.1
Re: [systemd-devel] Netconsole NG
On 04/08/2014 12:25 PM, Tom Gundersen wrote: This looks like a definitive improvement. I beg the differ that unit file created/provided is rubbish I even go so far as saying every line in the [Service] section is a sample of what not to do. Anyone reading this thread should stay away from duplicating what is being done in it. JBG ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] Netconsole NG
On 08.04.2014 14:25, Tom Gundersen wrote: On Tue, Apr 8, 2014 at 2:10 PM, poma pomidorabelis...@gmail.com wrote: On 08.04.2014 04:03, poma wrote: On 07.04.2014 19:55, Zbigniew Jędrzejewski-Szmek wrote: 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 Shall we still leave something for users to configure. Thanks for your review. $ cat /usr/lib/systemd/system/netconsole-zbyszek.service [Unit] Description=Adds the netconsole module with the configured parameters After=network.target [Service] EnvironmentFile=/etc/sysconfig/netconsole-zbyszek RemainAfterExit=yes ExecStart=/sbin/modprobe netconsole netconsole=@/${SRC_DEV},@${DST_IP}/ ExecStop=/sbin/modprobe -r netconsole [Install] WantedBy=multi-user.target ~~~ $ cat /etc/sysconfig/netconsole-zbyszek # This is the EnvironmentFile for the netconsole service. Starting this # service enables the capture of dmesg output on a destination machine. # Source network device SRC_DEV=enp1s2 # Destination IP address DST_IP=192.168.1.1 ~~~ $ dmesg | grep netcon [ 24.361611] netpoll: netconsole: local port 6665 [ 24.361764] netpoll: netconsole: local IPv4 address 0.0.0.0 [ 24.361893] netpoll: netconsole: interface 'enp1s2' [ 24.362061] netpoll: netconsole: remote port [ 24.362344] netpoll: netconsole: remote IPv4 address 192.168.1.1 [ 24.362635] netpoll: netconsole: remote ethernet address ff:ff:ff:ff:ff:ff [ 24.362909] netpoll: netconsole: no IP address for enp1s2, aborting [ 24.363186] netconsole: cleaning up ~ This turns out to be a bare minimum, i.e. # modprobe netconsole netconsole=@/enp1s2,@192.168.1.1/ but that is also squeeze breeze ... ~ $ cat /usr/lib/systemd/system/netconsole-poma.service [Unit] Description=Adds the netconsole module with the configured parameters After=network.target [Service] EnvironmentFile=/etc/sysconfig/netconsole-poma RemainAfterExit=yes ExecStart=/sbin/modprobe netconsole netconsole=@${SRC_IP}/${SRC_DEV},@${DST_IP}/ ExecStop=/sbin/modprobe -r netconsole [Install] WantedBy=multi-user.target $ cat /etc/sysconfig/netconsole-poma # This is the EnvironmentFile for the netconsole service. Starting this # service enables the capture of dmesg output on a destination machine. # Source IP address SRC_IP=192.168.1.2 # Source network device SRC_DEV=enp1s2 #
Re: [systemd-devel] Netconsole NG
On 08.04.2014 18:21, Jóhann B. Guðmundsson wrote: On 04/08/2014 12:10 PM, poma wrote: [Service] EnvironmentFile=/etc/sysconfig/netconsole-zbyszek RemainAfterExit=yes ExecStart=/sbin/modprobe netconsole netconsole=@/${SRC_DEV},@${DST_IP}/ ExecStop=/sbin/modprobe -r netconsole On popular demand of me providing more detailed criticism than just this is rubbish as well as I got somewhat myself to blame for poorly written unit files given that the best practical of unit writing resides in my head by the experience of migrating so many legacy sysv initscript to native systemd units and driven half way to insanity while doing so. So let me clarify why I think this is rubbish. For the first you are using the wrong Type for that unit file as in the build in default which is Type=simple for the purpose of this unit along with RemainAfterExit=yes in it when you should be using Type=oneshot unit Secondly let me start with EnvironmentFile= in 99.9% times this is entirely unnecessary since what is contains within those environment files are configuration changes to daemon startup for daemons that are so poorly written they dont support reading configuration files on startup. Now on the 21 century within the systemd universe, administrators are ( supposted to be ) using drop in configuration snippets that contain that administrator overwrite to overcome that daemons lack of reading configuration file in the relvant unit's .d configuration directory that resides under /etc/systemd/systemd/ or better yet developers that maintain and own that component should be rewriting it's daemon to support parsing configuration file(s) at startup. If you happen to be using the 00.1% components that actually has valid usecase for using EnvironmentFile= definition in type service units these days, then those environment files should reside in a components .d directory under /etc to make them cross distributional not under /etc/sysconfig or under /etc/default and hopefully one day I will have manage to remove all traces and usages of environmental files in /etc/sysconfig in Fedora ( but achieving that is more like David vs Goliath or Jóhann vs Red Hat.) as well as others doing the same in their distribution of choice Thirdly under no circumstances and I mean NEVER should you be loading and unloading modules from within a systemd unit YES NEVER!!! If you need for one reason or another to load module you do so by placing .conf configuration snippet in /etc/modules-load.d which tell the system which kernel modules to load but fact is if you actually need to load some module manually like this something is wrong since modules should be automatic loaded by PCI IDs, USB IDs, DMI IDs or similar triggers encoded in the kernel modules themselves these days. And you place .conf configuration snippet in /etc/modprobe.d which contains which parameters the kernel module uses when loading. Which leads to that service section being rubbish as well as the existence of that entire unit being o_O since the correct way ( always ) when dealing with module and their option is what I described here above which leads to for netconsole being /etc/modules-load.d/netconsole.conf # Load netconsole.ko at boot netconsole And /etc/modprobe.d/netconsole.conf # load netconsole options options netconsole netconsole=@192.168.1.2/enp1s2,@192.168.1.1/ And since you are using netconsole you probably want to increase the logvel as well /etc/sysctl.d/10-netconsole.conf #raising loglevel from 7 to 8 kernel.printk = 8 4 1 7 JBG What do you mean? African or European swallow? poma ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] Netconsole NG
On 08.04.2014 23:45, Jóhann B. Guðmundsson wrote: On 04/08/2014 09:27 PM, poma wrote: In fact, this method has long been known from the Lm_sensors - Linux hardware monitoring It's a well known fact that the internet is good at spreading ignorance and what you just provided was an example of more people doing it wrong which does not make it right. You can see the same pattern when people cut and paste code left and right to cut corners. JBG How do you know so much about swallows? poma ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] Netconsole NG
On 08.04.2014 23:27, poma wrote: On 08.04.2014 14:25, Tom Gundersen wrote: On Tue, Apr 8, 2014 at 2:10 PM, poma pomidorabelis...@gmail.com wrote: On 08.04.2014 04:03, poma wrote: On 07.04.2014 19:55, Zbigniew Jędrzejewski-Szmek wrote: 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 Shall we still leave something for users to configure. Thanks for your review. $ cat /usr/lib/systemd/system/netconsole-zbyszek.service [Unit] Description=Adds the netconsole module with the configured parameters After=network.target [Service] EnvironmentFile=/etc/sysconfig/netconsole-zbyszek RemainAfterExit=yes ExecStart=/sbin/modprobe netconsole netconsole=@/${SRC_DEV},@${DST_IP}/ ExecStop=/sbin/modprobe -r netconsole [Install] WantedBy=multi-user.target ~~~ $ cat /etc/sysconfig/netconsole-zbyszek # This is the EnvironmentFile for the netconsole service. Starting this # service enables the capture of dmesg output on a destination machine. # Source network device SRC_DEV=enp1s2 # Destination IP address DST_IP=192.168.1.1 ~~~ $ dmesg | grep netcon [ 24.361611] netpoll: netconsole: local port 6665 [ 24.361764] netpoll: netconsole: local IPv4 address 0.0.0.0 [ 24.361893] netpoll: netconsole: interface 'enp1s2' [ 24.362061] netpoll: netconsole: remote port [ 24.362344] netpoll: netconsole: remote IPv4 address 192.168.1.1 [ 24.362635] netpoll: netconsole: remote ethernet address ff:ff:ff:ff:ff:ff [ 24.362909] netpoll: netconsole: no IP address for enp1s2, aborting [ 24.363186] netconsole: cleaning up ~ This turns out to be a bare minimum, i.e. # modprobe netconsole netconsole=@/enp1s2,@192.168.1.1/ but that is also squeeze breeze ... ~ $ cat /usr/lib/systemd/system/netconsole-poma.service [Unit] Description=Adds the netconsole module with the configured parameters After=network.target [Service] EnvironmentFile=/etc/sysconfig/netconsole-poma RemainAfterExit=yes ExecStart=/sbin/modprobe netconsole netconsole=@${SRC_IP}/${SRC_DEV},@${DST_IP}/ ExecStop=/sbin/modprobe -r netconsole [Install] WantedBy=multi-user.target $ cat /etc/sysconfig/netconsole-poma # This is the EnvironmentFile for the netconsole service. Starting this # service enables the capture of dmesg output on a destination machine. # Source IP address SRC_IP=192.168.1.2 # Source network
Re: [systemd-devel] Netconsole NG
On 04/08/2014 09:53 PM, poma wrote: How do you know so much about swallows? Given that you respond in random unrelated quotes on threads and reports then perhaps it's best that people start replying to you in same manner since it seems to be your preferred way of communication. JBG ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] Netconsole NG
On 09.04.2014 00:21, Jóhann B. Guðmundsson wrote: On 04/08/2014 09:53 PM, poma wrote: How do you know so much about swallows? Given that you respond in random unrelated quotes on threads and reports then perhaps it's best that people start replying to you in same manner since it seems to be your preferred way of communication. JBG What? A swallow carrying a coconut? poma ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] Netconsole NG
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 # Source IP address SRC_IP=192.168.1.2 # Source network device SRC_DEV=enp1s2 # Destination port DST_PORT=12345 # Destination IP address DST_IP=192.168.1.1 # Destination ethernet address DST_EHA=00:11:22:33:44:55 /usr/lib/systemd/system/netconsole.service: [Unit] Description=Adds the netconsole module with the configured parameters After=network.target [Service] EnvironmentFile=/etc/sysconfig/netconsole Type=simple RemainAfterExit=yes ExecStart=/usr/sbin/modprobe netconsole netconsole=${SRC_PORT}@${SRC_IP}/${SRC_DEV},${DST_PORT}@${DST_IP}/${DST_EHA} ExecStop=/usr/sbin/modprobe -r netconsole [Install] WantedBy=multi-user.target 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. poma 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. Lukas ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] Netconsole NG
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 ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] Netconsole NG
On 07.04.2014 17:34, Lukáš Nykrýn wrote: 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 # Source IP address SRC_IP=192.168.1.2 # Source network device SRC_DEV=enp1s2 # Destination port DST_PORT=12345 # Destination IP address DST_IP=192.168.1.1 # Destination ethernet address DST_EHA=00:11:22:33:44:55 /usr/lib/systemd/system/netconsole.service: [Unit] Description=Adds the netconsole module with the configured parameters After=network.target [Service] EnvironmentFile=/etc/sysconfig/netconsole Type=simple RemainAfterExit=yes ExecStart=/usr/sbin/modprobe netconsole netconsole=${SRC_PORT}@${SRC_IP}/${SRC_DEV},${DST_PORT}@${DST_IP}/${DST_EHA} ExecStop=/usr/sbin/modprobe -r netconsole [Install] WantedBy=multi-user.target 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. poma 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. Lukas Yeehaw! poma ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] Netconsole NG
On 07.04.2014 19:55, Zbigniew Jędrzejewski-Szmek wrote: 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 Shall we still leave something for users to configure. Thanks for your review. poma ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
[systemd-devel] Netconsole NG
/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 # Source IP address SRC_IP=192.168.1.2 # Source network device SRC_DEV=enp1s2 # Destination port DST_PORT=12345 # Destination IP address DST_IP=192.168.1.1 # Destination ethernet address DST_EHA=00:11:22:33:44:55 /usr/lib/systemd/system/netconsole.service: [Unit] Description=Adds the netconsole module with the configured parameters After=network.target [Service] EnvironmentFile=/etc/sysconfig/netconsole Type=simple RemainAfterExit=yes ExecStart=/usr/sbin/modprobe netconsole netconsole=${SRC_PORT}@${SRC_IP}/${SRC_DEV},${DST_PORT}@${DST_IP}/${DST_EHA} ExecStop=/usr/sbin/modprobe -r netconsole [Install] WantedBy=multi-user.target 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. poma ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] Netconsole NG
El 06/04/14 12:59, poma escribió: /usr/lib/systemd/system/netconsole.service: [Unit] Description=Adds the netconsole module with the configured parameters After=network.target [Service] EnvironmentFile=/etc/sysconfig/netconsole Type=simple RemainAfterExit=yes ExecStart=/usr/sbin/modprobe netconsole netconsole=${SRC_PORT}@${SRC_IP}/${SRC_DEV},${DST_PORT}@${DST_IP}/${DST_EHA} ExecStop=/usr/sbin/modprobe -r netconsole [Install] WantedBy=multi-user.target 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. Do not call modprobe from unit files, use a modules-load.d snippet instead. Hrmm.. a systemd-netconsole.service that could setup this is a clean race-free fashion will be a cool addition to the stack ;) ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] Netconsole NG
On 06.04.2014 18:42, Cristian Rodríguez wrote: El 06/04/14 12:59, poma escribió: /usr/lib/systemd/system/netconsole.service: [Unit] Description=Adds the netconsole module with the configured parameters After=network.target [Service] EnvironmentFile=/etc/sysconfig/netconsole Type=simple RemainAfterExit=yes ExecStart=/usr/sbin/modprobe netconsole netconsole=${SRC_PORT}@${SRC_IP}/${SRC_DEV},${DST_PORT}@${DST_IP}/${DST_EHA} ExecStop=/usr/sbin/modprobe -r netconsole [Install] WantedBy=multi-user.target 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. Do not call modprobe from unit files, use a modules-load.d snippet instead. Netconsole ain't module vulgaris. Snippet, yeah right. Hrmm.. a systemd-netconsole.service that could setup this is a clean race-free fashion will be a cool addition to the stack ;) Say whaaat? poma ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] Netconsole NG
El 06/04/14 13:42, Cristian Rodríguez escribió: Hrmm.. a systemd-netconsole.service that could setup this is a clean race-free fashion will be a cool addition to the stack ;) The question is.. as a separate tool or an extension to networkd, which seems to be a more suitable place.. NetConsole=true enable netconsole on this interface , networkd can then fill up at least ${SRC_IP} ${SRC_DEV} ..other unit directives will be needed for information that networkd does not have.. This hypothetical feature sounds significantly better than the current hackish way... -- Cristian Team PITA ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel
Re: [systemd-devel] Netconsole NG
On 06.04.2014 19:40, Cristian Rodríguez wrote: El 06/04/14 13:42, Cristian Rodríguez escribió: Hrmm.. a systemd-netconsole.service that could setup this is a clean race-free fashion will be a cool addition to the stack ;) The question is.. as a separate tool or an extension to networkd, which seems to be a more suitable place.. NetConsole=true enable netconsole on this interface , networkd can then fill up at least ${SRC_IP} ${SRC_DEV} ..other unit directives will be needed for information that networkd does not have.. This hypothetical feature sounds significantly better than the current hackish way... Yeah, but compared with your hypothetical and with the old style Kung Fu netcon servo practically broken within the grand systemd schema, /etc/init.d/netconsole netpoll: netconsole: local port 12345 netpoll: netconsole: local IPv4 address 0.0.0.0 netpoll: netconsole: interface 'enp1s2' netpoll: netconsole: remote port 12345 netpoll: netconsole: remote IPv4 address 192.168.1.1 netpoll: netconsole: remote ethernet address 00:11:22:33:44:55 netpoll: netconsole: device enp1s2 not up yet, forcing it netpoll: netconsole: no IP address for enp1s2, aborting netconsole: cleaning up Netconsole NG is simple as it can be, and most importantly works in all conditions, /usr/lib/systemd/system/netconsole.service netpoll: netconsole: local port 12345 netpoll: netconsole: local IPv4 address 192.168.1.2 netpoll: netconsole: interface 'enp1s2' netpoll: netconsole: remote port 12345 netpoll: netconsole: remote IPv4 address 192.168.1.1 netpoll: netconsole: remote ethernet address 00:11:22:33:44:55 console [netcon0] enabled netconsole: network logging started netpoll: netconsole: local port 12345 netpoll: netconsole: local IPv4 address 192.168.1.2 netpoll: netconsole: interface 'enp1s2' netpoll: netconsole: remote port 12345 netpoll: netconsole: remote IPv4 address 192.168.1.1 netpoll: netconsole: remote ethernet address 00:11:22:33:44:55 netpoll: netconsole: device enp1s2 not up yet, forcing it console [netcon0] enabled netconsole: network logging started Now you can pursue the beauty of design. :) poma ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel