SSHD Bootscript Suggestion

Alexander E. Patrakov patrakov at
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/`/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/ ] ; then
		echo "-16" >/proc/`cat /var/run/`/oom_adj
		sleep $t

2) Drop the echo, reopen and close it again as 

Alexander E. Patrakov

More information about the blfs-dev mailing list