Fix exit code of plugin commands and fix cron output

Fixed the exit code of plugin commands (such as ps.bro).
Fixed the output of the "cron ?" command to show the correct status.

Also moved the logAction function to simplify some code.