Skip to main content

Posts

Showing posts from September, 2011

Listing all files with their .rpmnew updates

When you install an update to a package on an RPM-based system, any configuration files which were originally distributed by the package and that have been changed are not replaced when the package is updated. Instead, rpm creates a new file with the extention " .rpmnew ". It is then necessary to manually compare the existing file and the new one and decide how to deal with the new file. So, the pattern I often need to use is "list all .rpmnew files and the corresponding original file". This is not a particularly complex issue, but is one that I don't use often enough to have at my fingertips. The trick is bash variable substitution; specifically pattern matching: ${variable%pattern} . This deletes the shortest possible match for pattern from the right of the contents of $variable . An example using .rpmnew files created when upgading OpenNMS: # ls -1 *.rpmnew| while read f ; do ls -l ${f%\.rpmnew}* ; done -rw-rw-r-- 1 root root 7285 Jun  3 12:43 data...

Upgrading Tripplite PDU firmware

One of my clients uses Tripp Lite  PDUMH20AT power distribution units. They are rather primitive, and upgrading firmware on the management cards is done via ftp; you start an ftp session, upload the firmware image and the device reboots when you quit. I recently ran into problems with the ftp sessions – I could connect OK, but any attempt to transfer files would fail. It turns out the ftp server on the devices can't do passive ftp, only active. The fix is simple – issue the "passive" command before uploading the firmware image. Of course, this means it won't work very well through a firewall/NAT router, but that's not a problem as I do the upgrades from a local machine. The full session looks something like this: [root@a001 Files4step2]# ftp 8.pdu.a Connected to 8.pdu.a (192.168.254.138). 220 NET+ARM FTP Server 1.0 ready. Name (8.pdu.a:root): admin 331 User admin OK, send password. Password: 230 Password OK. Remote system type is NET+ARM. ftp> b...