Hi everybody,

I'm looking for opinions on how show a cancel be handled in case the
FD is currently running a ClientRunBeforeJob (or some other) script.

Current behaviour seems to be (at least in this case) to let it hang
there forever in "canceled" state, thus stopping any other job with
lower priority to run unless director is restarted.

See http://bugs.bacula.org/view.php?id=1544#c5266 for example

I see couple of options on how to handle it:

1) killing the script with SIGKILL and then normally canceling is
   really the bad choice, as it might leave the client system in
   broken state (as mentioned in the bug)

2) send the TERM or INT signal to the user script, and let it handle
   how to cleanup (it can be done even in shell scripts with "trap"
   command, or with signal handler in other). 

   It is IMHO the cleanest and most desireable (as all the other
   software works kind of like that), but it will need users to pay
   attention on upgrade and update the scripts if special handling is
   needed. 

3) let the FD wait for user script to finish, and then cancel it.
   It will be as safe as now regarding the user scripts, but would
   need some more changing in code (probably some new state "waiting
   for user script to finish before canceling the job")

4) do not allow the user to cancel the job unless the script has
   finished, instead giving them the error message prompting them to
   try again later. Also should probably be relatively easy to
   implement, but while preserving consistent state of director
   probably might annoy some users

5) just drop the connection to the FD and cancel the job as no job
   has been running. The FD will detect the network problem
   eventually, and handle it the same it would handle a network 
   problem now. Minimal changes to the code, but ugly.

6) something else ?

I would prefer 2 or 3 (maybe even make it configurable to pick one,
but that is probably asking way too much), but IMHO almost any of the
above would be preferable to leaving director in half-unusable state
forever (that is, until someone manually notices the problem and
restarts/reboots)

Your opinions ?

------------------------------------------------------------------------------
_______________________________________________
Bacula-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bacula-devel

Reply via email to