Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Computer freezes during startup: Cleaning: /tmp /var/lock /var/run 1

Status
Not open for further replies.

Sisto

Programmer
May 29, 2001
25
US
The last sceen message is:
Cleaning: /tmp /var/lock /var/run
<then the computer locks up>

Most start-ups the computer freezes at this point. Sometimes it gets past this point and the server is up and running normally. Does anyone know why this is happening or how to debug the problem.

Sisto
 
Hi,

Most (all ?) linux distros have scripts that run at boot time that remove files from these directories. This is partly housekeeping and partly because rogue lock files, etc., may prevent tasks from being started. The code is probably in /etc/rc.d/rc.sysinit or /etc/rc.d/rc.boot depending on which linux you have. Its not quite as simple as deleting everything in those directories because you need some files to be there - notably /var/run/utmp to enable logins. A example from a caldera rc.boot is as follows :

[snip]
echo -n &quot;Cleaning up:&quot;
if [ &quot;`echo &quot;$TMPTTL&quot; | sed -n 's/^[0-9][0-9]*$/OK/p'`&quot; = &quot;OK&quot; ]; then
# Wipe /tmp (and don't erase `lost+found', `quota.user' or `quota.group')!
# Note that files _in_ lost+found _are_ deleted.
echo -n &quot; /tmp&quot;
( cd /tmp && find . -xdev ! -ctime -$TMPTTL ! -name . ! \( -name lost+found -uid 0 \) ! \( -name quota.user -uid 0 \) ! \( -name quota.group -uid 0 \) -depth -exec rm -rf -- {} \; )
fi
echo -n &quot; /var/lock&quot;
# Clean up any stale locks.
# HACK ALERT! We need to save the 'subsys/network' lock...
mv -f /var/lock/subsys/network /var/adm/network.$$ 2> /dev/null
( cd /var/lock && find . -type f -exec rm -f -- {} \; )
# HACK ALERT! We need to restore the 'subsys/network' lock...
mv -f /var/adm/network.$$ /var/lock/subsys/network 2> /dev/null
# Load the random generator.
if [ -c /dev/urandom -a -f /var/run/random-seed ]; then
cat /var/run/random-seed > /dev/urandom
fi
echo -n &quot; /var/run&quot;
# Clean up /var/run and create /var/run/utmp so that we can login.
( cd /var/run && find . ! -type d -exec rm -f -- {} \; )
: > /var/run/utmp
[snip]

Others may be simpler / more complex even.

Quite why your's freezes is a good question. I can only suggest that you amend the code to ascertain where the problem is - firstly simply by adding a few appropriate 'echo' statements after each chunk of code to see where it hangs.

Hope this helps
 
Thankyou ifincham.

FYI: I have Debian and I found the error in /etc/init.d/bootmisc.sh

Something I added a long time ago, just forgot about it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top