Migrate a bunch of things to roles. Thanks to misc!
This commit is contained in:
parent
16ce004157
commit
8e2ec48cc0
55 changed files with 138 additions and 108 deletions
17
roles/nagios_client/files/scripts/check_lock
Normal file
17
roles/nagios_client/files/scripts/check_lock
Normal file
|
@ -0,0 +1,17 @@
|
|||
#!/usr/bin/python
|
||||
|
||||
import fcntl
|
||||
import sys
|
||||
|
||||
try:
|
||||
f = open('/mnt/koji/.nagios_test', 'r')
|
||||
f.close()
|
||||
f = open('/mnt/koji/.nagios_test', 'w')
|
||||
except IOError:
|
||||
print "Could not create file"
|
||||
sys.exit(2)
|
||||
|
||||
fcntl.flock(f, fcntl.LOCK_EX)
|
||||
f.close()
|
||||
print "File Locked Successfully"
|
||||
sys.exit(0)
|
Loading…
Add table
Add a link
Reference in a new issue