summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Whitaker <mageia@martin-whitaker.me.uk>2017-02-10 23:43:47 +0000
committerMartin Whitaker <mageia@martin-whitaker.me.uk>2017-02-25 11:47:19 +0000
commitc7480899a8825b0a0791526eca0d811260346ab4 (patch)
tree93adf6ac9a8a6c5ebf7a32da5be41a179f707c7b
parentdf4d1519d26db338c7524a98d00820012c9b07b3 (diff)
downloaddrakx-c7480899a8825b0a0791526eca0d811260346ab4.tar
drakx-c7480899a8825b0a0791526eca0d811260346ab4.tar.gz
drakx-c7480899a8825b0a0791526eca0d811260346ab4.tar.bz2
drakx-c7480899a8825b0a0791526eca0d811260346ab4.tar.xz
drakx-c7480899a8825b0a0791526eca0d811260346ab4.zip
Inhibit udisks2 when running drakdisk (mga#20247).
This prevents disks/partitions being auto-mounted by e.g. Thunar when drakdisk probes the disks or makes changes, which can lead to disk corruption.
-rw-r--r--perl-install/Makefile.drakxtools4
-rwxr-xr-xperl-install/standalone/drakdisk10
2 files changed, 13 insertions, 1 deletions
diff --git a/perl-install/Makefile.drakxtools b/perl-install/Makefile.drakxtools
index a8b5a1ae1..e418c9e6d 100644
--- a/perl-install/Makefile.drakxtools
+++ b/perl-install/Makefile.drakxtools
@@ -47,9 +47,11 @@ install:
mv -f $(SBINDEST)/drak{autologin,auth,boot,clock,font,perm,sec,ups,xservices} $(LIBEXECDEST)
mv -f $(SBINDEST)/logdrake $(LIBEXECDEST)/draklog
mv -f $(SBINDEST)/drakedm $(LIBEXECDEST)/drakdm
- mv -f $(SBINDEST)/diskdrake $(LIBEXECDEST)/drakdisk
mv -f $(SBINDEST)/harddrake2 $(LIBEXECDEST)/drakhardware
mv -f $(SBINDEST)/scannerdrake $(LIBEXECDEST)/drakscanner
+ # diskdrake is called by the drakdisk wrapper
+ mv -f $(SBINDEST)/diskdrake $(LIBEXECDEST)
+ install -D standalone/drakdisk $(LIBEXECDEST)
install -m 644 *.pm $(LIBDEST)
diff --git a/perl-install/standalone/drakdisk b/perl-install/standalone/drakdisk
new file mode 100755
index 000000000..a40edf5ed
--- /dev/null
+++ b/perl-install/standalone/drakdisk
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+CMD=/usr/libexec/diskdrake
+
+ps -C udisksd > /dev/null
+if [ $? -eq 0 -a -x /usr/lib/udisks2/udisks2-inhibit ] ; then
+ /usr/lib/udisks2/udisks2-inhibit $CMD "$@"
+else
+ $CMD "$@"
+fi