Fix production code. - dreadlock-ng - Remote locking daemon with a funny name.
(HTM) git clone git://bitreich.org/dreadlock-ng git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/dreadlock-ng
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) Tags
(DIR) README
(DIR) LICENSE
---
(DIR) commit 8e95ceb4459f1921454d04eee968c5dd6f59b616
(DIR) parent 6e813177cb12438003a426eb6d4d0b37dfa78ad4
(HTM) Author: Christoph Lohmann <20h@r-36.net>
Date: Fri, 14 Jul 2023 19:07:41 +0200
Fix production code.
Diffstat:
M dreadlock-ng.sh | 4 ++--
M dreadlock-ng.xinetd | 1 +
M makefile | 1 +
3 files changed, 4 insertions(+), 2 deletions(-)
---
(DIR) diff --git a/dreadlock-ng.sh b/dreadlock-ng.sh
@@ -7,7 +7,7 @@
#set -x
lockbasepath="/tmp/dreadlock-ng"
-if [ $# -gt 1 ];
+if [ $# -gt 0 ];
then
lockbasepath="$1"
fi
@@ -61,7 +61,7 @@ do
printf "e timeout must be numeric\r\n"
exit 1
fi
- timeouts="$(units -t "${timeoutms}ms" "s")"
+ timeouts="$(units -t "${timeoutms}ms" "s" 2>/dev/null)"
case "${timeouts}" in
0*)
# flock(1) needs at least one second.
(DIR) diff --git a/dreadlock-ng.xinetd b/dreadlock-ng.xinetd
@@ -5,5 +5,6 @@ service ingreslock
wait = no
user = dreadlock
server = /usr/bin/dreadlock-ng
+ server_args =
disable = no
}
(DIR) diff --git a/makefile b/makefile
@@ -20,6 +20,7 @@ install:
chmod 755 '${DESTDIR}${PREFIX}/bin/${NAME}'
cp ${NAME}.xinetd /etc/xinetd.d/${NAME}
@printf "You will need a user dreadlock for the script to work.\n"
+ @printf "Set a different working directory using server_args = in xinetd file.\n"
uninstall:
rm '${DESTDIR}${PREFIX}/bin/${NAME}';