/[gli]/branches/overhaul/src/fe/gtk/Daemons.py
Gentoo

Contents of /branches/overhaul/src/fe/gtk/Daemons.py

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1623 - (show annotations) (download) (as text)
Fri Jan 19 10:19:38 2007 UTC (7 years, 11 months ago) by agaffney
File MIME type: text/x-python
File size: 8726 byte(s)
remove Help button
rearrange Stage screen
1 # Copyright 1999-2005 Gentoo Foundation
2 # This source code is distributed under the terms of version 2 of the GNU
3 # General Public License as published by the Free Software Foundation, a copy
4 # of which can be found in the main directory of this project.
5
6 import gtk
7 import GLIScreen
8
9 class Panel(GLIScreen.GLIScreen):
10
11 title = "Daemons"
12 active_selection_cron = None
13 active_selection_logger = None
14 cron_daemons = {}
15 log_daemons = {}
16 _helptext = """
17 <b><u>Daemons</u></b>
18
19 System Logger:
20
21 Some tools are missing from the stage3 archive because several packages provide
22 the same functionality.
23
24 Unix and Linux have an excellent history of logging capabilities -- if you want
25 you can log everything that happens on your system in logfiles. This happens
26 through the system logger.
27
28 Gentoo offers several system loggers to choose from. There are sysklogd, which
29 is the traditional set of system logging daemons, syslog-ng, an advanced system
30 logger, and metalog which is a highly-configurable system logger. Others might
31 be available through Portage as well - our number of available packages
32 increases on a daily basis.
33
34 If you plan on using sysklogd or syslog-ng you might want to install logrotate
35 afterwards as those system loggers don't provide any rotation mechanism for the
36 log files.
37
38 Syslog-ng is provided by GRP and is the default, though the others are just as
39 good.
40
41 Cron Daemon:
42
43 Although it is optional and not required for your system, it is wise to install
44 one. But what is a cron daemon? A cron daemon executes scheduled commands. It is
45 very handy if you need to execute some command regularly (for instance daily,
46 weekly or monthly).
47
48 Gentoo offers three possible cron daemons: dcron, fcron and vixie-cron.
49 Installing one of them is similar to installing a system logger. However, dcron
50 and fcron require an extra configuration command, namely crontab /etc/crontab.
51 If you don't know what to choose, use vixie-cron.
52
53 Vixie-cron is provided by GRP and is the recommended default.
54 """
55
56 def __init__(self, controller):
57 GLIScreen.GLIScreen.__init__(self, controller)
58 vert = gtk.VBox(False, 0)
59 vert.set_border_width(10)
60
61 content_str = """Here, you will select which cron and logger daemons you would like to use. Each option has
62 a brief description beside it.
63 """
64 content_label = gtk.Label(content_str)
65 vert.pack_start(content_label, expand=False, fill=False, padding=0)
66
67 hbox = gtk.HBox(False, 0)
68 label = gtk.Label()
69 label.set_markup("<b>Cron Daemon</b> (runs tasks at scheduled times)")
70 hbox.pack_start(label, False, fill=False, padding=0)
71 vert.pack_start(hbox, expand=False, fill=False, padding=10)
72
73 self.cron_daemons['vixie-cron'] = gtk.RadioButton(None, "vixie-cron")
74 self.cron_daemons['vixie-cron'].set_name("vixie-cron")
75 self.cron_daemons['vixie-cron'].connect("toggled", self.cron_selected, "vixie-cron")
76 self.cron_daemons['vixie-cron'].set_size_request(150, -1)
77 hbox = gtk.HBox(False, 0)
78 hbox.pack_start(self.cron_daemons['vixie-cron'], expand=False, fill=False, padding=5)
79 tmplabel = gtk.Label("Paul Vixie's cron daemon, a fully featured crond implementation")
80 tmplabel.set_line_wrap(True)
81 hbox.pack_start(tmplabel, expand=False, fill=False, padding=20)
82 vert.pack_start(hbox, expand=False, fill=False, padding=10)
83
84 self.cron_daemons['fcron'] = gtk.RadioButton(self.cron_daemons['vixie-cron'], "fcron")
85 self.cron_daemons['fcron'].set_name("fcron")
86 self.cron_daemons['fcron'].connect("toggled", self.cron_selected, "fcron")
87 self.cron_daemons['fcron'].set_size_request(150, -1)
88 hbox = gtk.HBox(False, 0)
89 hbox.pack_start(self.cron_daemons['fcron'], expand=False, fill=False, padding=5)
90 tmplabel = gtk.Label("A command scheduler with extended capabilities over cron and anacron")
91 tmplabel.set_line_wrap(True)
92 hbox.pack_start(tmplabel, expand=False, fill=False, padding=20)
93 vert.pack_start(hbox, expand=False, fill=False, padding=10)
94
95 self.cron_daemons['dcron'] = gtk.RadioButton(self.cron_daemons['vixie-cron'], "dcron")
96 self.cron_daemons['dcron'].set_name("dcron")
97 self.cron_daemons['dcron'].connect("toggled", self.cron_selected, "dcron")
98 self.cron_daemons['dcron'].set_size_request(150, -1)
99 hbox = gtk.HBox(False, 0)
100 hbox.pack_start(self.cron_daemons['dcron'], expand=False, fill=False, padding=5)
101 tmplabel = gtk.Label("A cute little cron from Matt Dillon")
102 tmplabel.set_line_wrap(True)
103 hbox.pack_start(tmplabel, expand=False, fill=False, padding=20)
104 vert.pack_start(hbox, expand=False, fill=False, padding=10)
105
106 self.cron_daemons['none'] = gtk.RadioButton(self.cron_daemons['vixie-cron'], "None")
107 self.cron_daemons['none'].set_name("none")
108 self.cron_daemons['none'].connect("toggled", self.cron_selected, "none")
109 self.cron_daemons['none'].set_size_request(150, -1)
110 hbox = gtk.HBox(False, 0)
111 hbox.pack_start(self.cron_daemons['none'], expand=False, fill=False, padding=5)
112 tmplabel = gtk.Label("Choose this if you don't want a cron daemon")
113 tmplabel.set_line_wrap(True)
114 hbox.pack_start(tmplabel, expand=False, fill=False, padding=20)
115 vert.pack_start(hbox, expand=False, fill=False, padding=10)
116
117
118 hbox = gtk.HBox(False, 0)
119 label = gtk.Label()
120 label.set_markup("<b>System Logger</b> (provides logging facilities)")
121 hbox.pack_start(label, False, fill=False, padding=0)
122 vert.pack_start(hbox, expand=False, fill=False, padding=10)
123
124 self.log_daemons['syslog-ng'] = gtk.RadioButton(None, "syslog-ng")
125 self.log_daemons['syslog-ng'].set_name("syslog-ng")
126 self.log_daemons['syslog-ng'].connect("toggled", self.logger_selected, "syslog-ng")
127 self.log_daemons['syslog-ng'].set_size_request(150, -1)
128 hbox = gtk.HBox(False, 0)
129 hbox.pack_start(self.log_daemons['syslog-ng'], expand=False, fill=False, padding=5)
130 tmplabel = gtk.Label("syslog replacement with advanced filtering features")
131 tmplabel.set_line_wrap(True)
132 hbox.pack_start(tmplabel, expand=False, fill=False, padding=20)
133 vert.pack_start(hbox, expand=False, fill=False, padding=10)
134
135 self.log_daemons['metalog'] = gtk.RadioButton(self.log_daemons['syslog-ng'], "metalog")
136 self.log_daemons['metalog'].set_name("metalog")
137 self.log_daemons['metalog'].connect("toggled", self.logger_selected, "metalog")
138 self.log_daemons['metalog'].set_size_request(150, -1)
139 hbox = gtk.HBox(False, 0)
140 hbox.pack_start(self.log_daemons['metalog'], expand=False, fill=False, padding=5)
141 tmplabel = gtk.Label("A highly configurable replacement for syslogd/klogd")
142 tmplabel.set_line_wrap(True)
143 hbox.pack_start(tmplabel, expand=False, fill=False, padding=20)
144 vert.pack_start(hbox, expand=False, fill=False, padding=10)
145
146 self.log_daemons['sysklogd'] = gtk.RadioButton(self.log_daemons['syslog-ng'], "sysklogd")
147 self.log_daemons['sysklogd'].set_name("sysklogd")
148 self.log_daemons['sysklogd'].connect("toggled", self.logger_selected, "sysklogd")
149 self.log_daemons['sysklogd'].set_size_request(150, -1)
150 hbox = gtk.HBox(False, 0)
151 hbox.pack_start(self.log_daemons['sysklogd'], expand=False, fill=False, padding=5)
152 tmplabel = gtk.Label("Standard log daemon")
153 tmplabel.set_line_wrap(True)
154 hbox.pack_start(tmplabel, expand=False, fill=False, padding=20)
155 vert.pack_start(hbox, expand=False, fill=False, padding=10)
156
157 self.add_content(vert)
158
159 def cron_selected(self, widget, data=None):
160 self.active_selection_cron = data
161
162 def logger_selected(self, widget, data=None):
163 self.active_selection_logger = data
164
165 def activate(self):
166 self.controller.SHOW_BUTTON_EXIT = True
167 # self.controller.SHOW_BUTTON_HELP = True
168 self.controller.SHOW_BUTTON_BACK = True
169 self.controller.SHOW_BUTTON_FORWARD = True
170 self.controller.SHOW_BUTTON_FINISH = False
171 self.active_selection_cron = self.controller.install_profile.get_cron_daemon_pkg() or "vixie-cron"
172 self.active_selection_logger = self.controller.install_profile.get_logging_daemon_pkg() or "syslog-ng"
173 self.cron_daemons[self.active_selection_cron].set_active(True)
174 self.log_daemons[self.active_selection_logger].set_active(True)
175 if self.controller.install_type == "networkless":
176 self.active_selection_cron = "vixie-cron"
177 self.cron_daemons['vixie-cron'].set_active(True)
178 self.cron_daemons['fcron'].set_sensitive(False)
179 self.cron_daemons['dcron'].set_sensitive(False)
180 # self.cron_daemons['none'].set_sensitive(False)
181 self.active_selection_logger = "syslog-ng"
182 self.log_daemons['syslog-ng'].set_active(True)
183 self.log_daemons['metalog'].set_sensitive(False)
184 self.log_daemons['sysklogd'].set_sensitive(False)
185
186 def deactivate(self):
187 self.controller.install_profile.set_cron_daemon_pkg(None, self.active_selection_cron, None)
188 self.controller.install_profile.set_logging_daemon_pkg(None, self.active_selection_logger, None)
189 return True

Properties

Name Value
svn:eol-style native

  ViewVC Help
Powered by ViewVC 1.1.20