supervision - discussion about system services, daemon supervision, init, runlevel management, and tools such as s6 and runit
 help / color / mirror / Atom feed
From: Arjun D R <drarjun95@gmail.com>
To: supervision@list.skarnet.org
Subject: Query on S6 system shutdown
Date: Thu, 29 Jul 2021 14:13:26 +0530	[thread overview]
Message-ID: <CAHJ2E==6g2xRaWpNXoC8v-Q38Hr05kGWTFO7pEhjrbKp5cmTnA@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1546 bytes --]

Hi Team,

I am facing an issue at the moment of shutting down the system. Whenever I
reboot the system, it is triggering "s6-rc -v2 -bda change" and stops all
the services. But one service is not responding and it hangs. This blocks
the reboot.

ps -aef | grep s6-rc
root      2770  2707  0 08:24 ?        00:00:00 s6-ipcserverd -1 --
s6-ipcserver-access -v0 -E -l0 -i data/rules -- s6-sudod -t 30000 --
/libexec/s6-rc-oneshot-run -l ../.. --
root      7880  2615  1 08:28 ?        00:00:00 s6-rc -v2 -bda change
root      8603  7880  0 08:28 ?        00:00:00 s6-svlisten1 -D --
/run/s6-rc/servicedirs/critical.service s6-svc -d --
/run/s6-rc/servicedirs/critical.service
root      8755  2620  0 08:28 ttyS0    00:00:00 grep s6-rc

I believe the finish script is not being called by s6-svc. When I run it
manually , the finish script runs and kills the process and graceful
shutdown is happening as expected.

What may be the cause for not triggering the finish script of critical
service.

cat /run/service/critical.service/run.user
#!/bin/execlineb -P
foreground { echo "starting critical service" }
fdmove -c 2 1
envfile -i  /etc/default/critical-env
s6-envdir /etc/s6-rc/source/critical.service/env
<.. many importas commands..>
/usr/bin/critical -b -c /etc/critical/config.json

cat /run/service/critical.service/finish.user
#!/bin/execlineb -P
foreground { echo "Stopping critical service" }
fdmove -c 2 1
backtick -n pid_value { pidof critical }
importas -i pid_value pid_value
/bin/kill -9 -- -${pid_value}


Please help.

Thanks,
Arjun

             reply	other threads:[~2021-07-29  8:43 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-29  8:43 Arjun D R [this message]
2021-07-29 11:33 ` Laurent Bercot

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='CAHJ2E==6g2xRaWpNXoC8v-Q38Hr05kGWTFO7pEhjrbKp5cmTnA@mail.gmail.com' \
    --to=drarjun95@gmail.com \
    --cc=supervision@list.skarnet.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).