OLD | NEW |
1 # coding: utf-8 | 1 # coding: utf-8 |
2 | 2 |
3 # This file is part of the Adblock Plus web scripts, | 3 # This file is part of the Adblock Plus web scripts, |
4 # Copyright (C) 2006-2013 Eyeo GmbH | 4 # Copyright (C) 2006-2013 Eyeo GmbH |
5 # | 5 # |
6 # Adblock Plus is free software: you can redistribute it and/or modify | 6 # Adblock Plus is free software: you can redistribute it and/or modify |
7 # it under the terms of the GNU General Public License version 3 as | 7 # it under the terms of the GNU General Public License version 3 as |
8 # published by the Free Software Foundation. | 8 # published by the Free Software Foundation. |
9 # | 9 # |
10 # Adblock Plus is distributed in the hope that it will be useful, | 10 # Adblock Plus is distributed in the hope that it will be useful, |
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 # but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 # GNU General Public License for more details. | 13 # GNU General Public License for more details. |
14 # | 14 # |
15 # You should have received a copy of the GNU General Public License | 15 # You should have received a copy of the GNU General Public License |
16 # along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>. | 16 # along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 |
18 import os, subprocess | 18 import exceptions, os, subprocess |
19 from sitescripts.utils import get_config | 19 from sitescripts.utils import get_config |
20 | 20 |
21 def _get_services(): | 21 def _get_services(): |
22 config = get_config() | 22 config = get_config() |
23 section_name = "keep_alive_services" | 23 section_name = "keep_alive_services" |
24 section_keys = config.options(section_name) | 24 section_keys = config.options(section_name) |
25 default_keys = config.defaults().keys() | 25 default_keys = config.defaults().keys() |
26 keys = set(section_keys) - set(default_keys) | 26 keys = set(section_keys) - set(default_keys) |
27 | 27 |
28 services = {} | 28 services = {} |
(...skipping 23 matching lines...) Expand all Loading... |
52 except exceptions.ValueError: | 52 except exceptions.ValueError: |
53 print "'%s' is not a PID." % pid_string | 53 print "'%s' is not a PID." % pid_string |
54 | 54 |
55 init_path = os.path.join("/etc/init.d", service) | 55 init_path = os.path.join("/etc/init.d", service) |
56 if not os.path.exists(init_path): | 56 if not os.path.exists(init_path): |
57 print "%s does not exist, service is not running and cannot be started." %
init_path | 57 print "%s does not exist, service is not running and cannot be started." %
init_path |
58 continue | 58 continue |
59 | 59 |
60 print "%s is not running, starting ..." % service | 60 print "%s is not running, starting ..." % service |
61 subprocess.check_call([init_path, "start"]) | 61 subprocess.check_call([init_path, "start"]) |
OLD | NEW |