Skip to content
GitLab
Explore
Sign in
Register
Commits on Source (3)
Only need read access
· 298e1da9
Joerg Jaspert
authored
Apr 24, 2018
298e1da9
Be more verbose when not able to get lock
· b62d982c
Joerg Jaspert
authored
Apr 24, 2018
b62d982c
Unset trap at end of dinstall
· 05de3a5c
Joerg Jaspert
authored
Apr 24, 2018
05de3a5c
Show whitespace changes
Inline
Side-by-side
config/debian/cronscript
View file @
05de3a5c
...
...
@@ -123,7 +123,20 @@ function lock() {
TIME
=
300
fi
# Now try to get the lock
flock
${
flockparm
}
--timeout
${
TIME
}
${
LOCKFD
[
${
LOCK
}
]
}
set
+e
flock
${
flockparm
}
--timeout
${
TIME
}
--conflict-exit-code
3
${
LOCKFD
[
${
LOCK
}
]
}
ret
=
$?
set
-e
case
${
ret
}
in
0
)
return
;;
3
)
log_error
"Could not get lock
${
lvar
}
, timeout"
;;
*
)
log_error
"Could not get lock
${
lvar
}
"
esac
}
function
unlock
()
{
...
...
config/debian/dinstall.functions
View file @
05de3a5c
...
...
@@ -642,6 +642,7 @@ function startup() {
}
function
postcronscript
()
{
trap
- ERR
logstats
${
LOGFILE
}
state
"all done"
touch
"
${
DINSTALLEND
}
"
...
...
dak/new_security_install.py
View file @
05de3a5c
...
...
@@ -89,7 +89,7 @@ def sudo(arg, fn, exit):
def
do_Approve
():
sudo
(
"
A
"
,
_do_Approve
,
True
)
def
_do_Approve
():
print
"
Locking unchecked
"
with
os
.
fdopen
(
os
.
open
(
'
/srv/security-master.debian.org/lock/unchecked.lock
'
,
os
.
O_CREAT
|
os
.
O_RDWR
),
'
w
'
)
as
lock_fd
:
with
os
.
fdopen
(
os
.
open
(
'
/srv/security-master.debian.org/lock/unchecked.lock
'
,
os
.
O_CREAT
|
os
.
O_RDWR
),
'
r
'
)
as
lock_fd
:
while
True
:
try
:
fcntl
.
flock
(
lock_fd
,
fcntl
.
LOCK_EX
|
fcntl
.
LOCK_NB
)
...
...