diff --git a/agent.py b/agent.py index 099fdb1560..d6218a4a29 100755 --- a/agent.py +++ b/agent.py @@ -240,12 +240,7 @@ def main(): return 3 if command in COMMANDS_AGENT: - pid_file = PidFile('dd-agent') - - if options.clean: - pid_file.clean() - - agent = Agent(pid_file.get_path(), autorestart) + agent = Agent(PidFile('dd-agent').get_path(), autorestart) if command in START_COMMANDS: log.info('Agent version %s' % get_version()) diff --git a/config.py b/config.py index e890509b23..bd28e7bd51 100644 --- a/config.py +++ b/config.py @@ -74,8 +74,6 @@ def get_parsed_args(): dest='autorestart') parser.add_option('-d', '--dd_url', action='store', default=None, dest='dd_url') - parser.add_option('-c', '--clean', action='store_true', default=False, - dest='clean') parser.add_option('-u', '--use-local-forwarder', action='store_true', default=False, dest='use_forwarder') parser.add_option('-n', '--disable-dd', action='store_true', default=False, @@ -90,7 +88,6 @@ def get_parsed_args(): # Ignore parse errors options, args = Values({'autorestart': False, 'dd_url': None, - 'clean': False, 'disable_dd':False, 'use_forwarder': False}), [] return options, args diff --git a/dogstatsd.py b/dogstatsd.py index 84a902990c..9df0d62b64 100755 --- a/dogstatsd.py +++ b/dogstatsd.py @@ -434,8 +434,7 @@ def main(config_path=None): if not args or args[0] in COMMANDS_START_DOGSTATSD: reporter, server, cnf = init(config_path, use_watchdog=True, use_forwarder=opts.use_forwarder, args=args) - pid_file = PidFile('dogstatsd') - daemon = Dogstatsd(pid_file.get_path(), server, reporter, + daemon = Dogstatsd(PidFile('dogstatsd').get_path(), server, reporter, cnf.get('autorestart', False)) # If no args were passed in, run the server in the foreground. diff --git a/tests/test_cassandra_jmx.py b/tests/test_cassandra_jmx.py index fb8b197aa6..ca4b6d4f31 100644 --- a/tests/test_cassandra_jmx.py +++ b/tests/test_cassandra_jmx.py @@ -4,7 +4,6 @@ import threading from aggregator import MetricsAggregator from dogstatsd import Server -from utils.pidfile import PidFile import os from jmxfetch import JMXFetch @@ -37,7 +36,6 @@ class JMXTestCase(unittest.TestCase): def setUp(self): aggregator = MetricsAggregator("test_host") self.server = Server(aggregator, "localhost", STATSD_PORT) - pid_file = PidFile('dogstatsd') self.reporter = DummyReporter(aggregator) self.t1 = threading.Thread(target=self.server.start) diff --git a/tests/test_java_jmx.py b/tests/test_java_jmx.py index 8f04198dc7..5bdcf38474 100644 --- a/tests/test_java_jmx.py +++ b/tests/test_java_jmx.py @@ -10,7 +10,6 @@ # datadog from aggregator import MetricsAggregator from dogstatsd import Server -from utils.pidfile import PidFile from jmxfetch import JMXFetch from common import AgentCheckTest @@ -100,7 +99,6 @@ class JMXTestCase(unittest.TestCase): def setUp(self): aggregator = MetricsAggregator("test_host") self.server = Server(aggregator, "localhost", STATSD_PORT) - pid_file = PidFile('dogstatsd') self.reporter = DummyReporter(aggregator) self.t1 = threading.Thread(target=self.server.start) diff --git a/tests/test_solr.py b/tests/test_solr.py index 23965b8a74..c2e4e33d76 100644 --- a/tests/test_solr.py +++ b/tests/test_solr.py @@ -4,7 +4,6 @@ import threading from aggregator import MetricsAggregator from dogstatsd import Server -from utils.pidfile import PidFile import os from jmxfetch import JMXFetch @@ -37,7 +36,6 @@ class JMXTestCase(unittest.TestCase): def setUp(self): aggregator = MetricsAggregator("test_host") self.server = Server(aggregator, "localhost", STATSD_PORT) - pid_file = PidFile('dogstatsd') self.reporter = DummyReporter(aggregator) self.t1 = threading.Thread(target=self.server.start) diff --git a/tests/test_tomcat.py b/tests/test_tomcat.py index 210c419700..8bb5aa138b 100644 --- a/tests/test_tomcat.py +++ b/tests/test_tomcat.py @@ -4,7 +4,6 @@ import threading from aggregator import MetricsAggregator from dogstatsd import Server -from utils.pidfile import PidFile import os from jmxfetch import JMXFetch @@ -36,7 +35,6 @@ class TestTomcat(unittest.TestCase): def setUp(self): aggregator = MetricsAggregator("test_host") self.server = Server(aggregator, "localhost", STATSD_PORT) - pid_file = PidFile('dogstatsd') self.reporter = DummyReporter(aggregator) self.t1 = threading.Thread(target=self.server.start) diff --git a/win32/agent.py b/win32/agent.py index 1236008e2f..157c11fa3e 100644 --- a/win32/agent.py +++ b/win32/agent.py @@ -50,7 +50,6 @@ def __init__(self, args): opts, args = Values({ 'autorestart': False, 'dd_url': None, - 'clean': False, 'use_forwarder': True, 'disabled_dd': False }), []