/mandos/trunk

To get this branch, use:
bzr branch http://bzr.recompile.se/loggerhead/mandos/trunk

« back to all changes in this revision

Viewing changes to mandos

  • Committer: Teddy Hogeborn
  • Date: 2014-01-06 15:56:54 UTC
  • Revision ID: teddy@recompile.se-20140106155654-urx23ytuvy0nxzwp
Update init script to modern standards.

* init.d-mandos (status): Moved to standard location.  Re-added use of
                          -p switch compared to skeleton file.
  (*): Update message to include "status".

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
# "AvahiService" class, and some lines in "main".
12
12
13
13
# Everything else is
14
 
# Copyright © 2008-2014 Teddy Hogeborn
15
 
# Copyright © 2008-2014 Björn Påhlsson
 
14
# Copyright © 2008-2013 Teddy Hogeborn
 
15
# Copyright © 2008-2013 Björn Påhlsson
16
16
17
17
# This program is free software: you can redistribute it and/or modify
18
18
# it under the terms of the GNU General Public License as published by
88
88
    except ImportError:
89
89
        SO_BINDTODEVICE = None
90
90
 
91
 
version = "1.6.4"
 
91
version = "1.6.2"
92
92
stored_state_file = "clients.pickle"
93
93
 
94
94
logger = logging.getLogger()
95
 
syslogger = None
 
95
syslogger = (logging.handlers.SysLogHandler
 
96
             (facility = logging.handlers.SysLogHandler.LOG_DAEMON,
 
97
              address = str("/dev/log")))
96
98
 
97
99
try:
98
100
    if_nametoindex = (ctypes.cdll.LoadLibrary
114
116
def initlogger(debug, level=logging.WARNING):
115
117
    """init logger and add loglevel"""
116
118
    
117
 
    syslogger = (logging.handlers.SysLogHandler
118
 
                 (facility =
119
 
                  logging.handlers.SysLogHandler.LOG_DAEMON,
120
 
                  address = str("/dev/log")))
121
119
    syslogger.setFormatter(logging.Formatter
122
120
                           ('Mandos [%(process)d]: %(levelname)s:'
123
121
                            ' %(message)s'))
936
934
            # The byte_arrays option is not supported yet on
937
935
            # signatures other than "ay".
938
936
            if prop._dbus_signature != "ay":
939
 
                raise ValueError("Byte arrays not supported for non-"
940
 
                                 "'ay' signature {0!r}"
941
 
                                 .format(prop._dbus_signature))
 
937
                raise ValueError
942
938
            value = dbus.ByteArray(b''.join(chr(byte)
943
939
                                            for byte in value))
944
940
        prop(value)
1352
1348
                                       *args, **kwargs)
1353
1349
    
1354
1350
    def start_checker(self, *args, **kwargs):
1355
 
        old_checker_pid = getattr(self.checker, "pid", None)
 
1351
        old_checker = self.checker
 
1352
        if self.checker is not None:
 
1353
            old_checker_pid = self.checker.pid
 
1354
        else:
 
1355
            old_checker_pid = None
1356
1356
        r = Client.start_checker(self, *args, **kwargs)
1357
1357
        # Only if new checker process was started
1358
1358
        if (self.checker is not None
2341
2341
    
2342
2342
    if options.check:
2343
2343
        import doctest
2344
 
        fail_count, test_count = doctest.testmod()
2345
 
        sys.exit(os.EX_OK if fail_count == 0 else 1)
 
2344
        doctest.testmod()
 
2345
        sys.exit()
2346
2346
    
2347
2347
    # Default values for config file for server-global settings
2348
2348
    server_defaults = { "interface": "",