]> git.pld-linux.org Git - packages/systemd.git/blame - pld-storage-init.sh
Added handling lxc-stop SIGPWR via stolen from Ubuntu service.
[packages/systemd.git] / pld-storage-init.sh
CommitLineData
44410185
JR
1#!/bin/sh
2
3# Read functions
4. /lib/rc-scripts/functions
5
12bd0c07 6if ! is_no "$DM_MULTIPATH" && [ -x /sbin/multipath ]; then
44410185
JR
7 modprobe -s dm-mod >/dev/null 2>&1
8 modprobe -s dm-multipath >/dev/null 2>&1
35ba9895 9 /sbin/multipath -v 0
44410185
JR
10 [ -x /sbin/kpartx ] && /sbin/dmsetup ls --target multipath --exec '/sbin/kpartx -u -a -p p'
11fi
12
13if [ -x /sbin/dmraid ]; then
14 modprobe -s dm-mod >/dev/null 2>&1
15 modprobe -s dm-mirror >/dev/null 2>&1
16 dmraidsets=$(LC_ALL=C /sbin/dmraid -s -c -i)
17 if [ "$?" = "0" ]; then
18 oldIFS=$IFS
19 IFS=$(echo -en "\n\b")
20 for dmname in $dmraidsets ; do
21 [[ "$dmname" = isw_* ]] && continue
22 /sbin/dmraid -ay -i --rm_partitions -p "$dmname"
23 [ -x /sbin/kpartx ] && /sbin/kpartx -u -a -p p "/dev/mapper/$dmname"
24 done
a51046f1 25 IFS=$oldIFS
44410185
JR
26 fi
27fi
28
29# Start any MD RAID arrays that haven't been started yet
2946060b 30[ -r /proc/mdstat ] && /sbin/mdadm -As --auto=yes --run 2>&1
44410185
JR
31
32if ! is_no "$LVM2" && [ -x /sbin/lvm ]; then
33 modprobe -s dm-mod >/dev/null 2>&1
d2332887
MK
34 # --cache to initiate direct device scan and update lvmetad appropriately (if running).
35 # See http://lists.pld-linux.org/mailman/pipermail/pld-devel-pl/2016-January/157230.html
36 run_cmd "Scanning for LVM volume groups" /sbin/lvm vgscan --ignorelockingfailure --cache
44410185
JR
37 run_cmd "Activating LVM volume groups" /sbin/lvm vgchange -a y --sysinit
38 /sbin/lvm vgmknodes --ignorelockingfailure
39fi
a51046f1
ER
40
41exit 0
This page took 0.129742 seconds and 4 git commands to generate.