projects
/
mirror
/
dsa-puppet.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
Fix path name (etc/rsyncd instead of /etc/rsync)
[mirror/dsa-puppet.git]
/
modules
/
debian-org
/
files
/
molly-guard
/
15-acquire-reboot-lock
1
#!/bin/bash
2
3
# Copyright 2012 Peter Palfrader
4
5
l=/var/run/reboot-lock
6
exec 3> $l
7
8
if ! flock --exclusive -w 0 3; then
9
echo 2>&1 "Cannot acquire reboot lock."
10
exit 1
11
fi
12
echo "Reboot lock acquired."
13
14
ppid="$PPID"
15
(
16
while kill -0 "$ppid" 2>/dev/null; do
17
sleep 1
18
done
19
) &
20
disown
21
exit 0