[gnome-ostree] guestfish: Throw if pid file already exists



commit 5b0847a90ed9526e6cc37456ad9f20a7635d6c04
Author: Colin Walters <walters verbum org>
Date:   Tue Jan 15 09:26:55 2013 -0500

    guestfish: Throw if pid file already exists
    
    Just a generally good idea.

 src/ostbuild/js/guestfish.js |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/src/ostbuild/js/guestfish.js b/src/ostbuild/js/guestfish.js
index 9f057c8..579cd4c 100644
--- a/src/ostbuild/js/guestfish.js
+++ b/src/ostbuild/js/guestfish.js
@@ -89,6 +89,10 @@ const GuestMount = new Lang.Class({
 	try {
 	    this._mntdir = mntdir;
 	    this._mountPidFile = mntdir.get_parent().get_child(mntdir.get_basename() + '.guestmount-pid');
+
+	    if (this._mountPidFile.query_exists(null))
+		throw new Error("guestfish pid file exists: " + this._mountPidFile.get_path());
+
 	    let guestmountArgv = ['guestmount', '-o', 'allow_root',
 				  '--pid-file', this._mountPidFile.get_path()];
 	    this._appendOpts(guestmountArgv);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]