So I am using tftpd -r <socket> and my rewrite script works however I am
at a loss as to the best way to start tftpd.
From my experiments, the rewrite engine has to start before tftpd,
tftpd expects the socket to exist. however tftpd is started rather
earlier in /etc/rc than than a "pkg_scripts" rc.d entry(my initial choice).
So my options as I see them are.
1 modify /etc/rd.d/tftpd to start the rewrite engine
benifit:the two programs really do need to run together
problems: will get erased during upgrade.
2 modify /etc/rc to start tftpd_rewrite_engine before tftps
problems: nonstandard rc, changes will get erased during upgrade
3 remove tftpd from rc.conf.local and make custom rc.d/tftpd_local
that will start both processes from pkg_scripts
problems: nonstandard tftpd start
I am hoping I have missed somthing obvious but will probably go with
choice three(the pkg_scripts tftpd)
And, if anyone whishes to see it, I would be happy to share my rewrite
script, however about the best that can be said about it is "It works".
It is written in python and I have little experiance writing socket code.