ftp: u: unknown option

This one gave me fits for a couple whiles this afternoon. My commerce site ftp’s orders to another server for shipping. I was opening a pipe in perl to call ftp and send the file. Simple enough, worked for years and years.

Well, we recently upgraded our servers and intermittently I would get this message in the log:

ftp: u: unknown option

I was pulling my hair out because, subsequent to an updatedb, I’d issue a whereis:

[root@camera ~]# whereis ftp
ftp: /usr/bin/ftp /usr/share/man/man1/ftp.1.gz

OK, I’m in /usr/bin/ftp so let’s issue the command:

[root@camera ~]# /usr/bin/ftp -u
ftp: u: unknown option

What the haywire?  How about plain old ftp, as it’s being issued by the apache server (sometimes, because sometimes it works, sometimes it doesn’t – that’s the part I like the least).

[root@camera ~]# ftp -u
ftp>

Plain weird. Finally, good old find and env found my answer: we’re calling /usr/kerberos/bin/ftp aren’t we? Yes, we are.

So, I supplied the full path to /usr/kerberos/bin to my ftp call in my Perl module, and everything works. The mystery of why the failure was intermittent remains unsolved. Anyone care to venture a guess? I’m curious, but I’m not looking for any more answers for now.