Description of problem: In a default install, mrtg is set to run from /etc/cron.d/mrtg. This makes little sense until the admin sets up mrtg. Version-Release number of selected component (if applicable): Expected results: Provide an initscript /etc/rc.d/init.d/mrtg (default to off) which just toggles /var/lock/subsys/mrtg, and enhance /etc/cron.d/mrtg to check for the existence of /var/lock/subsys/mrtg before running mrtg. Additional info:
How about just checking that it's configured and having the cron job just exit?
Checking that it is configured would be tricky. /etc/mrtg/mrtg.conf is shipped by default, and there is no easy way to tell if that file is "configured". Yum uses the cronjob-check-subsys method. It would be nice if the distro standardized on the same method. Attaching proposed initscript and cron file, based on the ones from the yum package.
Created attachment 98814 [details] mrtg initscript
Created attachment 98815 [details] mrtg cronjob
Unlike yum, running unconfigured mrtg can do no harm. mrtg is installed only if you explicitly select it in the interface, in which case the administrator would probably prefer that it "just works", or if you install 'Everything', in which case you get what you deserve.