On 07.02.2009 11:26, Ville Skyttä wrote:
VDR does not know whether the shutdown script initiated the shutdown or decided to ignore it,
I suppose it would be quite easy to implement that and maybe some other scenarios as well using shutdown script exit statuses. For example exit status 0 = shutdown successfully initiated (already in current VDR), 10 = shutdown ignored, 11 = something else, 12 = something else, anything else = an unexpected error occurred.
Unfortunately it's not that easy. Currently, VDR backgrounds the call to the shutdown script, and detaches the shutdown script from the VDR process. Only because of that, the script can 'survive' the kill of VDR, and only because of that the script can display messages via SVDRP.
However, this means that the error level return of the script is unknown to VDR, and is (and was) always ignored. Some shutdown scripts do set error levels, but there's no common definition about the meaning of error levels. Defining error levels for the shutdown script would thereby be potentially incompatible to existing scripts.
Another solution to this would be an external activity handler that is controlled via SVDRP commands, and that provides activity control comparable to plugins for one external instance - the shutdown script. This could either be done by a plugin or a VDR patch.
Cheers,
Udo