9front - general discussion about 9front
 help / color / mirror / Atom feed
From: Rocky Hotas <rockyhotas@firemail.cc>
To: 9front@9front.org
Cc: ori@eigenstate.org
Subject: Re: Re: Re: [9front] Enabling a service
Date: Tue, 7 May 2024 10:22:30 +0200	[thread overview]
Message-ID: <pydbxa4romck3nl2jajfi5zuqnrunuaitsnqmqfgfdacy7q26s@cglis4f2tia6> (raw)
In-Reply-To: <F58ACC112A2AF095A7CAE62BD6CD5301@eigenstate.org>

On mag 06 19:00, ori@eigenstate.org wrote:
> % g listen /bin/cpurc
> /bin/cpurc:26: # usb listener
> /bin/cpurc:108: 	aux/listen -q -t /rc/bin/service.auth -d $serviced tcp
> /bin/cpurc:112: 	aux/listen -q -d $serviced tcp
> /bin/cpurc:122: # other /proc files, such as note, so let listen be killed
> 
> the invocation on line 112 is what you're looking for.

Ok! I make a recap if it can be useful for any other having the same
issue.

As in this example

aux/listen -q -t /rc/bin/service.auth -d /rc/bin/service tcp

from

 <https://9p.io/wiki/plan9/Configuring_a_Standalone_CPU_Server/index.html>

`$serviced' is (in my default 9front installation) /rc/bin/service.

After some attempts, this worked for me:

term% cd /rc/bin/service
term% mv !tcp7 tcp7
term% aux/listen -q -d /rc/bin/service tcp

This way, all the services represented by files whose names are in
the form `tcp<port_number>' in /rc/bin/service are enabled.
Files whose names have a trailing `!' are excluded, instead.

The contents of file tcp7 determines how the service will behave when
someone connects to it: in this case,

term% cat tcp7
#!/bin/rc
/bin/cat

And the client will get an echo of anything is typed, due to `cat'.

According to listen(8), the service directory (`/rc/bin/service' in my
example) is also periodically scanned for changes in the files. It gets
updated within seconds probably: so, after running `aux/listen -q
-d /rc/bin/service tcp', if the contents of the file `tcp<port_number>'
or the filename itself are modified, the system will behave accordingly
without need for any other action.

Thank you so much!

Rocky

  reply	other threads:[~2024-05-07  8:25 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-06 11:32 Rocky Hotas
2024-05-06 11:58 ` Alex Musolino
2024-05-06 12:43 ` ori
2024-05-06 15:16   ` Scott Flowers
2024-05-06 15:37     ` sirjofri
2024-05-06 16:32     ` Stanley Lieber
2024-05-06 22:18   ` Rocky Hotas
2024-05-06 22:59     ` ori
2024-05-06 23:00     ` ori
2024-05-07  8:22       ` Rocky Hotas [this message]
2024-05-07  8:29         ` Frank D. Engel, Jr.
2024-05-07  9:03           ` Rocky Hotas
2024-05-07  9:14         ` sirjofri
2024-05-07 21:11           ` Shawn Rutledge
2024-05-07 21:35             ` Kurt H Maier
2024-05-07 21:45               ` sirjofri
2024-05-07 21:54             ` sl
2024-05-07 21:58               ` sl
2024-05-07 23:15                 ` Lennart Jablonka
2024-05-07 23:16                 ` Shawn Rutledge
2024-05-07 23:45                   ` Shawn Rutledge
2024-05-08  0:34                   ` Kurt H Maier
2024-05-08  0:35                   ` sl
2024-05-08  1:05                     ` Jacob Moody
2024-05-08  1:24                       ` sl
2024-05-08  7:22                         ` hiro
2024-05-08 14:04                           ` Stanley Lieber
2024-05-08 12:08                         ` Stuart Morrow
2024-05-08 16:37                           ` Brian Stuart
2024-05-08 20:16                             ` hiro
2024-05-08 21:26                               ` Stuart Morrow
2024-05-08 21:17                             ` Disconnection-tolerant / distributed filesystems (was Re: [9front] Enabling a service) Shawn Rutledge
2024-05-08 14:25                         ` [9front] Enabling a service Jacob Moody
2024-05-08  3:41                       ` Ori Bernstein
2024-05-08  4:09                         ` sl
2024-05-08  8:39                           ` Frank D. Engel, Jr.
2024-05-08 14:17                             ` Jacob Moody
2024-05-08 15:49                               ` Frank D. Engel, Jr.
2024-05-08 16:10                                 ` Jacob Moody
2024-05-08 16:33                                   ` Frank D. Engel, Jr.
2024-05-08 17:27                                     ` Jacob Moody
2024-05-08 18:00                                       ` Steve Simon
2024-05-08 19:46                                         ` hiro
2024-05-08 19:46                                   ` Roberto E. Vargas Caballero
2024-05-08 20:34                                     ` tlaronde
2024-05-08 14:57                   ` Lucas Francesco
2024-05-08 15:10                     ` an2qzavok
2024-05-08  2:11             ` Thaddeus Woskowiak

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=pydbxa4romck3nl2jajfi5zuqnrunuaitsnqmqfgfdacy7q26s@cglis4f2tia6 \
    --to=rockyhotas@firemail.cc \
    --cc=9front@9front.org \
    --cc=ori@eigenstate.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).