Skip to content
GitLab
Explore
Sign in
Register
Commits on Source (2)
Close the lock_fd handle before calling cronscript
· 19609061
Joerg Jaspert
authored
Apr 23, 2018
19609061
Merge branch 'master' into deploy
· ce7f3627
Joerg Jaspert
authored
Apr 23, 2018
* master: Close the lock_fd handle before calling cronscript
ce7f3627
Show whitespace changes
Inline
Side-by-side
dak/new_security_install.py
View file @
ce7f3627
...
...
@@ -89,7 +89,7 @@ def sudo(arg, fn, exit):
def
do_Approve
():
sudo
(
"
A
"
,
_do_Approve
,
True
)
def
_do_Approve
():
print
"
Locking unchecked
"
lock_fd
=
os
.
open
(
'
/srv/security-master.debian.org/lock/unchecked.lock
'
,
os
.
O_
RDWR
|
os
.
O_
CREAT
)
with
os
.
fdopen
(
os
.
open
(
'
/srv/security-master.debian.org/lock/unchecked.lock
'
,
os
.
O_
CREAT
|
os
.
O_
RDWR
),
'
w
'
)
as
lock_fd
:
while
True
:
try
:
fcntl
.
flock
(
lock_fd
,
fcntl
.
LOCK_EX
|
fcntl
.
LOCK_NB
)
...
...
@@ -106,10 +106,7 @@ def _do_Approve():
for
queue
in
(
"
embargoed
"
,):
spawn
(
"
dak process-policy {0}
"
.
format
(
queue
))
# Unlock, the cronscript coming up locks itself where needed.
fcntl
.
flock
(
lock_fd
,
fcntl
.
LOCK_UN
)
# 3. Run all the steps that are needed to publish the changed archive
# 2. Run all the steps that are needed to publish the changed archive
print
"
Doing loadsa stuff in the archive, will take time, please be patient
"
os
.
environ
[
'
configdir
'
]
=
'
/srv/security-master.debian.org/dak/config/debian-security
'
spawn
(
"
/srv/security-master.debian.org/dak/config/debian-security/cronscript unchecked-dinstall
"
)
...
...