Query on S6 system shutdown

From: Arjun D R <drarjun95_at_gmail.com>
Date: Thu, 29 Jul 2021 14:13:26 +0530

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
Received on Thu Jul 29 2021 - 10:43:26 CEST

This archive was generated by hypermail 2.4.0 : Thu Jul 29 2021 - 10:44:11 CEST