From e84c155b334019999a4ab3fb75991e71299a50ce Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Mon, 31 Dec 2012 10:16:43 +0100 Subject: [PATCH] improve init.log: start one dummy child to avoid that we get killed --- Makefile | 2 +- changelog.Debian | 6 ++++++ scripts/init.pl | 12 ++++++++++-- 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index d085ffd..03b9500 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ RELEASE=2.2 VERSION=1.2 PACKAGE=dab -PKGREL=3 +PKGREL=4 SCRIPTS= \ diff --git a/changelog.Debian b/changelog.Debian index b27238d..a315bc6 100644 --- a/changelog.Debian +++ b/changelog.Debian @@ -1,3 +1,9 @@ +dab (1.2-4) unstable; urgency=low + + * improve init.log: start one dummy child to avoid that we get killed. + + -- Proxmox Support Team Mon, 31 Dec 2012 10:16:16 +0100 + dab (1.2-3) unstable; urgency=low * spawn getty on /dev/tty1 (use new openvz console feature) diff --git a/scripts/init.pl b/scripts/init.pl index b111c5f..c0b9af7 100644 --- a/scripts/init.pl +++ b/scripts/init.pl @@ -57,9 +57,17 @@ system ("hostname localhost") == 0 || die "unable to set hostname\n"; +# start one child doing nothing - to avoid that we get killed +if (fork() == 0) { + $0 = 'dummy child'; + for (;;) { sleep 5; } + exit 0; +} + # provide simple syslog -my $sock = IO::Socket::UNIX->new (Local => "/dev/log", Listen => 5); +my $sock = IO::Socket::UNIX->new (Local => "/dev/log", Listen => 5) || + die "can't open socket /dev/log - $!\n"; while ((my $fd = $sock->accept()) ||($! == EINTR)) { @@ -76,5 +84,5 @@ while ((my $fd = $sock->accept()) ||($! == EINTR)) { close ($fd); } -print "exit init\n"; +print "exit init: $!\n"; exit (0); -- 2.39.2