From 5f76c1121a7e93b11da5dbe9dfc8a643a39035c3 Mon Sep 17 00:00:00 2001 From: Roy Marples Date: Wed, 1 Oct 2008 21:12:54 +0000 Subject: Clean stale sockets. --- init.d/bootmisc.in | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'init.d/bootmisc.in') diff --git a/init.d/bootmisc.in b/init.d/bootmisc.in index e40fd51..50e83a0 100644 --- a/init.d/bootmisc.in +++ b/init.d/bootmisc.in @@ -88,7 +88,11 @@ start() for x in $(find /var/run ! -type d ! -name utmp \ ! -name random-seed ! -name dev.db \ ! -name ld-elf.so.hints ! -name ld.so.hints); - do + do + # Clean stale sockets + if [ -S "${x}" ] && type fuser >/dev/null 2>&1; then + fuser -s "${x}" || rm "${x}" + fi [ ! -f "${x}" ] && continue # Do not remove pidfiles of already running daemons case "${x}" in -- cgit v1.2.3