Using tnftpd with the "conversion" option

The conversion option in tnftpd is convenient for providing "calculation as a service". The user uploads a file with ftp, then downloads the file with a suffix specifying the processing to be done before the standard output is returned for the "get" command.

This is tested with FreeBSD 13.0.

  1. pkg install tnftpd
  2. edit /etc/inetd.conf to expose the ftp line
  3. change the path to ftp to /usr/local/bin/tnftpd
  4. edit /usr/local/etc/ftpd.conf to include one or more conversion specifications: conversion all .x f . /bin/echo %s is a simple demonstration that doesn't work, perhaps because there is no shell to create a proper environment. It returns only: 226-Command returned an exit status of 1 226-Command error messages: /libexec/ld-elf.so.1: environment corrupt; missing value for  `¨ ld-elf.so.1: environment corrupt; aborting
  5. I have found that static binaries are more likely to work. For example, if I compile: program hello write(*,*) 'Hello, world' stop end with gfortran -static hello.f I get a functioning executable that works with tnftpd. Without the static option, the conversion fails.