[projects/git-slug: 83/170] Change pid file to lock file

glen glen at pld-linux.org
Mon Sep 21 21:45:47 CEST 2015


commit c549913255fe72e318cb1acc9a92db10efec9406
Author: Kacper Kornet <draenog at pld-linux.org>
Date:   Sun Mar 11 08:13:50 2012 +0000

    Change pid file to lock file
    
    The pid file will be implemented by daemonize code. But we want also a
    lock file to prevent running slug_watch by hand when another instances
    is running.

 slug_watch | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/slug_watch b/slug_watch
index 240b9d8..0eaf82b 100755
--- a/slug_watch
+++ b/slug_watch
@@ -12,7 +12,7 @@ from git_slug.serverconst import WATCHDIR
 from git_slug.refsdata import RemoteRefsData
 from git_slug.gitrepo import GitRepo
 
-PIDFILE = 'watch.pid'
+LOCKFILE = 'slug_watch.lock'
 REFFILE_NEW = REFFILE + '.new'
 REFREPO_WDIR = 'Refs'
 REFREPO_GDIR = os.path.join('repositories', REFREPO+'.git')
@@ -80,7 +80,7 @@ parser.add_argument('-u', '--user')
 options = parser.parse_args()
 
 os.chdir(pwd.getpwuid(os.getuid()).pw_dir)
-with open(PIDFILE, "a") as f:
+with open(LOCKFILE, "a") as f:
     try: 
         fcntl.flock(f, fcntl.LOCK_EX | fcntl.LOCK_NB)
         run()
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/projects/git-slug.git/commitdiff/4ed64f73960519a2f4fd04c42950b2c96ae795c5



More information about the pld-cvs-commit mailing list