Reorganize s6-services

This commit is contained in:
Alex D. 2022-02-05 14:17:59 +00:00
parent 239ad9256e
commit f87e435e70
Signed by: caskd
GPG Key ID: F92BA85F61F4C173
70 changed files with 366 additions and 75 deletions

View File

@ -1,8 +1,8 @@
# Contributor: Alex Denes <caskd@redxen.eu>
# Maintainer: Alex Denes <caskd@redxen.eu>
pkgname=s6-services
pkgver=0.3
pkgrel=6
pkgver=0.5
pkgrel=7
pkgdesc="Base services for s6"
url="none"
arch="noarch"
@ -14,23 +14,26 @@ builddir="$srcdir/"
prepare() {
default_prepare
cp -R "$startdir"/rc "$builddir"/rc
cp -R "$startdir"/env "$builddir"/env
}
package() {
mkdir -p "$pkgdir"/etc
mv "$builddir"/rc "$pkgdir"/etc/s6-rc
mkdir -p "$pkgdir"/etc/s6
mv "$builddir"/rc "$pkgdir"/etc/s6/rc
mv "$builddir"/env "$pkgdir"/etc/s6/env
}
core() {
amove etc/s6-rc/core
amove etc/s6/rc/core
amove etc/s6/env/core
}
net() {
amove etc/s6-rc/net
amove etc/s6/rc/net
}
desktop() {
amove etc/s6-rc/desktop
amove etc/s6/rc/desktop
}
check() {

View File

@ -0,0 +1 @@
/var/log

1
main/s6-services/env/core/path/PATH vendored Normal file
View File

@ -0,0 +1 @@
/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin

View File

@ -1,4 +1,11 @@
#!/bin/execlineb -P
s6-envdir -i /etc/s6/env/core/path
importas -i PATH PATH
emptyenv
export PATH /bin:/sbin:/usr/bin:/usr/sbin
export PATH $PATH
fdclose 1
fdclose 2
exec hwclock -u --systz

View File

@ -1,6 +1,13 @@
#!/bin/execlineb -P
s6-envdir env
importas -D tty1 -u TTY TTY
importas -D 38400 -u BAUD BAUD
export PATH /bin:/sbin:/usr/bin:/usr/sbin
exec getty $BAUD $TTY
s6-envdir -i /etc/s6/env/core/path
importas -i PATH PATH
emptyenv
export PATH $PATH
define BAUD 38400
define TTY tty1
fdclose 1
fdclose 2
exec getty ${BAUD} ${TTY}

View File

@ -1,3 +1,12 @@
#!/bin/execlineb -P
if -t { test -s /etc/hostname } backtick -n -E HOSTNAME { head -1 /etc/hostname }
if -t { test -n $HOSTNAME } redirfd -w 1 /proc/sys/kernel/hostname echo $HOSTNAME
s6-envdir -i /etc/s6/env/core/path
importas -i PATH PATH
emptyenv
define HOSTNAME localhost
export PATH $PATH
fdclose 1
fdclose 2
redirfd -w 1 /proc/sys/kernel/hostname echo $HOSTNAME

View File

@ -1,6 +1,11 @@
#!/bin/execlineb -P
fdmove -c 2 1
redirfd -r 0 /proc/kmsg
s6-envdir -i /etc/s6/env/core/path
importas -i PATH PATH
emptyenv
export PATH /bin:/sbin:/usr/bin:/usr/sbin
exec ucspilogd
export PATH $PATH
define READFROM /proc/kmsg
fdmove -c 2 1
foreground { redirfd -r 0 ${READFROM} } ucspilogd

View File

@ -1,5 +1,17 @@
#!/bin/execlineb -P
s6-envdir -i /etc/s6/env/core/path
importas -i PATH PATH
emptyenv
redirfd -w 2 /dev/null
export PATH /bin:/sbin:/usr/bin:/usr/sbin
if -t { pipeline { pipeline { exec find /sys -name modalias -type f -print0 } exec xargs -0 exec sort -u } exec xargs exec modprobe -b -a -s }
export PATH $PATH
fdclose 1
fdclose 2
if -t {
pipeline {
pipeline {
exec find /sys -name modalias -type f -print0
} exec xargs -0 exec sort -u
} exec xargs exec modprobe -b -a -s
}

View File

@ -1,4 +1,13 @@
#!/bin/execlineb -P
s6-envdir env
importas -D /var/log/klogd -u LOGDEST LOGDEST
s6-log -d3 -- t s1000000 n20 $LOGDEST
s6-envdir -i /etc/s6/env/core/path
importas -i PATH PATH
s6-envdir /etc/s6/env/core/logger
importas -i LOGPREFIX LOGPREFIX
emptyenv
export PATH $PATH
define LOGGERNAME klogd
define LOGSIZE 1000000
define LOGARCHIVES 20
s6-log -d3 -- t s${LOGSIZE} n${LOGARCHIVES} ${LOGPREFIX}/${LOGGERNAME}

View File

@ -1,4 +1,13 @@
#!/bin/execlineb -P
s6-envdir -i /etc/s6/env/core/path
importas -i PATH PATH
s6-envdir /etc/s6/env/core/logger
importas -i LOGPREFIX LOGPREFIX
emptyenv
importas -D /var/log/syslogd -u LOGDEST LOGDEST
s6-log -d3 -- t s1000000 n20 $LOGDEST
export PATH $PATH
define LOGGERNAME syslogd
define LOGSIZE 1000000
define LOGARCHIVES 20
s6-log -d3 -- t s${LOGSIZE} n${LOGARCHIVES} ${LOGPREFIX}/${LOGGERNAME}

View File

@ -1,4 +1,15 @@
#!/bin/execlineb -P
s6-envdir -i /etc/s6/env/core/path
importas -i PATH PATH
emptyenv
export PATH /bin:/sbin:/usr/bin:/usr/sbin
foreground { exec mount -t devtmpfs none /dev } if -nt { importas status ? test $status -eq 1 }
export PATH $PATH
fdclose 1
fdclose 2
foreground {
exec mount -t devtmpfs none /dev
} if -nt {
importas status ? test $status -eq 1
}

View File

@ -1,4 +1,15 @@
#!/bin/execlineb -P
s6-envdir -i /etc/s6/env/core/path
importas -i PATH PATH
emptyenv
export PATH /bin:/sbin:/usr/bin:/usr/sbin
foreground { exec mount -t proc none /proc } if -nt { importas status ? test $status -eq 1 }
export PATH $PATH
fdclose 1
fdclose 2
foreground {
exec mount -t proc none /proc
} if -nt {
importas status ? test $status -eq 1
}

View File

@ -1,4 +1,11 @@
#!/bin/execlineb -P
s6-envdir -i /etc/s6/env/core/path
importas -i PATH PATH
emptyenv
export PATH /bin:/sbin:/usr/bin:/usr/sbin
export PATH $PATH
fdclose 1
fdclose 2
exec mount -t tmpfs none /run

View File

@ -1,4 +1,12 @@
#!/bin/execlineb -P
s6-envdir -i /etc/s6/env/core/path
importas -i PATH PATH
emptyenv
export PATH /bin:/sbin:/usr/bin:/usr/sbin
exec mount -t ext4 -o remount,rw /
export PATH $PATH
define ROOTFSTYPE ext4
fdclose 1
fdclose 2
exec mount -t ${ROOTFSTYPE} -o remount,rw /

View File

@ -1,4 +1,15 @@
#!/bin/execlineb -P
s6-envdir -i /etc/s6/env/core/path
importas -i PATH PATH
emptyenv
export PATH /bin:/sbin:/usr/bin:/usr/sbin
foreground { exec mount -t sysfs none /sys } if -nt { importas status ? test $status -eq 1 }
export PATH $PATH
fdclose 1
fdclose 2
foreground {
exec mount -t sysfs none /sys
} if -nt {
importas status ? test $status -eq 1
}

View File

@ -1,4 +1,11 @@
#!/bin/execlineb -P
s6-envdir -i /etc/s6/env/core/path
importas -i PATH PATH
emptyenv
export PATH /bin:/sbin:/usr/bin:/usr/sbin
export PATH $PATH
fdclose 1
fdclose 2
exec mount -t tmpfs none /tmp

View File

@ -1,4 +1,10 @@
#!/bin/execlineb -P
s6-envdir -i /etc/s6/env/core/path
importas -i PATH PATH
emptyenv
s6-envuidgid nobody
export PATH $PATH
define RUNAS nobody
s6-envuidgid ${RUNAS}
s6-socklog -d3 -U -t3000

View File

@ -0,0 +1 @@
bundle

View File

@ -1 +0,0 @@
:0

View File

@ -1,7 +1,11 @@
#!/bin/execlineb -P
s6-envdir env
importas -D 0 -u DISPLAY DISPLAY
s6-envdir -i /etc/s6/env/core/path
importas -i PATH PATH
emptyenv
export PATH $PATH
export DISPLAY :0
fdmove -c 2 1
export PATH /bin:/sbin:/usr/bin:/usr/sbin
export DISPLAY $DISPLAY
exec dwm

View File

@ -1,4 +1,13 @@
#!/bin/execlineb -P
s6-envdir -i /etc/s6/env/core/path
importas -i PATH PATH
s6-envdir /etc/s6/env/core/logger
importas -i LOGPREFIX LOGPREFIX
emptyenv
importas -D /var/log/dwm -u LOGDEST LOGDEST
s6-log -d3 -- t s1000000 n20 $LOGDEST
export PATH $PATH
define LOGGERNAME dwm
define LOGSIZE 1000000
define LOGARCHIVES 20
s6-log -d3 -- t s${LOGSIZE} n${LOGARCHIVES} ${LOGPREFIX}/${LOGGERNAME}

View File

@ -1,4 +1,13 @@
#!/bin/execlineb -P
s6-envdir -i /etc/s6/env/core/path
importas -i PATH PATH
s6-envdir /etc/s6/env/core/logger
importas -i LOGPREFIX LOGPREFIX
emptyenv
importas -D /var/log/udevd -u LOGDEST LOGDEST
s6-log -d3 -- t s1000000 n20 $LOGDEST
export PATH $PATH
define LOGGERNAME udevd
define LOGSIZE 1000000
define LOGARCHIVES 20
s6-log -d3 -- t s${LOGSIZE} n${LOGARCHIVES} ${LOGPREFIX}/${LOGGERNAME}

View File

@ -1,4 +1,13 @@
#!/bin/execlineb -P
s6-envdir -i /etc/s6/env/core/path
importas -i PATH PATH
s6-envdir /etc/s6/env/core/logger
importas -i LOGPREFIX LOGPREFIX
emptyenv
importas -D /var/log/xorg -u LOGDEST LOGDEST
s6-log -d3 -- t s1000000 n20 $LOGDEST
export PATH $PATH
define LOGGERNAME xorg
define LOGSIZE 1000000
define LOGARCHIVES 20
s6-log -d3 -- t s${LOGSIZE} n${LOGARCHIVES} ${LOGPREFIX}/${LOGGERNAME}

View File

@ -1,4 +1,11 @@
#!/bin/execlineb -P
s6-envdir -i /etc/s6/env/core/path
importas -i PATH PATH
emptyenv
export PATH /bin:/sbin:/usr/bin:/usr/sbin
foreground { redirfd -w 1 /dev/null udevadm settle }
export PATH $PATH
fdclose 1
fdclose 2
exec udevadm settle

View File

@ -1,5 +1,12 @@
#!/bin/execlineb -P
s6-envdir -i /etc/s6/env/core/path
importas -i PATH PATH
emptyenv
export PATH /bin:/sbin:/usr/bin:/usr/sbin
foreground { redirfd -w 1 /dev/null udevadm trigger --action=add --type=subsystems }
foreground { redirfd -w 1 /dev/null udevadm trigger --action=add --type=devices }
export PATH $PATH
fdclose 1
fdclose 2
foreground { udevadm trigger --action=add --type=subsystems }
foreground { udevadm trigger --action=add --type=devices }

View File

@ -1,5 +1,10 @@
#!/bin/execlineb -P
s6-envdir -i /etc/s6/env/core/path
importas -i PATH PATH
emptyenv
export PATH $PATH
fdmove -c 2 1
export PATH /bin:/sbin:/usr/bin:/usr/sbin
exec udevd

View File

@ -1 +0,0 @@
:0

View File

@ -1 +0,0 @@
2

View File

@ -1,7 +1,12 @@
#!/bin/execlineb -P
s6-envdir env
importas -D 2 -u TTYN TTYN
importas -D 0 -u DISPLAY DISPLAY
s6-envdir -i /etc/s6/env/core/path
importas -i PATH PATH
emptyenv
export PATH $PATH
define DISPLAY :0
define VTN 2
fdmove -c 2 1
export PATH /bin:/sbin:/usr/bin:/usr/sbin
exec Xorg $DISPLAY -displayfd 3 -noreset -nolisten tcp -verbose 10 vt$TTYN
exec Xorg ${DISPLAY} -displayfd 3 -noreset -nolisten tcp -verbose 10 vt${VTN}

View File

@ -0,0 +1 @@
bundle

View File

@ -1,4 +1,6 @@
#!/bin/execlineb -P
emptyenv
fdclose 1
fdclose 2
export PATH /bin:/sbin:/usr/bin:/usr/sbin
exec ip link set dev eth0 down

View File

@ -1,4 +1,12 @@
#!/bin/execlineb -P
s6-envdir -i /etc/s6/env/core/path
importas -i PATH PATH
emptyenv
export PATH /bin:/sbin:/usr/bin:/usr/sbin
exec ip link set dev eth0 up
export PATH $PATH
define INTERFACE eth0
fdclose 1
fdclose 2
exec ip link set dev ${INTERFACE} up

View File

@ -1 +1 @@
ntpd
ntpd.1

View File

@ -1,4 +1,13 @@
#!/bin/execlineb -P
s6-envdir -i /etc/s6/env/core/path
importas -i PATH PATH
s6-envdir /etc/s6/env/core/logger
importas -i LOGPREFIX LOGPREFIX
emptyenv
importas -D /var/log/ntpd -u LOGDEST LOGDEST
s6-log -d3 -- t s1000000 n20 $LOGDEST
export PATH $PATH
define LOGGERNAME ntpd
define LOGSIZE 1000000
define LOGARCHIVES 20
s6-log -d3 -- t s${LOGSIZE} n${LOGARCHIVES} ${LOGPREFIX}/${LOGGERNAME}

View File

@ -0,0 +1 @@
sshd.1

View File

@ -0,0 +1 @@
3

View File

@ -0,0 +1,13 @@
#!/bin/execlineb -P
s6-envdir -i /etc/s6/env/core/path
importas -i PATH PATH
s6-envdir /etc/s6/env/core/logger
importas -i LOGPREFIX LOGPREFIX
emptyenv
export PATH $PATH
define LOGGERNAME sshd
define LOGSIZE 1000000
define LOGARCHIVES 20
s6-log -d3 -- t s${LOGSIZE} n${LOGARCHIVES} ${LOGPREFIX}/${LOGGERNAME}

View File

@ -1,4 +1,13 @@
#!/bin/execlineb -P
s6-envdir -i /etc/s6/env/core/path
importas -i PATH PATH
s6-envdir /etc/s6/env/core/logger
importas -i LOGPREFIX LOGPREFIX
emptyenv
importas -D /var/log/udhcpc -u LOGDEST LOGDEST
s6-log -d3 -- t s1000000 n20 $LOGDEST
export PATH $PATH
define LOGGERNAME udhcpc
define LOGSIZE 1000000
define LOGARCHIVES 20
s6-log -d3 -- t s${LOGSIZE} n${LOGARCHIVES} ${LOGPREFIX}/${LOGGERNAME}

View File

@ -1,4 +1,6 @@
#!/bin/execlineb -P
emptyenv
fdclose 1
fdclose 2
export PATH /bin:/sbin:/usr/bin:/usr/sbin
exec rmmod ipv6

View File

@ -1,4 +1,12 @@
#!/bin/execlineb -P
s6-envdir -i /etc/s6/env/core/path
importas -i PATH PATH
emptyenv
export PATH /bin:/sbin:/usr/bin:/usr/sbin
exec modprobe ipv6
export PATH $PATH
define MODULE ipv6
fdclose 1
fdclose 2
exec modprobe ${MODULE}

View File

@ -0,0 +1,11 @@
#!/bin/execlineb -P
s6-envdir -i /etc/s6/env/core/path
importas -i PATH PATH
emptyenv
export PATH $PATH
define NTPS pool.ntp.org
fdmove -c 2 1
exec ntpd -n -dd -p ${NTPS}

View File

@ -0,0 +1 @@
longrun

View File

@ -0,0 +1 @@
logger.sshd

View File

@ -0,0 +1,13 @@
#!/bin/execlineb -P
s6-envdir -i /etc/s6/env/core/path
importas -i PATH PATH
emptyenv
export PATH $PATH
define SSHDCFG /etc/ssh/sshd_config
fdmove -c 2 1
# NOTE: SSHD forks itself and requires the full path
# - i don't think this is really a concern that should be forced onto users
exec /usr/sbin/sshd -D -e -f ${SSHDCFG}

View File

@ -0,0 +1 @@
longrun

View File

@ -0,0 +1 @@
oneshot

View File

@ -0,0 +1,11 @@
#!/bin/execlineb -P
s6-envdir -i /etc/s6/env/core/path
importas -i PATH PATH
emptyenv
export PATH $PATH
fdclose 1
fdclose 2
exec ssh-keygen -A

View File

@ -1,5 +1,11 @@
#!/bin/execlineb -P
s6-envdir -i /etc/s6/env/core/path
importas -i PATH PATH
emptyenv
export PATH $PATH
define INTERFACE eth0
fdmove -c 2 1
export PATH /bin:/sbin:/usr/bin:/usr/sbin
exec udhcpc -i eth0 -f -S
exec udhcpc -i ${INTERFACE} -f -S

View File

@ -1,5 +1,6 @@
#!/bin/execlineb -P
emptyenv
fdclose 1
fdclose 2
export PATH /bin:/sbin:/usr/bin:/usr/sbin
fdmove -c 2 1
exec ntpd -n -dd -p pool.ntp.org
exec userdel sshd

View File

@ -0,0 +1 @@
oneshot

View File

@ -0,0 +1,13 @@
#!/bin/execlineb -P
s6-envdir -i /etc/s6/env/core/path
importas -i PATH PATH
emptyenv
export PATH $PATH
define SHELL /sbin/nologin
define USER sshd
fdclose 1
fdclose 2
exec useradd -s ${SHELL} -H -D ${USER}