Commit 0d349b3a authored by Guido Trotter's avatar Guido Trotter
Browse files

Improve ganeti example cron file

The cron file in ganeti's example directory is now static, and executes
ganeti-watcher in /usr/local/sbin no matter where it's really installed. With
this patch we generate it at build time substituting the right value of
@SBINDIR@ from ganeti.cron.in. We also make sure ganeti-watcher exists and is
executable before running it.

This is targeted at 1.2 as well.

Reviewed-by: iustinp
parent 6c8af3d0
EXTRA_DIST = ganeti.initd.in ganeti.cron
EXTRA_DIST = ganeti.initd.in ganeti.cron.in
CLEANFILES = $(nodist_EXTRA_DATA)
nodist_EXTRA_DATA = ganeti.initd
nodist_EXTRA_DATA = ganeti.initd ganeti.cron
all-local: ganeti.initd
ganeti.initd: ganeti.initd.in
all-local: ganeti.initd ganeti.cron
ganeti.%: ganeti.%.in
sed \
-e "s#@PREFIX@#$(prefix)#g" \
-e "s#@SYSCONFDIR@#$(sysconfdir)#g" \
-e "s#@LOCALSTATEDIR@#$(localstatedir)#g" \
-e "s#@SBINDIR@#$(sbindir)#g" \
< $< > $@
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin
# restart failed instances
*/5 * * * * root /usr/local/sbin/ganeti-watcher
*/5 * * * * root [ -x @SBINDIR@/ganeti-watcher ] && @SBINDIR@/ganeti-watcher
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment