SSHD Bootscript Suggestion

Alexander E. Patrakov patrakov at ums.usu.ru
Mon Aug 14 22:12:16 PDT 2006


Bruce Dubbs wrote:
> Nathan Coulson wrote:
>> The SSHD tried outputting the -19 to the oom_adj file in /proc before
>> it started [My system is a P3 333 [underclocked],  recovering a raid5
>> partition].
>>
>> What about checking for the presence of the file each second, up to 5
>> seconds?
> 
> Nathan,
>   I don't understand the issue.  I don't use raid, but /proc and /var
> should be mounted (S70mountfs as a part of rcsysinit.d) long before sshd
> (S30 as a part of rcx.d).
> 
>   We use the command echo "-16" >/proc/`cat /var/run/sshd.pid`/oom_adj
> 
>   Are you saying that there is something about raid5 that returns from
> mountfs before the real mount of /var really happens?

raid5 is a red herring. SSH has a bug that it exits (daemonizes) before 
creating the pid file. Two solutions exist:

1) As Nathan suggested,

loadproc /usr/sbin/sshd &&
for t in 1 2 4 8 ; do
	if [ -r /var/run/sshd.pid ] ; then
		echo "-16" >/proc/`cat /var/run/sshd.pid`/oom_adj
		break
	else
		sleep $t
		false
	fi
done
evaluate_retval

2) Drop the echo, reopen 
http://wiki.linuxfromscratch.org/blfs/ticket/1872 and close it again as 
WONTFIX.

-- 
Alexander E. Patrakov



More information about the blfs-dev mailing list