Work-related Tips
This page describes various tips and/or fixes that have come in useful at work. Many of these tips should work on any Linux server, however, some may be specific to Cobalt RaQs or the Ensim Pro software.
To make it clearer which lines in these tips are commands to be entered into a terminal, commands will appear in a special display. For example:
echo "this is a command to be typed into a terminal"
Contents
- [ENSIM] CentOS 5 updates introduce new keyutils-libs RPM, breaking multiple services
- [ENSIM] Installing 'unrar' on Fedora Core 4
- [ENSIM] Backups failing on large sites
- [ENSIM] update_site_summary_cache problem
- [ENSIM] Emailing all site administrators via the command line
- [ENSIM] Manually deleting a site
- [ENSIM] Weblogs script no longer runs after updating cron package
- [GENERAL] Deleting a file with hyphens as the first character(s) of the filename
- [GENERAL] Generating a self-signed SSL certificate
- [GENERAL] How to set up SSH keys
- [COBALT RAQ] Making .htaccess files work on a Cobalt RaQ 4
[ENSIM] Backups failing on large sites
A problem with Ensim WEBppliance 3.5 can cause backups to fail on sites that are using a lot of disk space (several GB). The bug will show up in a backup error report, generating the following message:
Traceback (most recent call last):
File "/usr/local/bin/vhexport", line 299, in ?
File "virtualhosting/virthost.py", line 3523, in vhexport
File "virtualhosting/virthost.py", line 3635, in __site_export
File "virtualhosting/virthost.py", line 3766, in __do_export
File "virtualhosting/virthost.py", line 3873, in __make_export_tar
File "usr/lib/python2.2/site-packages/tarfile.py", line 1045, in close
File "usr/lib/python2.2/site-packages/tarfile.py", line 392, in close
OverflowError: long int too large to convert
To fix this issue, the file /usr/lib/python2.2/site-packages/tarfile.py needs to be edited. Open the file up in an editor and
search for this line:
That line needs to be changed to read:
Note: most Ensim fixes and errata packages seem to undo this change. You will need to make this change again to stop backup errors after upgrades.
top
[ENSIM] update_site_summary_cache problem
The errata patch from Knowledge Base article KB959 seems to break the PostgreSQL database. A cron job that runs every two hours to update site summary caches will fail after this. The symptoms of this problem are that the root mail account will keep receiving an email with the following content:
Subject: Cron <root@server> nice --adjustment=15 /usr/local/sbin/update_site_summary_cache
Traceback (most recent call last):
File "/usr/local/sbin/update_site_summary_cache", line 12, in ?
cacheobj.create_cache()
File "/home/build/qa/webppliance-fedora1/3.7.0/24/lwp/vimol24/WebGui/common/cached_func.py",
line 31, in create_cache
File "/home/build/qa/webppliance-fedora1/3.7.0/26/lwp/vimol26/WebGui/base/services/vh3/bandwidth/db.py",
line 28, in db_get_site_totals
File "/usr/lib/python2.2/site-packages/pgdb.py", line 189, in execute
self.executemany(operation, (params,))
File "/usr/lib/python2.2/site-packages/pgdb.py", line 208, in executemany
raise DatabaseError, "error '%s' in '%s'" % ( msg, sql )
pgdb.DatabaseError: error 'ERROR: Relation "site_totals_view" does not exist
' in '
SELECT total_bw, threshold, begindate, site_id
FROM site_totals_view'
The following code, run as root, seems to fix the problem:
cat << EOF | psql appldb
CREATE VIEW site_totals_view
(site_id, domain, email, total_bw, over, threshold, begindate)
AS SELECT site_id,
domain,
email,
sum(total),
sum(over),
threshold,
begindate
FROM dummy_site_totals_view
GROUP BY site_id, domain, email, threshold, begindate;
EOF
Once the above has been executed, try and run this command:
/usr/local/sbin/update_site_summary_cache
If that runs without creating the same error message that appeared in the email, everything is fixed.
