Article ID: 2411, created on Oct 29, 2007, last review on May 2, 2014

  • Applies to:
  • Pro Control Panel Linux

AdditionalInformation

View Knowledge
Knowledge ID 1176
Product : EnsimPro on Linux(Fedora)
Version : 4.0
Topic : Hot Fixes

Title
Device nodes urandom and random have incorrect major and minor values, can cause

Summary
Device nodes urandom and random have incorrect major and minor values, can cause log rotation to fail in some cases

Prevention


Details
Solution:

The urandom and random device nodes in each site's filesystem may be set with wrong major and minor nodes.  This was an issue in versions prior to Ensim Pro 3.5.10 and was fixed in Ensim Pro 3.5.10.  However, sites pre-existing before 3.5.10 will still have these values wrong and should be repaired manually.  Symptoms may include frontpage access logs failing to rotate or be processed.  Programs that rely on the blocking feature or non-blocking feature of the 'random' device nodes may block forever.

You can identify the device nodes that have this problem by listing it and checking the major and minor values.  Example for site1

ls -l /home/virtual/site1/fst/dev/*random

 crw-r--r--    1 root     root       1,   9 Jun 16 18:29 /home/virtual/site1/fst/dev/random
 crw-r--r--    1 root     root       1,   8 Jun 16 18:29 /home/virtual/site1/fst/dev/urandom

In the table above, the major and minor numbers are in bold red text, the minor number for random is '9', the minor number for urandom is '8'.  These are incorrect, the minor number for random should be '8' and the minor number for 'urandom' should be '9'

Applies To:

   Products:  Ensim Pro, Ensim Basic
   Versions:  3.5.10+, 3.7.x, 4.x
   Platforms:  Fedora, Red Hat 7.3

Solution is to remove the device nodes and rebuild, then reboot the server.

  1. For each affected site, remove dev/urandom and dev/random.  Example for site1:
    rm -f /home/virtual/site1/fst/dev/urandom
    rm -f /home/virtual/site1/fst/dev/random


  2. Recreate the nodes.  Example for site1:
    mknod /home/virtual/site1/fst/dev/urandom -m 644 c 1 9
    mknod /home/virtual/site1/fst/dev/random -m 644 c 1 8


  3. Reboot your server to clear processes that may be blocked.  Alternatively, you may be able to simply kill the offending processes, you will need to identify the processes using 'ps' command.  Instructions for identifying the processes are beyond the scope of this KB article.

Below is a script you can use to fix these nodes for a specific site. This is a bash script that will fix siteNNN. You pass to it the siteNNN as argument and it will repair.

--- cut here ---
#!/bin/bash

SITE=$1

rm -f /home/virtual/$SITE/fst/dev/urandom
rm -f /home/virtual/$SITE/fst/dev/random

mknod /home/virtual/$SITE/fst/dev/urandom -m 644 c 1 9
mknod /home/virtual/$SITE/fst/dev/random -m 644 c 1 8

--- cut here ---

It first removes the old device nodes, then adds them back with correct major and minor values.

If you want to run on all sites at once, put the script into a file such as 'fixrandomnodes.sh', make it executable and then use sitelookup command to iterate through all sites.

chmod +x fixrandomnodes.sh
for site in $(sitelookup -a site_handle); do ./fixrandomnodes.sh $site ; done


Attachments


Related Knowledge

Related Links
 
Last ModifiedUsageSatisfiedLast Used
8/20/2004 11:53:57 AM78 10/15/2007 10:44:54 PM

4cc899da08664637a8bc437308d3ddd7 3ccb419cf98083f3bb45808fba8dbc7c 6311ae17c1ee52b36e68aaf4ad066387

Email subscription for changes to this article
Save as PDF