git://git.camperquake.de
/
time-slider.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add --configdump command line option
[time-slider.git]
/
usr
/
share
/
time-slider
/
lib
/
time_slider
/
timesliderd.py
diff --git
a/usr/share/time-slider/lib/time_slider/timesliderd.py
b/usr/share/time-slider/lib/time_slider/timesliderd.py
index
d3fee51
..
3eb0381
100755
(executable)
--- a/
usr/share/time-slider/lib/time_slider/timesliderd.py
+++ b/
usr/share/time-slider/lib/time_slider/timesliderd.py
@@
-44,11
+44,13
@@
import dbussvc
import zfs
import smf
import time_slider.linux.timeslidersmf as timeslidersmf
import zfs
import smf
import time_slider.linux.timeslidersmf as timeslidersmf
-import autosnapsmf
-import plugin
+import
time_slider.linux.autosnapsmf as
autosnapsmf
+
#
import plugin
from time_slider.linux.rbac import RBACprofile
import util
from time_slider.linux.rbac import RBACprofile
import util
+import time_slider.linux.timesliderconfig as timesliderconfig
+
_MINUTE = 60
_HOUR = _MINUTE * 60
_DAY = _HOUR * 24
_MINUTE = 60
_HOUR = _MINUTE * 60
_DAY = _HOUR * 24
@@
-97,7
+99,7
@@
class SnapshotManager(threading.Thread):
'/org/opensolaris/TimeSlider/autosnap',
self)
'/org/opensolaris/TimeSlider/autosnap',
self)
- self._plugin = plugin.PluginManager(self.verbose)
+
#
self._plugin = plugin.PluginManager(self.verbose)
self.exitCode = smf.SMF_EXIT_OK
self.refresh()
self.exitCode = smf.SMF_EXIT_OK
self.refresh()
@@
-206,7
+208,7
@@
class SnapshotManager(threading.Thread):
self._configure_svc_props()
self._rebuild_schedules()
self._update_schedules()
self._configure_svc_props()
self._rebuild_schedules()
self._update_schedules()
- self._plugin.refresh()
+
#
self._plugin.refresh()
self._stale = False
self._refreshLock.release()
self._stale = False
self._refreshLock.release()
@@
-449,7
+451,7
@@
class SnapshotManager(threading.Thread):
now = long(time.time())
while next != None and next <= now:
label = self._take_snapshots(schedule)
now = long(time.time())
while next != None and next <= now:
label = self._take_snapshots(schedule)
- self._plugin.execute_plugins(schedule, label)
+
#
self._plugin.execute_plugins(schedule, label)
self._refreshLock.acquire()
self._update_schedules()
next,schedule = self._next_due();
self._refreshLock.acquire()
self._update_schedules()
next,schedule = self._next_due();
@@
-931,8
+933,16
@@
def main(argv):
parser = argparse.ArgumentParser()
parser.add_argument('--foreground', action='store_true', help='Do not daemonize', default=False)
parser = argparse.ArgumentParser()
parser.add_argument('--foreground', action='store_true', help='Do not daemonize', default=False)
+ parser.add_argument('--config', '-c', type=str, help='Configuration file', default='/etc/time-slider/timesliderd.conf')
+ parser.add_argument('--configdump', action='store_true', help='Dump default values in config file format', default=False)
args, _ = parser.parse_known_args()
args, _ = parser.parse_known_args()
+ if args.configdump:
+ timesliderconfig.configdump()
+ sys.exit(smf.SMF_EXIT_OK)
+
+ timesliderconfig.configfile = args.config
+
# Daemonise the service.
if not args.foreground:
create_daemon()
# Daemonise the service.
if not args.foreground:
create_daemon()