supervision - discussion about system services, daemon supervision, init, runlevel management, and tools such as s6 and runit
 help / color / mirror / Atom feed
* s6-rc : Anomalies or normal behaviour
@ 2020-10-03 22:30 Dewayne Geraghty
  2020-10-04  1:58 ` Dewayne Geraghty
  2020-10-04  2:14 ` Laurent Bercot
  0 siblings, 2 replies; 6+ messages in thread
From: Dewayne Geraghty @ 2020-10-03 22:30 UTC (permalink / raw)
  To: supervision

Is this correct behaviour or are these just anomalies?
1. Use of backtick variable assignment on FreeBSD doesn't appear correct
2. Use of emptyenv results in a remnant "defunct" process
3. Should a bundle's contents file include the dependencies of its
contents file, for a down change to the bundle to bring the service's
components down?

1. I expected to see the date in seconds since time epoch, but result is
variable name
# execlineb -Pc 'backtick D { date "+%s" } echo $D'

Note: this isn't how I intend to use backtick, but I try to use the
simplest case to understand how things work

2. When I use emptyenv within an execlineb script, I have a "defunct"
zombie process
89685  3  S<       0:00.01   |-- s6-supervise base:time-srv
 3020  -  S<s      0:00.03   | `-- /usr/local/sbin/ntpd -c /etc/ntp.conf
-N -g -u ntpd --nofork
 3601  -  Z<       0:00.00   |   `-- <defunct>

The time server script is
#!/usr/local/bin/execlineb -P
multidefine -d " " "base time ntpd /usr/local/sbin/ntpd" { JAIL SERVICE
background { echo Starting service $SERVICE using $PROGRAM on $JAIL
under user $USER }
fdmove 2 1
redirfd -w 1 /m/base:time/fifo
$PROGRAM -c /etc/ntp.conf -N -g -u $USER --nofork

removing emptyenv, prevents the zombie from being created.  Is this normal?

3. Is it normal/standard/good practice to include a dependency in a
bundle.  For example, I have a "time" bundle whose contents are
time-srv.  time-srv starts the ntpd service, and has as a dependency

Using "s6-rc -u change time", everything behaves as documented, ie
starts "time" which starts time-log, then time-srv.  However

# s6-rc -v 9 -d change base:time
s6-rc: info: bringing selected services down
s6-rc: info: processing service base:time-srv: stopping
s6-rc: info: service base:time-srv stopped successfully
# Starting logging service time for base with user s6log folder

and the time-log continues running.

# s6-svstat /s/scan/base:time-srv ; s6-svstat /s/scan/base:time-log
down (exitcode 0) 6 seconds, ready 6 seconds  # This is time-srv
up (pid 85131) 6 seconds                      # This is time-log,so it
has been restarted

To obtain the desired/expected behaviour and bring time-log down must it
also be added to the bundle's contents?

These observations were made using FreeBSD 12.2Stable on amd64.

Apologies for still asking newbie questions, but I'm trying to embed s6
here, which translates to properly understand.
Regards, Dewayne.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-10-06 10:29 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-03 22:30 s6-rc : Anomalies or normal behaviour Dewayne Geraghty
2020-10-04  1:58 ` Dewayne Geraghty
2020-10-04  2:20   ` Laurent Bercot
2020-10-04  2:14 ` Laurent Bercot
2020-10-06  3:57   ` Dewayne Geraghty
2020-10-06 10:29     ` Laurent Bercot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).