<html><center></html>STATUS updates<html></center></html>
Some links of interest:
Turns out there was still a lingering problem with the homedirbackup logic… on day 26, the day variable comes out to be a 0 as a result of the modulus division.
This was fixed by updating the calculation as follows:
day=`echo "(${yday}%26)+1" | bc -q` # cap value to 26 (alphabet)
Basically just added a 1 (put in parenthesis for good order). This will cause the a's to go last, but will cover all the letters of the alphabet.
Turns out that in some browsers (FireFox, IE) trying to view .c files located in a public_html/ would prompt the browser to download the file instead of just displaying it.
This behavior was corrected with the following line added to /etc/apache2/apache2.conf on www:
AddType text/plain .c .cc .C .cpp .CPP
To the mod_mime.c module config.
Restarted apache, bam! Problem solved.
Forklift was off, we powered it back on. I restored the light and temp scripts.
One of the netgear switches died last week; it was replaced, and on my visit today we did a rather significant cabling reorganization.
Something happened with forklift today, and it started spewing its messages.
I de-fanged it for the moment by editing the following files as follows (on web).
First up, /root/bin/lrrd.light.py:
#!/usr/bin/python # Import the CGI module import string, socket, time, rrdtool HOST = 'forklift.lair.lan' # The remote host PORT = 50000 # The same port as used by the server def sendCmd(cmd): return 0 # sok = socket.socket(socket.AF_INET, socket.SOCK_STREAM) # sok.connect((HOST, PORT)) # sok.send(cmd) # data = sok.recv(1024) # sok.close() # return data def getLight(): return 0 # strLight=sendCmd('L') # data=int(strLight) # updateString="N:"+str(data) # rrname="/var/db/rrdtool/lairlight.rrd" # rrdtool.update(rrname, updateString) getLight()
Next up, /root/bin/lrrd.temp.py:
#!/usr/bin/python # Import the CGI module import string, socket, time, rrdtool HOST = 'forklift.lair.lan' # The remote host PORT = 50000 # The same port as used by the server def sendCmd(cmd): return 0 #sok = socket.socket(socket.AF_INET, socket.SOCK_STREAM) #sok.connect((HOST, PORT)) #sok.send(cmd) #data = sok.recv(1024) #sok.close() #return data def getTemp(): return 0 #strTemp=sendCmd('t') #temp=(9.0/5.0)*((float(strTemp) /100) * 0.0625)+32 #updateString="N:"+str(temp) #rrname="/var/db/rrdtool/lairtemp.rrd" #rrdtool.update(rrname, updateString) getTemp()
I basically commented out the bulk of the processing in each function, and forced a “return 0”.
So, when we figure forklift out tomorrow, de-comment and remove the explicit “return 0”'s.
I realized this morning that the maildirbackup logic is very compatible with the homedirbackup logic (in fact, it is a descendant of homedirbackup)… so I've decided to merge them back together, and streamline some of the output.
I finally got around to implementing some logic to handle processing on any day of the month– I ended up switching to the absolute day of the year (1-365), mod dividing by 26, so I'd always be working with a valid alphabetic value.
Tightly integrated the maildir/ backup into the central for loop, and have been working on polishing the actual script output. It isn't perfect, but it is much better than it was before.
My commitchk script wasn't able to handle post- or inter-semester time periods (ie the semester file being non-existent), so I put in a quick check for its existence, forcing execution to stop if it does not exist:
41 LST="${BASE_DIR}/local/attendance/etc/list/class.${SEMESTER}.${CLASS}.list.orig" 42 if [ ! -e "$LST" ]; then 43 echo "Semester data not available; bailing out" 44 exit 1 45 fi
There was a hotfix release of dokuwiki to correct some potential cross-site script hacks and resolve a few other bugs.
Only 4-5 files were changed, so I merely pulled them down and replaced the originals, more or less following the instructions/information located here:
So both wikis are now running 2011-05-25a “Rincewind”.
I added some logic to prevent an error from showing up in my inbox from the nfs maint.sh script, which sets appropriate permissions on various files and directories in the user home directories.
There are some users who apparently do not wish to have a public_html directory, so instead of forcing them to have one, or living with the error that gets generated for those users, I'll simply check for the existence of public_html before applying permissions.
Updated script is as follows:
#!/bin/bash # # maint - Perform some routine home directory maintenance # # 20110618 - added checks for existing files (avoids errors) # 20110423 - removed wedge from the user listing (since that public_html is a link) # cd /export/home #/usr/bin/du -hs * | sed -e 's/ /:/' > /root/homedir.sizes for user in `/bin/ls -1A | grep -v '^wedge$'`; do chmod 700 $user/.subversion $user/src $user/.ssh 2>/dev/null if [ -e "$user/public_html" ]; then chmod u=rwx,g=,o-w,o+x $user/public_html fi done exit 0
If I run into any ssh, src, or subversion problems I'll obviously have to add in that logic as well.
I finally remembered to get around to performing a much-needed data backup for off-site storage.
I backed up the most recent copy (20110604) of the major LAIR services (servers, VMs, etc.), 20110613 mail, and the most recent user homedir backup.
I also noticed that www-www did not backup last time, so I performed a manual backup of that to backup.
I've observed that my homedirbackup script has “octal” problems on given days each month (the 8th and 9th), as date would always return a 2-digit result (padding on a leading zero if in the first 9 days of the month).
This would obviously prevent the script from operating properly on the 8th and the 9th, so I finally did something about it this morning:
# To avoid octal complications, strip out leading zeroes from $day in $pday if [ "$day" -lt 10 ]; then pday="`echo $day | sed 's/^0//'`" else pday="$day" fi range="`echo $alphabet | cut -c $pday,$(($pday+13))`"
I also avoided another runtime error by trimming the days that homedirbackup runs… it is currently only able to handle execution on the 1st-26th day of the month (correlating with the alphabet).. I had it set to '*', so it would try to run each and every day:
24 22 * * * root /usr/local/sbin/homedirbackup.sh
This resulted in up to 5 days of error e-mails as the script was unable to successfully run. Updated cron job is as follows:
24 22 1-26 * * root /usr/local/sbin/homedirbackup.sh
Created a script page for homedirbackup on the wiki
I finally got around to performing updates on the plugins on the wiki… not all were able to be automatically updated, but I clicked the update button for each applicable plugin regardless. Many have been updated.
This has been done on both /haas and /lab46web
The WRAP plugin syntax has changed a bit, colors no longer work they way they used to.
Information is available on the wrap plugin page. Specifically:
The old typography classes were removed in version 2011-05-15. If you need something similar, use the block plugin instead. If you like to have the old typography classes back, they are not lost: They were not completely removed yet, but only put in a comment. To keep using them either remove the comments (search for “typography” in all.css and style.css). Or better (because future-proof) copy them to your own user styles (see above).
So, I went into all.css and style.css on both wikis and uncommented the typography section. Previous functionality was restored.
I started looking into seeing what pain would be involved in using LDAP to perform authentication to student DB access (on db.offbyone.lan)… as it appears, MySQL does not appear to tie into LDAP for such operations… PostgreSQL, on the other hand- appears to support LDAP authentication.
I also realized I need to autogen a db for each user on user creation, and of course create documentation to students can access this resource more effectively.
<html><center></html>
<html></center></html>