junneyang / zumastor

Automatically exported from code.google.com/p/zumastor
0 stars 1 forks source link

Zumastor cron jobs should be refactored #153

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Stop zumastor
2. Wait for a cron cycle
3. Zumastor will attempt to replicate despite the service being stopped

Linux zuma5 2.6.24.2-zumastor-r1626 #1 SMP Thu May 1 14:18:20 PDT 2008 
i686 GNU/Linux

Cron jobs are in the format:
zuma5% cat /etc/cron.daily/zumastor
#!/bin/bash
for vol in $(ls /var/run/zumastor/cron) ; do
        zumastor snapshot $vol daily
done

I suggest we refactor the cron jobs so that the call something simpler 
like:
zuma5% cat /etc/cron.daily/zumastor
#!/bin/bash
zumastor daily-replication-cycle

This allows us to move the replication logic fully into zumastor, using 
cron only for a trigger. Doing this will enable zumastor to include a 
check for service run state prior to entering a replication cycle.

Original issue reported on code.google.com by williama...@gmail.com on 10 Jun 2008 at 9:21

GoogleCodeExporter commented 9 years ago
Let's make the cycle name a parameter, e.g.
  zumastor replication-cycle daily
That way we leave the road open for custom cycle names later.

Original comment by daniel.r...@gmail.com on 10 Jun 2008 at 9:40

GoogleCodeExporter commented 9 years ago
zumastor snapshot should just fail if zumastor isn't running, no harm done.  
Cron
jobs have nothing to do with replication, only scheduled snapshots.

Original comment by sha...@gmail.com on 10 Jun 2008 at 11:25

GoogleCodeExporter commented 9 years ago
What I meant by replication was snapshotting :) Brain failure.
As long as we don't cause cron to spam the machine administrators with failed 
cronjobs as root, having zumastor exit and silently fail there is probably ok.

Original comment by williama...@gmail.com on 12 Jun 2008 at 4:29