Closed oliv3r closed 2 months ago
On Fri, Aug 23, 2024 at 05:07:52AM -0700, Olliver Schinagl wrote:
On openwrt, ser2net version 4.3.6 I wrote a little hotplug script, that when a USB serial convert is attached, will trigger ser2net to spawn.
This works great, however upon boot (the first time only), ser2net does something I cannot explain (but seen it also occasionally on my desktop).
739 root 1668 S ser2net -C 18888 raw 100 /dev/ttyUSB0 115200 NONE 1STOPBIT 8DATABITS -RTSCTS -LOCAL NOBREAK -P /var/run/ser2net.pid 2201 root 1668 S /usr/sbin/ser2net -n -c /tmp/ser2net.conf
The hotplug script gets executed as expected running exactrly my startup script as can be seen by PID 739. Some other stuff happens during boot, and later in the boot pid 2201 suddenly pops up. In the config file, the parameters supplied to the first process are listed as expected.
That's because openwrt is starting it somehow.
Using
kill -3
on 739 now however keeps 2201 running. This is unexpected and must be a bug? What is the purpose of the pid file if we cannot use it to kill our main and child processes?
Why would killing 739 do anything to 2201? They are different processes and don't have anything to do with one another.
Whats more curious, if I remove my USB stick, triggering the cleanup; and manually killing ser2net 2201, re-inserting things now causes the expected behavior of 1 process.
Is there a way to stop ser2net trying to be smarter and forking it self with a generated config? Why is it doing that only in certain cases and what are the criteria for this to be triggered?
That's an openwrt question. ser2net is not forking itself with the config. openwrt is starting ser2net process 2201 somehow.
-corey
So you are absolutely correct. The most obvious answer is probably the correct one :) Sorry for the noise!
On openwrt, ser2net version 4.3.6 I wrote a little hotplug script, that when a USB serial convert is attached, will trigger ser2net to spawn.
This works great, however upon boot (the first time only), ser2net does something I cannot explain (but seen it also occasionally on my desktop).
The hotplug script gets executed as expected running exactrly my startup script as can be seen by PID 739. Some other stuff happens during boot, and later in the boot pid 2201 suddenly pops up. In the config file, the parameters supplied to the first process are listed as expected.
Using
kill -3
on 739 now however keeps 2201 running. This is unexpected and must be a bug? What is the purpose of the pid file if we cannot use it to kill our main and child processes?Whats more curious, if I remove my USB stick, triggering the cleanup; and manually killing ser2net 2201, re-inserting things now causes the expected behavior of 1 process.
Is there a way to stop ser2net trying to be smarter and forking it self with a generated config? Why is it doing that only in certain cases and what are the criteria for this to be triggered?