* Reboot or Shutdown commands dont exit from tty auto
@ 2024-11-24 8:47 lumaro via supervision
2024-11-24 10:57 ` Hoël Bézier
0 siblings, 1 reply; 8+ messages in thread
From: lumaro via supervision @ 2024-11-24 8:47 UTC (permalink / raw)
To: supervision
[-- Attachment #1: Type: text/plain, Size: 736 bytes --]
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:
-----------------
$ cat /sbin/reboot
#!/bin/execlineb -S0
s6-linux-init-hpr -r $@
$ cat /sbin/shutdown
#!/bin/execlineb -S0
s6-linux-init-shutdown $@
$ cat /sbin/poweroff
#!/bin/execlineb -S0
s6-linux-init-hpr -p $@
$ cat /sbin/halt
#!/bin/execlineb -S0
s6-linux-init-hpr -h $@
-----------------
Its normal? What am I doing wrong? Any ideas?
Thanks !!
Luis.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Reboot or Shutdown commands dont exit from tty auto
2024-11-24 8:47 Reboot or Shutdown commands dont exit from tty auto lumaro via supervision
@ 2024-11-24 10:57 ` Hoël Bézier
2024-11-24 12:26 ` lumaro via supervision
0 siblings, 1 reply; 8+ messages in thread
From: Hoël Bézier @ 2024-11-24 10:57 UTC (permalink / raw)
To: supervision
[-- Attachment #1: Type: text/plain, Size: 850 bytes --]
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
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Reboot or Shutdown commands dont exit from tty auto
2024-11-24 10:57 ` Hoël Bézier
@ 2024-11-24 12:26 ` lumaro via supervision
2024-11-24 12:49 ` Re[2]: " Laurent Bercot
0 siblings, 1 reply; 8+ messages in thread
From: lumaro via supervision @ 2024-11-24 12:26 UTC (permalink / raw)
To: Hoël Bézier; +Cc: supervision
[-- Attachment #1: Type: text/plain, Size: 2574 bytes --]
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.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re[2]: Reboot or Shutdown commands dont exit from tty auto
2024-11-24 12:26 ` lumaro via supervision
@ 2024-11-24 12:49 ` Laurent Bercot
2024-11-24 14:46 ` lumaro via supervision
0 siblings, 1 reply; 8+ messages in thread
From: Laurent Bercot @ 2024-11-24 12:49 UTC (permalink / raw)
To: supervision
> 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
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Reboot or Shutdown commands dont exit from tty auto
2024-11-24 12:49 ` Re[2]: " Laurent Bercot
@ 2024-11-24 14:46 ` lumaro via supervision
2024-11-24 16:39 ` [SOLVED] " lumaro via supervision
0 siblings, 1 reply; 8+ messages in thread
From: lumaro via supervision @ 2024-11-24 14:46 UTC (permalink / raw)
To: Laurent Bercot; +Cc: supervision
[-- Attachment #1: Type: text/plain, Size: 753 bytes --]
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.
^ permalink raw reply [flat|nested] 8+ messages in thread
* [SOLVED] Re: Reboot or Shutdown commands dont exit from tty auto
2024-11-24 14:46 ` lumaro via supervision
@ 2024-11-24 16:39 ` lumaro via supervision
2024-11-24 22:47 ` Laurent Bercot
0 siblings, 1 reply; 8+ messages in thread
From: lumaro via supervision @ 2024-11-24 16:39 UTC (permalink / raw)
To: lumaro; +Cc: Laurent Bercot, supervision
[-- Attachment #1: Type: text/plain, Size: 950 bytes --]
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.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [SOLVED] Re: Reboot or Shutdown commands dont exit from tty auto
2024-11-24 16:39 ` [SOLVED] " lumaro via supervision
@ 2024-11-24 22:47 ` Laurent Bercot
2024-11-25 5:00 ` lumaro via supervision
0 siblings, 1 reply; 8+ messages in thread
From: Laurent Bercot @ 2024-11-24 22:47 UTC (permalink / raw)
To: supervision
>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
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [SOLVED] Re: Reboot or Shutdown commands dont exit from tty auto
2024-11-24 22:47 ` Laurent Bercot
@ 2024-11-25 5:00 ` lumaro via supervision
0 siblings, 0 replies; 8+ messages in thread
From: lumaro via supervision @ 2024-11-25 5:00 UTC (permalink / raw)
To: supervision
[-- Attachment #1: Type: text/plain, Size: 788 bytes --]
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.
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2024-11-25 5:01 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-11-24 8:47 Reboot or Shutdown commands dont exit from tty auto lumaro via supervision
2024-11-24 10:57 ` Hoël Bézier
2024-11-24 12:26 ` lumaro via supervision
2024-11-24 12:49 ` Re[2]: " Laurent Bercot
2024-11-24 14:46 ` lumaro via supervision
2024-11-24 16:39 ` [SOLVED] " lumaro via supervision
2024-11-24 22:47 ` Laurent Bercot
2024-11-25 5:00 ` lumaro via supervision
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).