#!/sbin/openrc-run # Copyright (c) 2020-2023 Guillermo Ramos. # See the Authors file at the top-level directory of this distribution and # https://github.com/OpenRC/openrc/blob/master/AUTHORS # # This file is part of OpenRC. It is subject to the license terms in # the LICENSE file found in the top-level directory of this # distribution and at https://github.com/OpenRC/openrc/blob/master/LICENSE # This file may not be copied, modified, propagated, or distributed # except according to the terms contained in the LICENSE file. USER=${RC_SVCNAME#*.} SVDIR=/home/$USER/s6/service description="Launch $USER's s6 services" command=/bin/s6-svscan command_args=$SVDIR command_background=yes command_user=$USER pidfile=/var/run/s6-svscan-user.pid output_log=/home/$USER/s6/s6-svscan-user.log error_log=/home/$USER/s6/s6-svscan-user.error.log depend() { need localmount } stop_post() { ebegin "Waiting for any remaining s6 services" echo $SVDIR/* | xargs -n 1 -P 0 runuser -u $USER -- s6-svc -wD eend $? ebegin "Waiting for any remaining s6 service loggers" echo $SVDIR/*/log | xargs -n 1 -P 0 runuser -u $USER -- s6-svc -wD eend $? true }