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

Bug 342813

Summary: net-dns/bind-9.7.1_p2: init script hangs when stopping or restarting when CONFIG_SWAP is not set in kernel config because fuser needs it.
Product: Gentoo Linux Reporter: William Cooke <cookewe+gentoo>
Component: [OLD] ServerAssignee: Christian Ruppert (idl0r) <idl0r>
Status: RESOLVED NEEDINFO    
Severity: normal CC: bind+disabled
Priority: High    
Version: unspecified   
Hardware: AMD64   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: Patch to check for SWAP support in the kernel
Patch to check for SWAP support in the kernel

Description William Cooke 2010-10-26 19:05:38 UTC
Stopping or restarting the bind init script will cause the shell to hang because fuser is not working properly when CONFIG_SWAP is not set in the kernel.

Reproducible: Always

Steps to Reproduce:
1. Disable "Support for paging of anonymous memory (swap)" in the kernel
2. rebuild the kernel/reboot
3. setup/configure bind for chroot
4. /etc/init.d/bind restart

Actual Results:  
/etc/init.d/bind restart
 * Stopping chrooted named ...
 * Umounting chroot dirs
 * Waiting until all named processes are stopped

Expected Results:  
/etc/init.d/bind restart
 * Stopping chrooted named ...
 * Umounting chroot dirs
 * umount /mnt/services/dns/etc/bind
 * umount /mnt/services/dns/var/log/named
 * umount /mnt/services/dns/var/bind [ ok ]
 * Starting chrooted named ...
 * Mounting chroot dirs
 * mounting /etc/bind to /mnt/services/dns/etc/bind
 * mounting /var/bind to /mnt/services/dns/var/bind
 * mounting /var/log/named to /mnt/services/dns/var/log/named [ ok ]

fuser says "Cannot open /proc/swaps" when it is ran as "fuser /" or any directory, but it still works. I didn't know whether or not to make this a bug of psmisc or bind. My psmisc version is sys-process/psmisc-22.12.
Comment 1 William Cooke 2010-10-26 19:07:19 UTC
Created attachment 252081 [details, diff]
Patch to check for SWAP support in the kernel

Attached a patch to check for SWAP support by adding a chroot use flag.
Comment 2 William Cooke 2010-10-26 19:19:09 UTC
Created attachment 252085 [details, diff]
Patch to check for SWAP support in the kernel

Needed to check for SWAP, not swap in if statement.
Comment 3 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2010-10-26 19:58:31 UTC
(In reply to comment #2)
> Created an attachment (id=252085) [details]
> Patch to check for SWAP support in the kernel
> 
> Needed to check for SWAP, not swap in if statement.
> 

+    linux_config_exists || die "Your kernel sources are unconfigured"

Please don't do that ^. On linux_config_exists() returning true, you want to run linux_chkconfig_present SWAP. On linux_config_exists() returning false, you want to warn the user that results are unpredictable. Remember, you don't need kernel sources or a /proc/config.gz on a running Gentoo host. (The easy example is a virtual machine (VPS) that has a kernel managed by something/someone else)

Assigning to maintainers.
Comment 4 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2010-10-26 20:00:58 UTC
Oh, sorry one more thing. I also question the "die "SWAP support not detected"
" statement for similar reasons. You don't need SWAP support on the build host to run bind, Unless there is a buildtime failure.
Comment 5 Christian Ruppert (idl0r) gentoo-dev 2010-12-15 23:06:50 UTC
Please run "fuser /chroot/dns" when the init script hangs.