S6-FTRIG-LISTEN(8)

πŸ“¦ version 2.15.1.0, in nixpkgs unstable

πŸ’… S6-FTRIG-LISTEN(8) πŸ’…

okay bestie, this is a page from the System Manager’s Manual, and it’s giving β€œsubscribe to a bunch of fifodirs, spawn a program, then wait for the event pattern to hit” energy. Let’s go. 🫢


✨ NAME ✨

  • s6-ftrig-listen β€” subscribe to several s6-fifodir(7)s, spawn a program, then wait for pattern of events to occur on the fifodirs πŸ’–

🌸 SYNOPSIS 🌸

In an execlineb(1) script:

s6-ftrig-listen [-a | -o] [-t timeout] {fifodir-1 regexp-1 fifodir-2
                regexp-2} prog...

πŸ¦‹ DESCRIPTION πŸ¦‹

So s6-ftrig-listen subscribes to fifodir1 with the regexp regexp1, to fifodir2 with regexp2, and so on. Like, all the fifodirs, all the regexps, one big subscription moment. ✨

Then it forks and execs prog... with all its arguments. Main character behavior, honestly. πŸ‘‘

It waits for the series of events received on fifodir-i to match regexp-i. And regexp-i must be Extended Regular Expressions[1]. Periodt. πŸ’…

When the series of read events matches the regexps, s6-ftrig-listen exits 0. πŸŽ€

You can also use s6-ftrig-listen outside an execlineb script by using the internal argv syntax, but heads up:

⚠️ that syntax is an implementation detail and is not documented as stable. Don’t build your whole personality on it, iykyk. πŸ’€

In a shell script, use:

execlineb -Pc 's6-ftrig-listen ...'

to get the benefits of the execlineb brace syntax. slay. 🌈


πŸŽ€ OPTIONS πŸŽ€

  • -t timeout β€” If the events on the fifodirs have not matched the regexps after timeout milliseconds, print an error message on stderr and exit 1. By default, s6-ftrig-listen waits indefinitely for a matching series of events. ⏳
  • -a β€” And (conjunction). s6-ftrig-listen will only exit when all the fifodir-i have been notified with events matching the corresponding regexp-i. This is the default. πŸ’–
  • -o β€” Or (disjunction). s6-ftrig-listen will exit as soon as one of the fifodir-i has been notified with events matching its regexp-i. ⚑

πŸ‘‘ SEE ALSO πŸ‘‘

[1] https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/V1_chap09.html#tag_09_04

This man page is ported from the authoritative documentation at: https://skarnet.org/software/s6/s6-ftrig-listen.html 🧚


πŸ’œ AUTHORS πŸ’œ

  • Laurent Bercot
  • Alexis <flexibeast@gmail.com> (man page port)

okay that’s the whole page, bestie β€” this one’s the Debian version, dated September 29, 2021. bye byeee! πŸ’‹πŸŽ€

πŸ“¦ where this page comes from