From ceb8dd4c132be54f421fb255101e503fac42aa58 Mon Sep 17 00:00:00 2001 From: Colin Booth Date: Thu, 4 Feb 2021 23:52:25 -0800 Subject: services/agetty-generic: use chpst -P instead of setsid The setsid program has a surprise gotcha of backgrounding a process if it already happens to be the session leader. This is ok for runit which never sets the service as a session leader but does not work with other supervisors which might. chpst provides the same setsid(2) functionality without also having the gotcha. Be aware that chpst has issues around gidlist squashing when using the -u or -U options without explicit passing. This behavior is not triggered in this case since chpst is being run as root and not being asked to drop privileges. --- services/agetty-generic/run | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/agetty-generic/run b/services/agetty-generic/run index 41a8cf7..a4cfb06 100755 --- a/services/agetty-generic/run +++ b/services/agetty-generic/run @@ -12,5 +12,5 @@ elif [ -x /sbin/agetty -o -x /bin/agetty ]; then GETTY=agetty fi -exec setsid ${GETTY} ${GETTY_ARGS} \ +exec chpst -P ${GETTY} ${GETTY_ARGS} \ "${tty}" "${BAUD_RATE}" "${TERM_NAME}" -- cgit 1.4.1