Linux Admin Tips


Setting up some secure services on a Linux VPS today, using Debian Lenny, had a bit of a battle with stunnel4. The stunnel.conf file I was using had been brought across from this servers predecessor (another story for another day maybe). It had worked there but I could not get it to work on this new server.

Went of searching on Google and saw several other people asking the same question, I have this error message what does it mean ‘inetd mode must define a remote host or an executable’. But no answers.

I knew I did not want inetd mode and went through the stunnel man page, it told me how to use inetd mode but not specifically how to not use it. I was coming to the conclusion that maybe the Debian packager had compiled stunnel with some particular configuration, when I came across a perl script on the stunnel.org site that was to make stunnel4 compatible with stunnel3.

I did a which stunnel on my server and it said /usr/bin/stunnel , I opened that with vim and lo and behold it was that perl wrapper script. I looked in there and saw the executable it was using was stunnel4. I used that instead of stunnel with my stunnel.conf file and hurray it worked.

So the short answer to the question I have this error message ‘inetd mode must define a remote host or an executable’ using stunnel on Debian linux what do I do? don’t use stunnel it is a wrapper script, use stunnel4.

A little while ago I rebuilt the home Linux server, it used to have two 160GB Sata drives arranged as a software RAID 1, 2 2GHz Xeon Processors, 2Gb of RAM and was running Fedora Core 3 so you can see when it was last rebuilt.

I went for Centos 5, as I wanted longer term support for the OS, and upgraded the hard disks to a pair of 500GB Sata drives, had a bit of an incident with the 160GB drives which resulted in one of them dead, which is another story, but wanted more space anyway.

After getting it all set up with software RAID1 and LVM I then wanted to allocate more space to /var partition which is one of the LVM volumes. After looking around a bit it is actually quite simple, just two commands, which you need to be root to run. lvresize then resize2fs, below are examples of how I used them to add another 103GB to what is my /var partition, I had already added 200GB to this using this method and then decided to add the rest of the available disk space to this partition.

/usr/sbin/lvresize -L +103G /dev/VolGroup00/LogVol01

/sbin/resize2fs /dev/VolGroup00/LogVol01

If you attempt to add more than is available with lvresize it simple gives you an error message saying how blocks are available and how many you asked for, so you can adjust your request and simply try again.

man lvresize and man resize2fs will show you all the options available for these commands.