I’ve been fixing a few issues with my Linux server recently and had to search to find the fixes, so I though I’d post the fixes here.
Up until about a week ago, I was using ssmtp as my mail server to allow my Ubuntu server to email me certain things. It uses the gmail ssmtp server to send me mail. It was working fine for about a year, but suddenly stopped working recently, so I thought I would sort the problem out. I ended up removing ssmtp and installing postfix, which now is installed by default on ubuntu systems, using the guide from here. It worked very well, except my default user wasn’t able to send email using the default mail client I was using (mutt). I kept on getting the same error:
Error sending message, child exited 127 (Exec error.)
It turns out I had a .muttrc file in my home folder, from an earlier failed attempt to set up an email server that had some stupid settings, most noticeably a sendmail setting. I simply deleted the .muttrc file and the above error went away.
However, it turned out that installing postfix meant that my server started emailing me whenever cron ran a job from /etc/crontab. Which in some cases was every two minutes! So, I found out that simply adding:
" >/dev/null 2>&1 " to the end of every entry would stop the results being emailed to me.
This turned out to be quite useful, since cron emailed me with the results of my daily back up, that uses rsync, saying that it had failed with litteraly hundreds of the following error:
/bin/cp: cannot create link Operation not supported some more googling revealed that this usually occurs when cp (copy) is trying to make a symlink on a disk that does not support symlinks, such as a Windows formatted NTFS disk. This was exactly my situation, so I simply reformatted my backup disk using gparted as ext3 and now rsync is much happier.