From nobody Tue Feb 13 11:19:37 2024 X-Original-To: freebsd-hackers@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TYzPd6Bslz5B46v for ; Tue, 13 Feb 2024 11:19:49 +0000 (UTC) (envelope-from freebsd-hackers@dino.sk) Received: from cm0.netlabit.sk (mailhost.netlabit.sk [84.245.65.72]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4TYzPc6rTQz40PT for ; Tue, 13 Feb 2024 11:19:48 +0000 (UTC) (envelope-from freebsd-hackers@dino.sk) Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of freebsd-hackers@dino.sk designates 84.245.65.72 as permitted sender) smtp.mailfrom=freebsd-hackers@dino.sk Received: from zeta.dino.sk ([84.245.95.254]) (AUTH: LOGIN milan, TLS: TLSv1.3,256bits,TLS_AES_256_GCM_SHA384) by cm0.netlabit.sk with ESMTPSA id 0000000002B8CEAA.0000000065CB504B.00015564; Tue, 13 Feb 2024 12:19:39 +0100 Date: Tue, 13 Feb 2024 12:19:37 +0100 From: Milan Obuch To: freebsd-hackers@freebsd.org Subject: rcorder question Message-ID: <20240213121936.2c0fc4c0@zeta.dino.sk> X-Mailer: Claws Mail 3.20.0 (GTK+ 2.24.33; amd64-portbld-freebsd13.1) List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spamd-Bar: -- X-Spamd-Result: default: False [-2.99 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-0.999]; NEURAL_HAM_SHORT(-0.69)[-0.689]; R_SPF_ALLOW(-0.20)[+mx]; MIME_GOOD(-0.10)[text/plain]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; RCVD_COUNT_ONE(0.00)[1]; ASN(0.00)[asn:5578, ipnet:84.245.64.0/18, country:SK]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_ALL(0.00)[]; MLMMJ_DEST(0.00)[freebsd-hackers@freebsd.org]; MID_RHS_MATCH_FROMTLD(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; R_DKIM_NA(0.00)[]; TO_DN_NONE(0.00)[]; DMARC_NA(0.00)[dino.sk]; TO_MATCH_ENVRCPT_ALL(0.00)[]; ARC_NA(0.00)[] X-Rspamd-Queue-Id: 4TYzPc6rTQz40PT 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