View Single Post
Old 10-16-2011, 12:06 PM  
Yil
Too much time...
 
Join Date: May 2005
Posts: 1,194
Default

Environmental variables to scripts are supplied via the etc/ioftpd.env file. You can use any message cookies from doc/Cookies.txt to supply anything you want to EXEC scripts, but just remember not all things are valid all the time, i.e. if you refer to a userfile field and the user hasn't logged in yet the value will be blank, 0, etc.

Environmental variables are a one way thing so I think your setting of ioerror is incorrect. Remember env vars get passed to processes at creation time and the parent won't see any changes to them.

However, the exit() value or the return value from main() of EXEC modules does indicate success/failure for processes that terminate. This is how all the scripts I've played with do things. The only exception would be if you intend the script to run in the background, i.e. you use !detach then that's the way to indicate success/failure. Since !detach 0/1 didn't seem to make a difference in your tests it's either the case that it never worked, was never used (I never saw it used), or I broke it when I re-wrote the whole exec module years ago...
Yil is offline   Reply With Quote