Milan Obuch
2024-02-13 11:19:37 UTC
Hi,
I am trying to solve an issue how to start local scripts in proper
order (for my application). Basically, I use net/socat port to create
virtual serial port used to read data from some device (just simple
character stream, with CR LF terminating the record with fixed position
items).
I configured socat instance in /etc/rc.conf:
socat_enable="YES"
and /usr/local/etc/socat-instances.conf:
[moxa]
daemonuser=root
flags="PTY,link=/dev/cuaV0,rawer,wait-slave TCP4:192.168.x.y:5000"
It works - on boot, designated device is contacted and virtual serial
port is created.
For starting program consuming data, I put following in /etc/rc.local:
/usr/local/xxx/yyy/zzz /dev/cuaV0 &
If started manually after boot up, it works as intended, but here is
the problem, it is started before socat, because
# rcorder /etc/rc.d/* /usr/local/etc/rc.d/* | grep local
/etc/rc.d/mountcritlocal
/usr/local/etc/rc.d/dbus
/etc/rc.d/local
/usr/local/etc/rc.d/socat
(some more entries edited out, not relevant to the issue).
So the question is how could I alter boot order to start /etc/rc.local
*after* socat instance. I tried, altering /etc/rc.d/local line (naively)
# REQUIRE: DAEMON
to
# REQUIRE: DAEMON socat
but this does not work, because then rcorder reports
rcorder: Circular dependency on file `/usr/local/etc/rc.d/socat'.
rcorder: Circular dependency on provision `LOGIN': /etc/rc.d/LOGIN -> /etc/rc.d/local -> /usr/local/etc/rc.d/socat -> /etc/rc.d/LOGIN.
rcorder: `/usr/local/etc/rc.d/socat' was seen in circular dependencies for 1 times.
rcorder: `/etc/rc.d/local' was seen in circular dependencies for 1 times.
rcorder: `/etc/rc.d/LOGIN' was seen in circular dependencies for 1 times.
rcorder: `/usr/local/etc/rc.d/socat' was seen in circular dependencies for 1 times.
I did some more, but no success yet... Anybody to offer some hint I can
try?
Regards,
Milan
--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
I am trying to solve an issue how to start local scripts in proper
order (for my application). Basically, I use net/socat port to create
virtual serial port used to read data from some device (just simple
character stream, with CR LF terminating the record with fixed position
items).
I configured socat instance in /etc/rc.conf:
socat_enable="YES"
and /usr/local/etc/socat-instances.conf:
[moxa]
daemonuser=root
flags="PTY,link=/dev/cuaV0,rawer,wait-slave TCP4:192.168.x.y:5000"
It works - on boot, designated device is contacted and virtual serial
port is created.
For starting program consuming data, I put following in /etc/rc.local:
/usr/local/xxx/yyy/zzz /dev/cuaV0 &
If started manually after boot up, it works as intended, but here is
the problem, it is started before socat, because
# rcorder /etc/rc.d/* /usr/local/etc/rc.d/* | grep local
/etc/rc.d/mountcritlocal
/usr/local/etc/rc.d/dbus
/etc/rc.d/local
/usr/local/etc/rc.d/socat
(some more entries edited out, not relevant to the issue).
So the question is how could I alter boot order to start /etc/rc.local
*after* socat instance. I tried, altering /etc/rc.d/local line (naively)
# REQUIRE: DAEMON
to
# REQUIRE: DAEMON socat
but this does not work, because then rcorder reports
rcorder: Circular dependency on file `/usr/local/etc/rc.d/socat'.
rcorder: Circular dependency on provision `LOGIN': /etc/rc.d/LOGIN -> /etc/rc.d/local -> /usr/local/etc/rc.d/socat -> /etc/rc.d/LOGIN.
rcorder: `/usr/local/etc/rc.d/socat' was seen in circular dependencies for 1 times.
rcorder: `/etc/rc.d/local' was seen in circular dependencies for 1 times.
rcorder: `/etc/rc.d/LOGIN' was seen in circular dependencies for 1 times.
rcorder: `/usr/local/etc/rc.d/socat' was seen in circular dependencies for 1 times.
I did some more, but no success yet... Anybody to offer some hint I can
try?
Regards,
Milan
--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de