Skip to main content

Posts

Showing posts with the label Linux Tips

Backup OpenLDAP Ubuntu

The default database location is /usr/lib/ldap It is recommended to backup to LDIF so it is transportable. Use slapcat to export. slapcat -v -l /backups/ldapbackup.ldif To restore use slapadd. cd /usr/lib/ldap rm * slapadd -l ldapbackup.ldif -v is verbose output -l specifies the ldif format

Freeradius and mysql accounting issue

I recently migrated a mysql database to a new debian based server, and my radius server was having issues updating the radius database with the AcctStopTime. The radius logs (/var/log/freeradius/radius.log) would say.. Wed Jun 29 15:26:10 2011 : Error: [sql] Couldn't update SQL accounting ALIVE record - Column count of mysql.proc is wrong. Expected 20, found 16. The table is probably corrupted or Thu Jun 30 03:32:01 2011 : Error: [sql] Couldn't update SQL accounting ALIVE record - Cannot load from mysql.proc. The table is probably corrupted The fix was relatively simple once I found it. On the mysql server do this: root@sql-server# mysql_upgrade --force It fixed some issues with the table and after that my freeradius server started updating the acctstoptime again.

Force reboot linux

If you are unable to shutdown or reboot a linux server by invoking the shutdown command, try this. Force Reboot : echo 1 > /proc/sys/kernel/sysrq echo b > /proc/sysrq-trigger Force Shutdown echo 1 > /proc/sys/kernel/sysrq echo o > /proc/sysrq-trigger