aboutsummaryrefslogtreecommitdiffstats
path: root/core/lvm2/lvm.initd
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2009-02-17 15:19:38 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2009-02-17 15:19:38 +0000
commitf2cf05a313dab8759d62bec91d78bf8de5002191 (patch)
treeb9fbf6ff16fb2c91b4b62b28dd7787bb04330e00 /core/lvm2/lvm.initd
parent33234841f677257d8facd8528e4dd1dfc88fdb12 (diff)
downloadaports-f2cf05a313dab8759d62bec91d78bf8de5002191.tar.bz2
aports-f2cf05a313dab8759d62bec91d78bf8de5002191.tar.xz
core/lvm2: added missing init.d script
Diffstat (limited to 'core/lvm2/lvm.initd')
-rw-r--r--core/lvm2/lvm.initd33
1 files changed, 33 insertions, 0 deletions
diff --git a/core/lvm2/lvm.initd b/core/lvm2/lvm.initd
new file mode 100644
index 0000000000..022cbb1e0d
--- /dev/null
+++ b/core/lvm2/lvm.initd
@@ -0,0 +1,33 @@
+#!/sbin/runscript
+
+dm_in_proc() {
+ local rc=0 i=
+ for i in devices misc; do
+ grep -qs 'device-mapper' /proc/$i
+ rc=$(($rc + $?))
+ done
+ return $rc
+}
+
+start() {
+ local rc=0 msg=
+ ebegin "Setting up the Logical Volume Manager"
+ if [ -e /proc/modules ] && ! dm_in_proc; then
+ modprobe dm-mod 2>/dev/null
+ fi
+ if [ -d /proc/lvm ] || dm_in_proc; then
+ vgscan --mknodes --ignorelockingfailure >/dev/null 2>&1 &&\
+ vgchange --ignorelockingfailure -a y >/dev/null 2>&1
+ rc=$?
+ else
+ rc=1
+ fi
+ eend $rc
+}
+
+stop() {
+ ebegin "Shutting down the Logical Volume Manager"
+ vgchange --ignorelockingfailure -a n >/dev/null 2>&1
+ eend $?
+}
+