X-Git-Url: https://git.camperquake.de/gitweb.cgi?p=time-slider.git;a=blobdiff_plain;f=usr%2Fshare%2Ftime-slider%2Flib%2Ftime_slider%2Ftimesliderd.py;h=99f802adc59ebfa35d465a186d08de84f64621e4;hp=f9c8e3acb87a23ae19180f57bfc40e13d735fadc;hb=bff9182e1ef4ed57de8d68f99af736ed37b5fcd8;hpb=b4d3543951892154a1493edcc451937537371044 diff --git a/usr/share/time-slider/lib/time_slider/timesliderd.py b/usr/share/time-slider/lib/time_slider/timesliderd.py index f9c8e3a..99f802a 100755 --- a/usr/share/time-slider/lib/time_slider/timesliderd.py +++ b/usr/share/time-slider/lib/time_slider/timesliderd.py @@ -31,6 +31,7 @@ import time import datetime import calendar import signal +import argparse import glib import gobject @@ -42,12 +43,14 @@ import dbus.mainloop.glib import dbussvc import zfs import smf -import timeslidersmf -import autosnapsmf +import time_slider.linux.timeslidersmf as timeslidersmf +import time_slider.linux.autosnapsmf as autosnapsmf import plugin -from rbac import RBACprofile +from time_slider.linux.rbac import RBACprofile import util +import time_slider.linux.timesliderconfig as timesliderconfig + _MINUTE = 60 _HOUR = _MINUTE * 60 _DAY = _HOUR * 24 @@ -928,9 +931,16 @@ def create_daemon(): def main(argv): + 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') + args, _ = parser.parse_known_args() + + timesliderconfig.configfile = args.config # Daemonise the service. - create_daemon() + if not args.foreground: + create_daemon() # The user security attributes checked are the following: # Note that UID == 0 will match any profile search so