Category Archives: Linux

linux

apt-get error “Dynamic MMap ran out of room”

Posted on .

After adding a few extra repositories to /etc/apt/sources.list I then ran an apt-get update and came accross the following error:

Fetched 8399kB in 5s (1427kB/s)
Reading package lists... Error!
E: Dynamic MMap ran out of room
E: Error occurred while processing umbrello (NewVersion1)
E: Problem with MergeList [...]
E: The package lists or status file could not be parsed or opened.

The reason being is that the disk cache used by apt when parsing packages is now too small to handle the number of packages available.

On debian, I created a new file at /etc/apt/apt.conf.d/99user adding the following line:

APT::Cache-Limit "20000000";

Don’t forget the trailing semicolon (;).

This fix is for any distro using apt-get, like debian, ubuntu etc.

Synchronize Windows with a Linux ntpd server


I have a Windows Server 2008 DC and I wanted to use my internal time server on a linux box running ntpd.

After a little hunting around, I found the command required to set Windows up to use the correct time peer.
w32tm /config /update /manualpeerlist:"0.pool.ntp.org,0x8 1.pool.ntp.org,0x8" /syncfromflags:MANUAL

After making this change, you need to restart the Windows Time Service by issuing the following 2 commands,
net stop w32time
net start w32time

If you have problems, first make sure the Windows Time Service is enabled.

This works with Windows XP, Windows Vista, Windows Server 2003 and Windows Server 2008.

ProFTPd Connection Delay

Posted on .

I noticed that ProFTPd took a few seconds to connect. On a LAN, it should be instant.

Sniffing traffic, it seemed that ProFTPd was first making an auth request using the ident protocol before falling back to user/pass authentication. This seems to be the standard behaviour according to RFC’s 912, 931 and 1413

Some google searching turned up a page over at metafilter concerning connection delay.

Adding this to the ProFTPd configuration file disabled the auth checks and made connecting/authorising instant, as it should be.
IdentLookups off

On Debian, the ProFTPd config file is at /etc/proftpd/proftpd.conf

checkprocess.sh – Check process & restart

Posted on .

I have a process that has been crashing every few days, but needs to be running 24/7 to be effective. Until I find the time to seek out the cause, I need the process to be restarted.

This short SH script uses PS to check that the process is running, and if not, runs the given init-script to restart the service.

Syntax:

checkprocess.sh [process] [init-script]

Example:

checkprocess.sh myprocess /etc/init.d/myprocess

checkprocess.sh writes a log at /var/log/checkprocess.log, and sends an alert mail to root should the process require restarting.

Put the checkprocess.sh command into crontab to check regular for the crashed process. For debian the crontab entry would look similar to:
*/1 * * * * root /usr/local/bin/checkprocess.sh mythbackend /etc/init.d/myth-backend

Download
  checkprocess.sh (723 bytes, 3,053 hits)