Revert "Revert "services_autorun: fix for incorrect evaluation""

This reverts commit 585893d046a1c317950be53dac3375d74d3c3e2b.
Redmine#5940: definitively fix services_autorun for all agents
Merge pull request #259 from tzz/bugfix/redmine5940-try-again

Bring services_autorun to life again