Bug#1000622: ser2net: Fails to start on boot since the serial port is not ready
tags #1000622 confirmed pending thanks On Mon, Nov 29, 2021 at 08:17:29AM +, Mario Volterra wrote: > I have added to /lib/systemd/system/ser2net.service > > After=network-online.target > Wants=network-online.target > > ad below and rebooted the pi and upon restart ser2net started successfully! This will be in the next package. Greetings Marc
Bug#1000622: ser2net: Fails to start on boot since the serial port is not ready
Hello Marc and Corey, This really helped a lot! I have added to /lib/systemd/system/ser2net.service After=network-online.target Wants=network-online.target ad below and rebooted the pi and upon restart ser2net started successfully! ``` [Unit] Description=Serial port to network proxy Documentation=man:ser2net(8) After=network-online.target Wants=network-online.target [Service] EnvironmentFile=-/etc/default/ser2net ExecStart=/usr/sbin/ser2net -n -c $CONFFILE -P /run/ser2net.pid Type=exec Restart=on-failure [Install] WantedBy=multi-user.target ``` Thank you a lot!!! Best Regards, Mario ‐‐‐ Original Message ‐‐‐ Il sabato 27 novembre 2021 12:25 PM, Marc Haber ha scritto: > Hi Mario, > > after Corey has given some input, we can try finding out what happens on > > your Pi. Does Raspbian use Network-Manager? systemd-networkd? ifupdown? > > You can try adding > > After=network-online.target > > Wants=network-online.target > > to the [Unit] stanza of ser2net.service. > > According to > > https://www.freedesktop.org/wiki/Software/systemd/NetworkTarget/ you > > need to enable the correct wait-online.service matching your network > > management software (NetworkManager, systemd-networkd, ifupdown etc) for > > this to reliably work. > > Greetings > > Marc
Bug#1000622: ser2net: Fails to start on boot since the serial port is not ready
On Sat, Nov 27, 2021 at 05:29:23PM -0600, Corey Minyard wrote: > On Sat, Nov 27, 2021 at 09:29:24AM +0100, Marc Haber wrote: > > ser2net[625]: Invalid port name/number: Invalid data to parameter on > > line 30 column 0 > > > > since it might refer to a serial port as well as to a TCP port. I guess > > this misled me to ser2net complaining about the /dev/ttyAMA0 not > > appearing in time. > > Yes, that is an issue; I have made the error message precise. Thank you! > > > > Additionally, the ser2net.yml quoted by the original bug reporter in the > > original bug report does not seem to have 30 lines. This is all very > > strange for me. > > Also an issue. This error means that gensio was unable to parse an > accepter line. On line 30. I woud guess there is something incorrect > on line 30 in an accepter: . So that ie neither a line in a configuration file, nor a code line in the sources, but a line like a serial line? That would never have occurred to me, this needs less ambigious wording. Greetings Marc -- - Marc Haber | "I don't trust Computers. They | Mailadresse im Header Leimen, Germany| lose things."Winona Ryder | Fon: *49 6224 1600402 Nordisch by Nature | How to make an American Quilt | Fax: *49 6224 1600421
Bug#1000622: ser2net: Fails to start on boot since the serial port is not ready
On Sat, Nov 27, 2021 at 09:29:24AM +0100, Marc Haber wrote: > On Fri, Nov 26, 2021 at 07:57:37PM -0600, Corey Minyard wrote: > > If this is what I think it is, this is a common issue on systems at > > boot; ser2net is started before networking is enabled. Some sort of > > dependencies need to be added to the ser2net systemd code, though I'm > > not sure what. > > I am not sure about that, it is probably a combination of > > [Unit] > After=network-online.target > Wants=network-online.target > > https://www.freedesktop.org/wiki/Software/systemd/NetworkTarget/ gives > some explanation about what systemd thinks what a "modern" service > should do. I have not yet seen a service that does it "right" the way > systemd thinks the world should be. > > I also know that there is a TCP socket option that allows a service to > bind to an IP address before the address is configured. Otoh, ser2net > listens on :: which should always be available. > > What also bothers me is the error message > > ser2net[625]: Invalid port name/number: Invalid data to parameter on > line 30 column 0 > > since it might refer to a serial port as well as to a TCP port. I guess > this misled me to ser2net complaining about the /dev/ttyAMA0 not > appearing in time. Yes, that is an issue; I have made the error message precise. > > Additionally, the ser2net.yml quoted by the original bug reporter in the > original bug report does not seem to have 30 lines. This is all very > strange for me. Also an issue. This error means that gensio was unable to parse an accepter line. On line 30. I woud guess there is something incorrect on line 30 in an accepter: . -corey
Bug#1000622: ser2net: Fails to start on boot since the serial port is not ready
Hi Mario, after Corey has given some input, we can try finding out what happens on your Pi. Does Raspbian use Network-Manager? systemd-networkd? ifupdown? You can try adding After=network-online.target Wants=network-online.target to the [Unit] stanza of ser2net.service. According to https://www.freedesktop.org/wiki/Software/systemd/NetworkTarget/ you need to enable the correct wait-online.service matching your network management software (NetworkManager, systemd-networkd, ifupdown etc) for this to reliably work. Greetings Marc
Bug#1000622: ser2net: Fails to start on boot since the serial port is not ready
On Fri, Nov 26, 2021 at 07:57:37PM -0600, Corey Minyard wrote: > If this is what I think it is, this is a common issue on systems at > boot; ser2net is started before networking is enabled. Some sort of > dependencies need to be added to the ser2net systemd code, though I'm > not sure what. I am not sure about that, it is probably a combination of [Unit] After=network-online.target Wants=network-online.target https://www.freedesktop.org/wiki/Software/systemd/NetworkTarget/ gives some explanation about what systemd thinks what a "modern" service should do. I have not yet seen a service that does it "right" the way systemd thinks the world should be. I also know that there is a TCP socket option that allows a service to bind to an IP address before the address is configured. Otoh, ser2net listens on :: which should always be available. What also bothers me is the error message ser2net[625]: Invalid port name/number: Invalid data to parameter on line 30 column 0 since it might refer to a serial port as well as to a TCP port. I guess this misled me to ser2net complaining about the /dev/ttyAMA0 not appearing in time. Additionally, the ser2net.yml quoted by the original bug reporter in the original bug report does not seem to have 30 lines. This is all very strange for me. Greetings Marc -- - Marc Haber | "I don't trust Computers. They | Mailadresse im Header Leimen, Germany| lose things."Winona Ryder | Fon: *49 6224 1600402 Nordisch by Nature | How to make an American Quilt | Fax: *49 6224 1600421
Bug#1000622: ser2net: Fails to start on boot since the serial port is not ready
On Fri, Nov 26, 2021 at 12:25:24AM +0100, Mario V wrote: > Package: ser2net > Version: 4.3.3-1 > Severity: important > X-Debbugs-Cc: mario@volterra.cloud > > Dear Maintainer, > > *** Reporter, please consider answering these questions, where appropriate *** > >* What led up to the situation? > Installed, before upgrade to Debian Bullseye it worked fine on buster > (raspberry Pi0 W) >* What exactly did you do (or not do) that was effective (or > ineffective)? > sudo apt install ser2net , edit /etc/ser2net/ser2net.conf, sudo systemctl > enable ser2net && sudo systemctl start ser2net >* What was the outcome of this action? > the service started >* What outcome did you expect instead? > When rebooting the Pi0 on sudo systemctl status ser2net I get > ``` > ser2net[625]: Invalid port name/number: Invalid data to parameter on line 30 > column 0 > ``` If this is what I think it is, this is a common issue on systems at boot; ser2net is started before networking is enabled. Some sort of dependencies need to be added to the ser2net systemd code, though I'm not sure what. It's not important to get the serial ports ready before ser2net, ser2net only opens the ports when a connection comes in. Unless you are doing connect backs, I guess, but even then ser2net should recover properly. -corey > > and it's not working until I run again `sudo systemctl restart ser2net` , in > buster it was working just fine. > > > -- System Information: > Distributor ID: Raspbian > Description: Raspbian GNU/Linux 11 (bullseye) > Release: 11 > Codename: bullseye > Architecture: armv6l > > Kernel: Linux 5.10.63+ > Kernel taint flags: TAINT_CRAP > Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE not > set > Shell: /bin/sh linked to /usr/bin/dash > Init: systemd (via /run/systemd/system) > > Versions of packages ser2net depends on: > ii init-system-helpers 1.60 > ii libc62.31-13+rpt2+rpi1 > ii libgensio0 2.2.4-1 > ii libyaml-0-2 0.2.2-1 > ii lsb-base 11.1.0+rpi1 > > ser2net recommends no packages. > > Versions of packages ser2net suggests: > pn telnet > > -- Configuration Files: > /etc/ser2net.yaml changed: > %YAML 1.1 > --- > define: \r\nser2net port \p device \d [\B] (Debian GNU/Linux)\r\n\r\n > connection: > accepter: tcp,20108 > connector: serialdev,/dev/ttyAMA0,115200n81,local > options: > kickolduser: true > > > -- no debconf information >
Bug#1000622: ser2net: Fails to start on boot since the serial port is not ready
severity #1000622 minor thanks On Fri, Nov 26, 2021 at 12:25:24AM +0100, Mario V wrote: > Distributor ID: Raspbian > Description: Raspbian GNU/Linux 11 (bullseye) Please try to reproduce the issue on Debian proper. Greetings Marc -- - Marc Haber | "I don't trust Computers. They | Mailadresse im Header Leimen, Germany| lose things."Winona Ryder | Fon: *49 6224 1600402 Nordisch by Nature | How to make an American Quilt | Fax: *49 6224 1600421
Bug#1000622: ser2net: Fails to start on boot since the serial port is not ready
Package: ser2net Version: 4.3.3-1 Severity: important X-Debbugs-Cc: mario@volterra.cloud Dear Maintainer, *** Reporter, please consider answering these questions, where appropriate *** * What led up to the situation? Installed, before upgrade to Debian Bullseye it worked fine on buster (raspberry Pi0 W) * What exactly did you do (or not do) that was effective (or ineffective)? sudo apt install ser2net , edit /etc/ser2net/ser2net.conf, sudo systemctl enable ser2net && sudo systemctl start ser2net * What was the outcome of this action? the service started * What outcome did you expect instead? When rebooting the Pi0 on sudo systemctl status ser2net I get ``` ser2net[625]: Invalid port name/number: Invalid data to parameter on line 30 column 0 ``` and it's not working until I run again `sudo systemctl restart ser2net` , in buster it was working just fine. -- System Information: Distributor ID: Raspbian Description:Raspbian GNU/Linux 11 (bullseye) Release:11 Codename: bullseye Architecture: armv6l Kernel: Linux 5.10.63+ Kernel taint flags: TAINT_CRAP Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE not set Shell: /bin/sh linked to /usr/bin/dash Init: systemd (via /run/systemd/system) Versions of packages ser2net depends on: ii init-system-helpers 1.60 ii libc62.31-13+rpt2+rpi1 ii libgensio0 2.2.4-1 ii libyaml-0-2 0.2.2-1 ii lsb-base 11.1.0+rpi1 ser2net recommends no packages. Versions of packages ser2net suggests: pn telnet -- Configuration Files: /etc/ser2net.yaml changed: %YAML 1.1 --- define: \r\nser2net port \p device \d [\B] (Debian GNU/Linux)\r\n\r\n connection: accepter: tcp,20108 connector: serialdev,/dev/ttyAMA0,115200n81,local options: kickolduser: true -- no debconf information