Re: [SOLVED] Re: Reboot or Shutdown commands dont exit from tty auto

2024-11-24 Thread lumaro via supervision

El 2024-11-24 23:47, Laurent Bercot escribió:

Can I do anything to make my agetty behave compatible or accept this 
signal? The solution would be to implement ngetty?


No, it's just historical behaviour for terminal managers to die on
SIGHUP instead of SIGTERM, and it kind of makes sense too. There's
nothing to fix here, because the fix would cause more chaos than it
solves problems. It is, unfortunately, just something you need to
remember: when supervising a getty, always set the down-signal to
SIGHUP.

--
Laurent


A very important detail that has had me stuck for months not to ask, 
very clarifying your answer Laurent, thank you for creating an 
alternative to systemd, I will continue to move forward until I fully 
adopt s6 system. A hug.

--
Luis.

Re: [SOLVED] Re: Reboot or Shutdown commands dont exit from tty auto

2024-11-24 Thread Laurent Bercot

Can I do anything to make my agetty behave compatible or accept this signal? 
The solution would be to implement ngetty?


 No, it's just historical behaviour for terminal managers to die on
SIGHUP instead of SIGTERM, and it kind of makes sense too. There's
nothing to fix here, because the fix would cause more chaos than it
solves problems. It is, unfortunately, just something you need to
remember: when supervising a getty, always set the down-signal to
SIGHUP.

--
 Laurent



[SOLVED] Re: Reboot or Shutdown commands dont exit from tty auto

2024-11-24 Thread lumaro via supervision

El 2024-11-24 15:46, lumaro via supervision escribió:


El 2024-11-24 13:49, Laurent Bercot escribió:

Would it then be correct to remove agetty from the supervised?
No, you should be able to run a shutdown command from any terminal,
the design of s6-linux-init is made for that use case.

What's happening is that your agetty is resistant to the signal it's
being sent, so it's not dying when it should.

Some implementations of getty explicitly resist SIGTERM. So, try
"echo SIGHUP > down-signal" in the service directory for your agetty.

--
Laurent


Thank you Laurent, it works perfectly with that "echo", at least I'm not 
crazy xDD


Can I do anything to make my agetty behave compatible or accept this 
signal? The solution would be to implement ngetty?


Thanks again, Luis.

Thanks all, solved.

Added down-signal file into tty* service dir .

 $ cat /etc/s6/sv/tty1/down-signal
SIGHUP

Works fine.

Thanks, Luis.

Re: Reboot or Shutdown commands dont exit from tty auto

2024-11-24 Thread lumaro via supervision

El 2024-11-24 13:49, Laurent Bercot escribió:


Would it then be correct to remove agetty from the supervised?


No, you should be able to run a shutdown command from any terminal,
the design of s6-linux-init is made for that use case.

What's happening is that your agetty is resistant to the signal it's
being sent, so it's not dying when it should.

Some implementations of getty explicitly resist SIGTERM. So, try
"echo SIGHUP > down-signal" in the service directory for your agetty.

--
Laurent


Thank you Laurent, it works perfectly with that "echo", at least I'm not 
crazy xDD


Can I do anything to make my agetty behave compatible or accept this 
signal? The solution would be to implement ngetty?


Thanks again, Luis.

Re: Reboot or Shutdown commands dont exit from tty auto

2024-11-24 Thread lumaro via supervision

El 2024-11-24 11:57, Hoël Bézier escribió:

Am So, Nov 24, 2024 am 09:47:56 +0100 schrieb lumaro via supervision: 
Hi all,


When I try to restart or shutdown from the tty, user or root, the
process displays a message and waits until "exit" is executed and then
continues with the restart or shutdown...

Example:
--
$ doas reboot

*** WARNING ***
The system id going down NOW!
$
-- Then run "exit" and *shutdownd*" continues the process ...


My scripts:
I have the same scripts as you and did not experience this issue, so I 
guess it comes from elsewhere.


My best guess would be your tty is part of your supervised processes, 
and is not torn down by your service manager until after you've closed 
it. And since shutdownd usually waits for s6-rc to stop the whole 
service tree before going on, that might explain it.


Hoël

Hi !

Thank you for the prompt response, indeed "agetty" is supervised.

s6-svscan-+-at-spi-bus-laun---3*[{at-spi-bus-laun}]
  |-firefox-+-Isolated Servic---30*[{Isolated Servic}]
  | |-5*[Isolated Web Co---27*[{Isolated Web Co}]]
  | |-Isolated Web Co---35*[{Isolated Web Co}]
  | |-Isolated Web Co---31*[{Isolated Web Co}]
  | |-3*[Isolated Web Co---26*[{Isolated Web Co}]]
  | |-Privileged Cont---27*[{Privileged Cont}]
  | |-RDD Process---13*[{RDD Process}]
  | |-Socket Process---5*[{Socket Process}]
  | |-Utility Process---4*[{Utility Process}]
  | |-Web Content---19*[{Web Content}]
  | |-2*[Web Content---18*[{Web Content}]]
  | |-WebExtensions---26*[{WebExtensions}]
  | |-firefox
  | `-128*[{firefox}]
  |-foot-+-mksh
  |  |-mksh---pstree
  |  |-mksh---vim---{vim}
  |  `-48*[{foot}]
  |-3*[footclient]
  |-gvfsd---3*[{gvfsd}]
  |-2*[s6-supervise---s6-ipcserverd]
  |-4*[s6-supervise---s6-log]
  |-s6-supervise---s6-linux-init-s
  |-s6-supervise---agetty
  |-s6-supervise---dbus-run-sessio-+-dbus-daemon
  |`-sway---23*[{sway}]
  |-7*[s6-supervise]
  |-s6-supervise---seatd
  |-s6-supervise---ucspilogd
  |-s6-supervise---udevd
  |-s6-supervise---s6-fdholderd
  `-swaybg

Would it then be correct to remove agetty from the supervised?

Thanks, Luis.

Re: Reboot or Shutdown commands dont exit from tty auto

2024-11-24 Thread Hoël Bézier

Am So, Nov 24, 2024 am 09:47:56 +0100 schrieb lumaro via supervision:

Hi all,

When I try to restart or shutdown from the tty, user or root, the
process displays a message and waits until "exit" is executed and then
continues with the restart or shutdown...

Example:
--
$ doas reboot

*** WARNING ***
The system id going down NOW!
$
--

Then run "exit" and *shutdownd*" continues the process ...


My scripts:


I have the same scripts as you and did not experience this issue, so I guess it 
comes from elsewhere.


My best guess would be your tty is part of your supervised processes, and is 
not torn down by your service manager until after you’ve closed it. And since 
shutdownd usually waits for s6-rc to stop the whole service tree before going 
on, that might explain it.


Hoël


signature.asc
Description: PGP signature