Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 603450

Summary: net-dns/bind occasionaly not restart after system crash if run in chroot environment
Product: Gentoo Linux Reporter: Vanni Della Ricca <vanni>
Component: Current packagesAssignee: Patrick McLean <chutzpah>
Status: UNCONFIRMED ---    
Severity: normal CC: chutzpah, jstein
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: patch to add bind to /run in ${CHROOT}/run

Description Vanni Della Ricca 2016-12-22 10:29:16 UTC
Created attachment 457096 [details, diff]
patch to add bind to /run in ${CHROOT}/run

Occasionally named fail to restart after system crash if it running chrooted.
The named pid file is stored in ${CHROOT}/run/named/named.pid that not is bind to /run or is not a tmpfs. If system crash occurred none clean pid file at boot.
If at the moment of start bind there is an other process whit old named pid it's fail to start with:
start-stop-daemon: /usr/sbin/named is already running 

To reproduce (simulate) this issue follow this steps:
1. stop named and create a ${CHROOT}/run/named/named.pid with an possible pid (eg. an daemon stat before named or an kernel thread
2. restart system

At restart named fail to star whit this message:
this messages
 * Starting chrooted named ...
 * Mounting chroot dirs
 * Checking named configuration ...                                                                                                    [ ok ]
 * start-stop-daemon: /usr/sbin/named is already running                                                                               [ !! ]
 * ERROR: named failed to start

An fix to this problem is to bind ${CHROOT}/run to /run in named init script.
I attach an patch to init file to bind /run