13 Commits

Author SHA1 Message Date
be5c4f8c45 call proper sh lib 2024-04-21 15:31:55 +02:00
5b6b2b333b set sv name defaults 2024-04-21 15:28:14 +02:00
42079b4149 drop local scripts 2024-04-21 15:20:11 +02:00
cddbda97aa upd sv cg 2024-04-21 15:18:56 +02:00
94ea2fe509 rm leftovers 2024-04-20 22:27:50 +02:00
5c0a46baff upd deps 2024-04-20 22:26:33 +02:00
c2b343f55e update deps 2024-04-20 22:23:53 +02:00
1b9fb8a8db add sv cg settings 2024-04-20 21:48:26 +02:00
9bc59c1106 update cg oneshots 2024-04-20 21:14:22 +02:00
180eca1cc6 add elogind cg 2024-04-20 20:59:55 +02:00
3bb69889e6 add dbus sv 2024-04-20 20:58:20 +02:00
a799e8ac78 add up/down 2024-04-20 20:50:18 +02:00
5bafd95c27 add sv cg oneshots 2024-04-20 20:30:26 +02:00
64 changed files with 516 additions and 155 deletions

2
.gitignore vendored Normal file
View File

@@ -0,0 +1,2 @@
generic/

View File

@@ -1,15 +0,0 @@
#!/bin/sh
mountpoint -q /proc/sys/fs/binfmt_misc || \
mount -t binfmt_misc binfmt /proc/sys/fs/binfmt_misc
for path in /usr/lib/binfmt.d /etc/binfmt.d /run/binfmt.d; do
[ ! -d $path ] && continue
[ -z "$(ls $path)" ] && continue
grep -h "^:" $path/* | \
while read -r line; do
reg=${line#*:}
[ -e /proc/sys/fs/binfmt_misc/${reg%%:*} ] && echo -1 > /proc/sys/fs/binfmt_misc/${reg%%:*}
printf "%s" "$line" > /proc/sys/fs/binfmt_misc/register
done
done

View File

@@ -1,2 +1,2 @@
#!/bin/execlineb -P
exec sh /etc/s6/sv/binfmt/shell_up
exec sh /usr/lib/artix/binfmt.sh

9
dbus-cg/down Normal file
View File

@@ -0,0 +1,9 @@
#!/bin/execlineb -P
envfile /etc/s6/config/dbus.conf
importas -uD "dbus" SV_NAME
importas -uD "" SV_CG_SEND_SIGHUP
importas -uD "" SV_CG_TIMEOUT_STOPSEC
importas -uD "" SV_CG_SEND_SIGKILL
exec sh /usr/lib/artix/sv-cg.sh down $SV_NAME $SV_CG_SEND_SIGHUP $SV_CG_TIMEOUT_STOPSEC $SV_CG_SEND_SIGKILL

1
dbus-cg/type Normal file
View File

@@ -0,0 +1 @@
oneshot

7
dbus-cg/up Normal file
View File

@@ -0,0 +1,7 @@
#!/bin/execlineb -P
envfile /etc/s6/config/dbus.conf
importas -uD "dbus" SV_NAME
importas -uD "" SV_CG_SETTINGS
exec sh /usr/lib/artix/sv-cg.sh up $SV_NAME $SV_CG_SETTINGS

1
dbus-log/consumer-for Normal file
View File

@@ -0,0 +1 @@
dbus-srv

1
dbus-log/notification-fd Normal file
View File

@@ -0,0 +1 @@
3

1
dbus-log/pipeline-name Normal file
View File

@@ -0,0 +1 @@
dbus

9
dbus-log/run Normal file
View File

@@ -0,0 +1,9 @@
#!/bin/execlineb -P
envfile /etc/s6/config/dbus.conf
importas -sCuD "n3 s2000000 T" DIRECTIVES DIRECTIVES
ifelse { test -w /var/log } {
foreground { install -d -o s6log -g s6log /var/log/dbus }
s6-setuidgid s6log exec -c s6-log -d3 -b -- ${DIRECTIVES} /var/log/dbus
}
foreground { install -d -o s6log -g s6log /run/log/dbus }
s6-setuidgid s6log exec -c s6-log -d3 -b -- ${DIRECTIVES} /run/log/dbus

1
dbus-log/type Normal file
View File

@@ -0,0 +1 @@
longrun

View File

1
dbus-srv/notification-fd Normal file
View File

@@ -0,0 +1 @@
3

1
dbus-srv/producer-for Normal file
View File

@@ -0,0 +1 @@
dbus-log

11
dbus-srv/run Normal file
View File

@@ -0,0 +1,11 @@
#!/bin/execlineb -P
foreground { dbus-uuidgen --ensure=/etc/machine-id }
foreground { install -m755 -g 81 -o 81 -d /run/dbus }
foreground {
envfile /etc/s6/config/dbus.conf
importas -uD "no" DBUS_UUIDGEN DBUS_UUIDGEN
if { test ${DBUS_UUIDGEN} = "yes" }
redirfd -w 1 /etc/machine-id dbus-uuidgen
}
fdmove -c 2 1
exec dbus-daemon --system --nofork --nopidfile --print-pid=3

1
dbus-srv/type Normal file
View File

@@ -0,0 +1 @@
longrun

42
dbus.conf Normal file
View File

@@ -0,0 +1,42 @@
# Set to "yes" to regenerate the dbus machine id everytime the service
# is brought up. The dbus documentation only expects the machine id to
# persist during one boot session however systemd says it must persist
# across every boot (i.e. never change). While many applications only
# care if the machine-id is consistent during runtime, there are some
# that do expect it to always stay the same.
DBUS_UUIDGEN="no"
# This configures the directives used for s6-log in the log service.
DIRECTIVES="n3 s2000000 T"
# This variable contains the cgroups version 2 settings for your services.
# If this is set in this file, the settings will apply to all services.
# If you want different settings for each service, place the settings in
# /etc/conf.d/foo for service foo.
# The format is to specify the setting and value followed by a newline.
# Multiple settings and values can be specified.
# For example, you would use this to set the maximum memory and maximum
# number of pids for a service.
#SV_CG_SETTINGS="
#memory.max 10485760
#pids.max max
#"
#
# For more information about the adjustments that can be made with
# cgroups version 2, see Documentation/cgroups-v2.txt in the linux kernel
# source tree.
#SV_CG_SETTINGS=""
# If this is yes, we will send sighup to the processes in the cgroup
# immediately after stopsig and sigcont.
#SV_CG_SEND_SIGHUP="NO"
# This is the amount of time in seconds that we delay after sending sigcont
# and optionally sighup, before we optionally send sigkill to all
# processes in the # cgroup.
# The default is 90 seconds.
#SV_CG_TIMEOUT_STOPSEC="90"
# If this is set to no, we do not send sigkill to all processes in the
# cgroup.
#SV_CG_SEND_SIGKILL="YES"

9
elogind-cg/down Normal file
View File

@@ -0,0 +1,9 @@
#!/bin/execlineb -P
envfile /etc/s6/config/elogind.conf
importas -uD "elogind" SV_NAME
importas -uD "" SV_CG_SEND_SIGHUP
importas -uD "" SV_CG_TIMEOUT_STOPSEC
importas -uD "" SV_CG_SEND_SIGKILL
exec sh /usr/lib/artix/sv-cg.sh down $SV_NAME $SV_CG_SEND_SIGHUP $SV_CG_TIMEOUT_STOPSEC $SV_CG_SEND_SIGKILL

1
elogind-cg/type Normal file
View File

@@ -0,0 +1 @@
oneshot

7
elogind-cg/up Normal file
View File

@@ -0,0 +1,7 @@
#!/bin/execlineb -P
envfile /etc/s6/config/elogind.conf
importas -uD "elogind" SV_NAME
importas -uD "" SV_CG_SETTINGS
exec sh /usr/lib/artix/sv-cg.sh up $SV_NAME $SV_CG_SETTINGS

31
elogind.conf Normal file
View File

@@ -0,0 +1,31 @@
# This variable contains the cgroups version 2 settings for your services.
# If this is set in this file, the settings will apply to all services.
# If you want different settings for each service, place the settings in
# /etc/conf.d/foo for service foo.
# The format is to specify the setting and value followed by a newline.
# Multiple settings and values can be specified.
# For example, you would use this to set the maximum memory and maximum
# number of pids for a service.
#SV_CG_SETTINGS="
#memory.max 10485760
#pids.max max
#"
#
# For more information about the adjustments that can be made with
# cgroups version 2, see Documentation/cgroups-v2.txt in the linux kernel
# source tree.
#SV_CG_SETTINGS=""
# If this is yes, we will send sighup to the processes in the cgroup
# immediately after stopsig and sigcont.
#SV_CG_SEND_SIGHUP="NO"
# This is the amount of time in seconds that we delay after sending sigcont
# and optionally sighup, before we optionally send sigkill to all
# processes in the # cgroup.
# The default is 90 seconds.
#SV_CG_TIMEOUT_STOPSEC="90"
# If this is set to no, we do not send sigkill to all processes in the
# cgroup.
#SV_CG_SEND_SIGKILL="YES"

View File

View File

2
elogind/run Normal file
View File

@@ -0,0 +1,2 @@
#!/bin/execlineb -P
exec /usr/lib/elogind/elogind

1
elogind/type Normal file
View File

@@ -0,0 +1 @@
longrun

View File

@@ -1,19 +0,0 @@
#!/bin/sh
# This is run by the kernel after the last task is removed from a
# control group in the openrc hierarchy.
# Copyright (c) 2007-2015 The OpenRC Authors.
# 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.
cgroup=/sys/fs/cgroup/openrc
PATH=/bin:/usr/bin:/sbin:/usr/sbin
if [ -d ${cgroup}/"$1" ]; then
rmdir ${cgroup}/"$1"
fi

View File

@@ -1,119 +0,0 @@
#!/bin/sh
CGROUP_OPTS=nodev,noexec,nosuid
CGROUP_MODE="$1"
CGROUP_CONTROLLERS="$2"
HAVE_CONTROLLER1_GROUPS="$3"
if [ $CGROUP_CONTROLLERS = "none" ]; then
CGROUP_CONTROLLERS=""
fi
cgroup2_find_path() {
if grep -qw cgroup2 /proc/filesystems; then
case "${CGROUP_MODE}" in
hybrid) printf "/sys/fs/cgroup/unified" ;;
unified) printf "/sys/fs/cgroup" ;;
esac
fi
return 0
}
cgroup1_base() {
grep -qw cgroup /proc/filesystems || return 0
if ! mountpoint -q /sys/fs/cgroup; then
local opts="${CGROUP_OPTS},mode=755,size=${rc_cgroupsize:-10m}"
mount -n -t tmpfs -o "${opts}" cgroup_root /sys/fs/cgroup
fi
if ! mountpoint -q /sys/fs/cgroup/openrc; then
local agent="/etc/s6/sv/mount-cgroups/cgroup-release-agent.sh"
mkdir /sys/fs/cgroup/openrc
mount -n -t cgroup -o none,${CGROUP_OPTS},name=openrc,release_agent="$agent" openrc /sys/fs/cgroup/openrc
printf 1 > /sys/fs/cgroup/openrc/notify_on_release
fi
return 0
}
cgroup1_controllers() {
${HAVE_CONTROLLER1_GROUPS} && [ -e /proc/cgroups ] && grep -qw cgroup /proc/filesystems || return 0
while read -r name _ _ enabled _; do
case "${enabled}" in
1) if mountpoint -q "/sys/fs/cgroup/${name}";then continue;fi
local x
for x in $CGROUP_CONTROLLERS; do
[ "${name}" = "blkio" ] && [ "${x}" = "io" ] &&
continue 2
[ "${name}" = "${x}" ] &&
continue 2
done
mkdir "/sys/fs/cgroup/${name}"
mount -n -t cgroup -o "${CGROUP_OPTS},${name}" "${name}" "/sys/fs/cgroup/${name}"
;;
esac
done < /proc/cgroups
return 0
}
cgroup2_base() {
grep -qw cgroup2 /proc/filesystems || return 0
local base
base="$(cgroup2_find_path)"
mkdir -p "${base}"
mount -t cgroup2 none -o "${CGROUP_OPTS},nsdelegate" "${base}" 2> /dev/null ||
mount -t cgroup2 none -o "${CGROUP_OPTS}" "${base}"
return 0
}
cgroup2_controllers() {
grep -qw cgroup2 /proc/filesystems || return 0
local active cgroup_path x
cgroup_path="$(cgroup2_find_path)"
[ -z "${cgroup_path}" ] && return 0
[ ! -e "${cgroup_path}/cgroup.controllers" ] && return 0
[ ! -e "${cgroup_path}/cgroup.subtree_control" ] && return 0
read -r active < "${cgroup_path}/cgroup.controllers"
for x in ${active}; do
echo "+${x}" > "${cgroup_path}/cgroup.subtree_control"
done
return 0
}
cgroups_hybrid() {
cgroup1_base
cgroup2_base
cgroup2_controllers
cgroup1_controllers
return 0
}
cgroups_legacy() {
cgroup1_base
cgroup1_controllers
return 0
}
cgroups_unified() {
cgroup2_base
cgroup2_controllers
return 0
}
mount_cgroups() {
case "${CGROUP_MODE}" in
hybrid) cgroups_hybrid ;;
legacy) cgroups_legacy ;;
unified) cgroups_unified ;;
esac
return 0
}
mount_cgs() {
if [ -d /sys/fs/cgroup ];then
mount_cgroups
return 0
fi
return 1
}
mount_cgs

View File

@@ -3,4 +3,4 @@ envfile /etc/s6/config/mount-cgroups.conf
importas -uD "unified" CGROUP_MODE CGROUP_MODE
importas -uD "none" CGROUP_CONTROLLERS CGROUP_CONTROLLERS
importas -uD "true" HAVE_CONTROLLER1_GROUPS HAVE_CONTROLLER1_GROUPS
exec sh /etc/s6/sv/mount-cgroups/shell_up $CGROUP_MODE $CGROUP_CONTROLLERS $HAVE_CONTROLLER1_GROUPS
exec sh /usr/lib/artix/mount-cgroups.sh $CGROUP_MODE $CGROUP_CONTROLLERS $HAVE_CONTROLLER1_GROUPS

9
tty1-cg/down Normal file
View File

@@ -0,0 +1,9 @@
#!/bin/execlineb -P
envfile /etc/s6/config/tty1.conf
importas -uD "tty1" SV_NAME
importas -uD "" SV_CG_SEND_SIGHUP
importas -uD "" SV_CG_TIMEOUT_STOPSEC
importas -uD "" SV_CG_SEND_SIGKILL
exec sh /usr/lib/artix/sv-cg.sh down $SV_NAME $SV_CG_SEND_SIGHUP $SV_CG_TIMEOUT_STOPSEC $SV_CG_SEND_SIGKILL

1
tty1-cg/type Normal file
View File

@@ -0,0 +1 @@
oneshot

7
tty1-cg/up Normal file
View File

@@ -0,0 +1,7 @@
#!/bin/execlineb -P
envfile /etc/s6/config/tty1.conf
importas -uD "tty1" SV_NAME
importas -uD "" SV_CG_SETTINGS
exec sh /usr/lib/artix/sv-cg.sh up $SV_NAME $SV_CG_SETTINGS

View File

@@ -6,3 +6,35 @@ ARGS=""
# Getty program to use.
GETTY="agetty"
# This variable contains the cgroups version 2 settings for your services.
# If this is set in this file, the settings will apply to all services.
# If you want different settings for each service, place the settings in
# /etc/conf.d/foo for service foo.
# The format is to specify the setting and value followed by a newline.
# Multiple settings and values can be specified.
# For example, you would use this to set the maximum memory and maximum
# number of pids for a service.
#SV_CG_SETTINGS="
#memory.max 10485760
#pids.max max
#"
#
# For more information about the adjustments that can be made with
# cgroups version 2, see Documentation/cgroups-v2.txt in the linux kernel
# source tree.
#SV_CG_SETTINGS=""
# If this is yes, we will send sighup to the processes in the cgroup
# immediately after stopsig and sigcont.
#SV_CG_SEND_SIGHUP="NO"
# This is the amount of time in seconds that we delay after sending sigcont
# and optionally sighup, before we optionally send sigkill to all
# processes in the # cgroup.
# The default is 90 seconds.
#SV_CG_TIMEOUT_STOPSEC="90"
# If this is set to no, we do not send sigkill to all processes in the
# cgroup.
#SV_CG_SEND_SIGKILL="YES"

View File

9
tty2-cg/down Normal file
View File

@@ -0,0 +1,9 @@
#!/bin/execlineb -P
envfile /etc/s6/config/tty2.conf
importas -uD "tty2" SV_NAME
importas -uD "" SV_CG_SEND_SIGHUP
importas -uD "" SV_CG_TIMEOUT_STOPSEC
importas -uD "" SV_CG_SEND_SIGKILL
exec sh /usr/lib/artix/sv-cg.sh down $SV_NAME $SV_CG_SEND_SIGHUP $SV_CG_TIMEOUT_STOPSEC $SV_CG_SEND_SIGKILL

1
tty2-cg/type Normal file
View File

@@ -0,0 +1 @@
oneshot

7
tty2-cg/up Normal file
View File

@@ -0,0 +1,7 @@
#!/bin/execlineb -P
envfile /etc/s6/config/tty2.conf
importas -uD "tty2" SV_NAME
importas -uD "" SV_CG_SETTINGS
exec sh /usr/lib/artix/sv-cg.sh up $SV_NAME $SV_CG_SETTINGS

View File

@@ -6,3 +6,35 @@ ARGS=""
# Getty program to use.
GETTY="agetty"
# This variable contains the cgroups version 2 settings for your services.
# If this is set in this file, the settings will apply to all services.
# If you want different settings for each service, place the settings in
# /etc/conf.d/foo for service foo.
# The format is to specify the setting and value followed by a newline.
# Multiple settings and values can be specified.
# For example, you would use this to set the maximum memory and maximum
# number of pids for a service.
#SV_CG_SETTINGS="
#memory.max 10485760
#pids.max max
#"
#
# For more information about the adjustments that can be made with
# cgroups version 2, see Documentation/cgroups-v2.txt in the linux kernel
# source tree.
#SV_CG_SETTINGS=""
# If this is yes, we will send sighup to the processes in the cgroup
# immediately after stopsig and sigcont.
#SV_CG_SEND_SIGHUP="NO"
# This is the amount of time in seconds that we delay after sending sigcont
# and optionally sighup, before we optionally send sigkill to all
# processes in the # cgroup.
# The default is 90 seconds.
#SV_CG_TIMEOUT_STOPSEC="90"
# If this is set to no, we do not send sigkill to all processes in the
# cgroup.
#SV_CG_SEND_SIGKILL="YES"

View File

9
tty3-cg/down Normal file
View File

@@ -0,0 +1,9 @@
#!/bin/execlineb -P
envfile /etc/s6/config/tty3.conf
importas -uD "tty3" SV_NAME
importas -uD "" SV_CG_SEND_SIGHUP
importas -uD "" SV_CG_TIMEOUT_STOPSEC
importas -uD "" SV_CG_SEND_SIGKILL
exec sh /usr/lib/artix/sv-cg.sh down $SV_NAME $SV_CG_SEND_SIGHUP $SV_CG_TIMEOUT_STOPSEC $SV_CG_SEND_SIGKILL

1
tty3-cg/type Normal file
View File

@@ -0,0 +1 @@
oneshot

7
tty3-cg/up Normal file
View File

@@ -0,0 +1,7 @@
#!/bin/execlineb -P
envfile /etc/s6/config/tty3.conf
importas -uD "tty3" SV_NAME
importas -uD "" SV_CG_SETTINGS
exec sh /usr/lib/artix/sv-cg.sh up $SV_NAME $SV_CG_SETTINGS

View File

@@ -6,3 +6,35 @@ ARGS=""
# Getty program to use.
GETTY="agetty"
# This variable contains the cgroups version 2 settings for your services.
# If this is set in this file, the settings will apply to all services.
# If you want different settings for each service, place the settings in
# /etc/conf.d/foo for service foo.
# The format is to specify the setting and value followed by a newline.
# Multiple settings and values can be specified.
# For example, you would use this to set the maximum memory and maximum
# number of pids for a service.
#SV_CG_SETTINGS="
#memory.max 10485760
#pids.max max
#"
#
# For more information about the adjustments that can be made with
# cgroups version 2, see Documentation/cgroups-v2.txt in the linux kernel
# source tree.
#SV_CG_SETTINGS=""
# If this is yes, we will send sighup to the processes in the cgroup
# immediately after stopsig and sigcont.
#SV_CG_SEND_SIGHUP="NO"
# This is the amount of time in seconds that we delay after sending sigcont
# and optionally sighup, before we optionally send sigkill to all
# processes in the # cgroup.
# The default is 90 seconds.
#SV_CG_TIMEOUT_STOPSEC="90"
# If this is set to no, we do not send sigkill to all processes in the
# cgroup.
#SV_CG_SEND_SIGKILL="YES"

View File

9
tty4-cg/down Normal file
View File

@@ -0,0 +1,9 @@
#!/bin/execlineb -P
envfile /etc/s6/config/tty4.conf
importas -uD "tty4" SV_NAME
importas -uD "" SV_CG_SEND_SIGHUP
importas -uD "" SV_CG_TIMEOUT_STOPSEC
importas -uD "" SV_CG_SEND_SIGKILL
exec sh /usr/lib/artix/sv-cg.sh down $SV_NAME $SV_CG_SEND_SIGHUP $SV_CG_TIMEOUT_STOPSEC $SV_CG_SEND_SIGKILL

1
tty4-cg/type Normal file
View File

@@ -0,0 +1 @@
oneshot

7
tty4-cg/up Normal file
View File

@@ -0,0 +1,7 @@
#!/bin/execlineb -P
envfile /etc/s6/config/tty4.conf
importas -uD "tty4" SV_NAME
importas -uD "" SV_CG_SETTINGS
exec sh /usr/lib/artix/sv-cg.sh up $SV_NAME $SV_CG_SETTINGS

View File

@@ -6,3 +6,35 @@ ARGS=""
# Getty program to use.
GETTY="agetty"
# This variable contains the cgroups version 2 settings for your services.
# If this is set in this file, the settings will apply to all services.
# If you want different settings for each service, place the settings in
# /etc/conf.d/foo for service foo.
# The format is to specify the setting and value followed by a newline.
# Multiple settings and values can be specified.
# For example, you would use this to set the maximum memory and maximum
# number of pids for a service.
#SV_CG_SETTINGS="
#memory.max 10485760
#pids.max max
#"
#
# For more information about the adjustments that can be made with
# cgroups version 2, see Documentation/cgroups-v2.txt in the linux kernel
# source tree.
#SV_CG_SETTINGS=""
# If this is yes, we will send sighup to the processes in the cgroup
# immediately after stopsig and sigcont.
#SV_CG_SEND_SIGHUP="NO"
# This is the amount of time in seconds that we delay after sending sigcont
# and optionally sighup, before we optionally send sigkill to all
# processes in the # cgroup.
# The default is 90 seconds.
#SV_CG_TIMEOUT_STOPSEC="90"
# If this is set to no, we do not send sigkill to all processes in the
# cgroup.
#SV_CG_SEND_SIGKILL="YES"

View File

9
tty5-cg/down Normal file
View File

@@ -0,0 +1,9 @@
#!/bin/execlineb -P
envfile /etc/s6/config/tty5.conf
importas -uD "tty5" SV_NAME
importas -uD "" SV_CG_SEND_SIGHUP
importas -uD "" SV_CG_TIMEOUT_STOPSEC
importas -uD "" SV_CG_SEND_SIGKILL
exec sh /usr/lib/artix/sv-cg.sh down $SV_NAME $SV_CG_SEND_SIGHUP $SV_CG_TIMEOUT_STOPSEC $SV_CG_SEND_SIGKILL

1
tty5-cg/type Normal file
View File

@@ -0,0 +1 @@
oneshot

7
tty5-cg/up Normal file
View File

@@ -0,0 +1,7 @@
#!/bin/execlineb -P
envfile /etc/s6/config/tty5.conf
importas -uD "tty5" SV_NAME
importas -uD "" SV_CG_SETTINGS
exec sh /usr/lib/artix/sv-cg.sh up $SV_NAME $SV_CG_SETTINGS

View File

@@ -6,3 +6,35 @@ ARGS=""
# Getty program to use.
GETTY="agetty"
# This variable contains the cgroups version 2 settings for your services.
# If this is set in this file, the settings will apply to all services.
# If you want different settings for each service, place the settings in
# /etc/conf.d/foo for service foo.
# The format is to specify the setting and value followed by a newline.
# Multiple settings and values can be specified.
# For example, you would use this to set the maximum memory and maximum
# number of pids for a service.
#SV_CG_SETTINGS="
#memory.max 10485760
#pids.max max
#"
#
# For more information about the adjustments that can be made with
# cgroups version 2, see Documentation/cgroups-v2.txt in the linux kernel
# source tree.
#SV_CG_SETTINGS=""
# If this is yes, we will send sighup to the processes in the cgroup
# immediately after stopsig and sigcont.
#SV_CG_SEND_SIGHUP="NO"
# This is the amount of time in seconds that we delay after sending sigcont
# and optionally sighup, before we optionally send sigkill to all
# processes in the # cgroup.
# The default is 90 seconds.
#SV_CG_TIMEOUT_STOPSEC="90"
# If this is set to no, we do not send sigkill to all processes in the
# cgroup.
#SV_CG_SEND_SIGKILL="YES"

View File

9
tty6-cg/down Normal file
View File

@@ -0,0 +1,9 @@
#!/bin/execlineb -P
envfile /etc/s6/config/tty6.conf
importas -uD "tty6" SV_NAME
importas -uD "" SV_CG_SEND_SIGHUP
importas -uD "" SV_CG_TIMEOUT_STOPSEC
importas -uD "" SV_CG_SEND_SIGKILL
exec sh /usr/lib/artix/sv-cg.sh down $SV_NAME $SV_CG_SEND_SIGHUP $SV_CG_TIMEOUT_STOPSEC $SV_CG_SEND_SIGKILL

1
tty6-cg/type Normal file
View File

@@ -0,0 +1 @@
oneshot

7
tty6-cg/up Normal file
View File

@@ -0,0 +1,7 @@
#!/bin/execlineb -P
envfile /etc/s6/config/tty6.conf
importas -uD "tty6" SV_NAME
importas -uD "" SV_CG_SETTINGS
exec sh /usr/lib/artix/sv-cg.sh up $SV_NAME $SV_CG_SETTINGS

View File

@@ -6,3 +6,35 @@ ARGS=""
# Getty program to use.
GETTY="agetty"
# This variable contains the cgroups version 2 settings for your services.
# If this is set in this file, the settings will apply to all services.
# If you want different settings for each service, place the settings in
# /etc/conf.d/foo for service foo.
# The format is to specify the setting and value followed by a newline.
# Multiple settings and values can be specified.
# For example, you would use this to set the maximum memory and maximum
# number of pids for a service.
#SV_CG_SETTINGS="
#memory.max 10485760
#pids.max max
#"
#
# For more information about the adjustments that can be made with
# cgroups version 2, see Documentation/cgroups-v2.txt in the linux kernel
# source tree.
#SV_CG_SETTINGS=""
# If this is yes, we will send sighup to the processes in the cgroup
# immediately after stopsig and sigcont.
#SV_CG_SEND_SIGHUP="NO"
# This is the amount of time in seconds that we delay after sending sigcont
# and optionally sighup, before we optionally send sigkill to all
# processes in the # cgroup.
# The default is 90 seconds.
#SV_CG_TIMEOUT_STOPSEC="90"
# If this is set to no, we do not send sigkill to all processes in the
# cgroup.
#SV_CG_SEND_SIGKILL="YES"

View File

View File

@@ -10,3 +10,35 @@ GETTY="agetty"
# Serial tty address and baud rate
TTY="ttyAMA0"
BAUD_RATE="115200"
# This variable contains the cgroups version 2 settings for your services.
# If this is set in this file, the settings will apply to all services.
# If you want different settings for each service, place the settings in
# /etc/conf.d/foo for service foo.
# The format is to specify the setting and value followed by a newline.
# Multiple settings and values can be specified.
# For example, you would use this to set the maximum memory and maximum
# number of pids for a service.
#SV_CG_SETTINGS="
#memory.max 10485760
#pids.max max
#"
#
# For more information about the adjustments that can be made with
# cgroups version 2, see Documentation/cgroups-v2.txt in the linux kernel
# source tree.
#SV_CG_SETTINGS=""
# If this is yes, we will send sighup to the processes in the cgroup
# immediately after stopsig and sigcont.
#SV_CG_SEND_SIGHUP="NO"
# This is the amount of time in seconds that we delay after sending sigcont
# and optionally sighup, before we optionally send sigkill to all
# processes in the # cgroup.
# The default is 90 seconds.
#SV_CG_TIMEOUT_STOPSEC="90"
# If this is set to no, we do not send sigkill to all processes in the
# cgroup.
#SV_CG_SEND_SIGKILL="YES"

9
udevd-cg/down Normal file
View File

@@ -0,0 +1,9 @@
#!/bin/execlineb -P
envfile /etc/s6/config/udevd.conf
importas -uD "udevd" SV_NAME
importas -uD "" SV_CG_SEND_SIGHUP
importas -uD "" SV_CG_TIMEOUT_STOPSEC
importas -uD "" SV_CG_SEND_SIGKILL
exec sh /usr/lib/artix/sv-cg.sh down $SV_NAME $SV_CG_SEND_SIGHUP $SV_CG_TIMEOUT_STOPSEC $SV_CG_SEND_SIGKILL

1
udevd-cg/type Normal file
View File

@@ -0,0 +1 @@
oneshot

7
udevd-cg/up Normal file
View File

@@ -0,0 +1,7 @@
#!/bin/execlineb -P
envfile /etc/s6/config/udevd.conf
importas -uD "udevd" SV_NAME
importas -uD "" SV_CG_SETTINGS
exec sh /usr/lib/artix/sv-cg.sh up $SV_NAME $SV_CG_SETTINGS

View File

View File

@@ -1,2 +1,34 @@
# This configures the directives used for s6-log in the log service.
DIRECTIVES="n3 s6000000 T"
# This variable contains the cgroups version 2 settings for your services.
# If this is set in this file, the settings will apply to all services.
# If you want different settings for each service, place the settings in
# /etc/conf.d/foo for service foo.
# The format is to specify the setting and value followed by a newline.
# Multiple settings and values can be specified.
# For example, you would use this to set the maximum memory and maximum
# number of pids for a service.
#SV_CG_SETTINGS="
#memory.max 10485760
#pids.max max
#"
#
# For more information about the adjustments that can be made with
# cgroups version 2, see Documentation/cgroups-v2.txt in the linux kernel
# source tree.
#SV_CG_SETTINGS=""
# If this is yes, we will send sighup to the processes in the cgroup
# immediately after stopsig and sigcont.
#SV_CG_SEND_SIGHUP="NO"
# This is the amount of time in seconds that we delay after sending sigcont
# and optionally sighup, before we optionally send sigkill to all
# processes in the # cgroup.
# The default is 90 seconds.
#SV_CG_TIMEOUT_STOPSEC="90"
# If this is set to no, we do not send sigkill to all processes in the
# cgroup.
#SV_CG_SEND_SIGKILL="YES"