]> git.pld-linux.org Git - packages/systemd.git/blame_incremental - pld-storage-init.sh
Added handling lxc-stop SIGPWR via stolen from Ubuntu service.
[packages/systemd.git] / pld-storage-init.sh
... / ...
CommitLineData
1#!/bin/sh
2
3# Read functions
4. /lib/rc-scripts/functions
5
6if ! is_no "$DM_MULTIPATH" && [ -x /sbin/multipath ]; then
7 modprobe -s dm-mod >/dev/null 2>&1
8 modprobe -s dm-multipath >/dev/null 2>&1
9 /sbin/multipath -v 0
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
25 IFS=$oldIFS
26 fi
27fi
28
29# Start any MD RAID arrays that haven't been started yet
30[ -r /proc/mdstat ] && /sbin/mdadm -As --auto=yes --run 2>&1
31
32if ! is_no "$LVM2" && [ -x /sbin/lvm ]; then
33 modprobe -s dm-mod >/dev/null 2>&1
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
37 run_cmd "Activating LVM volume groups" /sbin/lvm vgchange -a y --sysinit
38 /sbin/lvm vgmknodes --ignorelockingfailure
39fi
40
41exit 0
This page took 0.073469 seconds and 4 git commands to generate.