7 Commits

Author SHA1 Message Date
Chris Cromer
3f8be91085 Merge pull request #2 from Megver83/master
Add OpenRC support for managing services
2017-12-08 16:42:00 -03:00
Chris Cromer
8aebbc7784 Merge pull request #1 from konimex/master
Add openrc cgroup + patches from Void
2017-12-08 16:38:02 -03:00
David P
cd027fc19e Add OpenRC support for managing services 2017-11-20 15:05:18 -03:00
Olivier Mauras
207a4e6ebc core-services/00-pseudofs.sh: Add securityfs mountpoint - Needed for LSM support 2017-10-21 08:45:36 +07:00
Alain Kalker
3fd1449a1f Fix another always succeeding test 2017-10-21 08:44:47 +07:00
Aloz1
6b361ce618 deactivate_crypt should not try to close encrypted volumes that are still mounted during shutdown
* deactivate_crypt should not try to close encrypted volumes that are still mounted during shutdown.

When shutting down or rebooting a system with full disk encryption (as per https://wiki.voidlinux.eu/install_LVM_LUKS and https://wiki.voidlinux.eu/install_LVM_LUKS_on_UEFI_GPT), deactivate_crypt will irrespectively try and close all encrypted partitions, including '/'. On some systems, (including my own) this causes lockups on shutdown or reboot.

This commit ensures that only encrypted volumes with nothing mounted are closed (which should only be '/' at that point in shutdown).

* Reduced if statement to a one liner
2017-10-21 08:43:23 +07:00
c327918eb2 Add openrc cgroup 2017-08-28 00:15:04 +07:00
4 changed files with 24 additions and 9 deletions

25
1
View File

@@ -5,15 +5,26 @@ PATH=/usr/bin:/usr/sbin
. /etc/runit/functions
msg "Welcome to Artix Linux!"
if [ -x /usr/bin/openrc ]; then
msg "Welcome to Artix Linux!"
[ -r /etc/runit/rc.conf ] && . /etc/runit/rc.conf
# Start core services: we'll use OpenRC for this.
msg "Initializing services with OpenRC..."
# Start core services: one-time system tasks.
detect_virt
for f in /etc/runit/core-services/*.sh; do
[ -r $f ] && . $f
done
for runlevel in sysinit boot default; do
openrc $runlevel || msg_error "Failed to start $runlevel runlevel"
done
else
msg "Welcome to Artix Linux!"
[ -r /etc/runit/rc.conf ] && . /etc/runit/rc.conf
# Start core services: one-time system tasks.
detect_virt
for f in /etc/runit/core-services/*.sh; do
[ -r $f ] && . $f
done
fi
dmesg >/var/log/dmesg.log
if [ $(sysctl -n kernel.dmesg_restrict 2>/dev/null) -eq 1 ]; then

View File

@@ -8,8 +8,10 @@ mountpoint -q /dev || mount -o mode=0755,nosuid -t devtmpfs dev /dev
mkdir -p -m0755 /run/runit /run/lvm /run/user /run/lock /run/log /dev/pts /dev/shm
mountpoint -q /dev/pts || mount -o mode=0620,gid=5,nosuid,noexec -n -t devpts devpts /dev/pts
mountpoint -q /dev/shm || mount -o mode=1777,nosuid,nodev -n -t tmpfs shm /dev/shm
mountpoint -q /sys/kernel/security || mount -n -t securityfs securityfs /sys/kernel/security
if [ -z "$VIRTUALIZATION" ]; then
mountpoint -q /sys/fs/cgroup || mount -o mode=0755 -t tmpfs cgroup /sys/fs/cgroup
mountpoint -q /sys/fs/cgroup/openrc || mkdir -p /sys/fs/cgroup/openrc && mount -t cgroup -o none,name=openrc cgroup /sys/fs/cgroup/openrc
awk '$4 == 1 { system("mountpoint -q /sys/fs/cgroup/" $1 " || { mkdir -p /sys/fs/cgroup/" $1 " && mount -t cgroup -o " $1 " cgroup /sys/fs/cgroup/" $1 " ;}" ) }' /proc/cgroups
fi

View File

@@ -49,7 +49,9 @@ deactivate_vgs() {
deactivate_crypt() {
if [ -x /sbin/dmsetup -o -x /bin/dmsetup ]; then
msg "Deactivating Crypt Volumes"
dmsetup ls --target crypt --exec 'cryptsetup close'
for v in $(dmsetup ls --target crypt --exec "dmsetup info -c --noheadings -o open,name"); do
[ ${v%%:*} -eq 0 ] && cryptsetup close ${v##*:}
done
deactivate_vgs "Crypt"
fi
}

View File

@@ -1,4 +1,4 @@
if [ -x /sbin/agetty -o /bin/agetty ]; then
if [ -x /sbin/agetty -o -x /bin/agetty ]; then
# util-linux specific settings
if [ "${tty}" = "tty1" ]; then
GETTY_ARGS="--noclear"