Merge lp:~jamesodhunt/ubuntu/natty/upstart/proposed-stage2 into lp:ubuntu/natty/upstart

Proposed by James Hunt
Status: Merged
Merged at revision: 1304
Proposed branch: lp:~jamesodhunt/ubuntu/natty/upstart/proposed-stage2
Merge into: lp:ubuntu/natty/upstart
Diff against target: 491 lines (+162/-86)
8 files modified
ChangeLog (+12/-0)
NEWS (+5/-0)
configure.ac (+1/-1)
debian/changelog (+21/-0)
debian/manpages/upstart-events.7 (+73/-66)
init/tests/test_control.c (+4/-1)
po/upstart.pot (+2/-2)
scripts/initctl2dot.py (+44/-16)
To merge this branch: bzr merge lp:~jamesodhunt/ubuntu/natty/upstart/proposed-stage2
Reviewer Review Type Date Requested Status
Colin Watson Approve
Review via email: mp+54718@code.launchpad.net

Description of the change

* debian/manpages/upstart-events.7:
  - Corrected reference to Upstart man page (actually init).
  - Changed to using proper troff quotes.
  - Escaped dashes in event names.
  - Updated date.
  - Table 1:
    - Improved name.
    - Sorted columns: Events, References, and Notes.
    - Added unmounted-remote-filesystems event.
* init/tests/test_control.c: Added comment.
* scripts/initctl2dot.py: Fixes to handle 'emits' glob syntax:
  - header(): Change default node to be an event to simplify handling
    globs in 'emits' stanzas.
  - footer(): Updated for glob event nodes.
  - sanitize(): Protect against glob syntax.
  - show_event(): Update for glob event nodes.
  - show_job(): Explicit specification of record node.
  - show_edges(): Handle 'emits' glob syntax.

To post a comment you must log in.
Revision history for this message
Colin Watson (cjwatson) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'ChangeLog'
2--- ChangeLog 2011-03-15 16:18:21 +0000
3+++ ChangeLog 2011-03-24 16:01:02 +0000
4@@ -1,3 +1,15 @@
5+2011-03-24 James Hunt <james.hunt@ubuntu.com>
6+
7+ * init/tests/test_control.c: Added comment.
8+ * scripts/initctl2dot.py: Fixes to handle 'emits' glob syntax:
9+ - header(): Change default node to be an event to simplify handling
10+ globs in 'emits' stanzas.
11+ - footer(): Updated for glob event nodes.
12+ - sanitize(): Protect against glob syntax.
13+ - show_event(): Update for glob event nodes.
14+ - show_job(): Explicit specification of record node.
15+ - show_edges(): Handle 'emits' glob syntax.
16+
17 2011-03-15 James Hunt <james.hunt@ubuntu.com>
18
19 * configure.ac: Bump version to 0.9.3.
20
21=== modified file 'NEWS'
22--- NEWS 2011-03-15 12:15:28 +0000
23+++ NEWS 2011-03-24 16:01:02 +0000
24@@ -1,3 +1,8 @@
25+0.9.4 2011-03-24
26+
27+ * scripts/initctl2dot.py: Fix to handle 'emits' glob syntax
28+ which was causing script to fail for upstart-udev-bridge.
29+
30 0.9.3 2011-03-15
31
32 * Added missing emits stanzas for supplied .conf files.
33
34=== modified file 'configure.ac'
35--- configure.ac 2011-03-15 12:15:28 +0000
36+++ configure.ac 2011-03-24 16:01:02 +0000
37@@ -1,7 +1,7 @@
38 # Process this file with autoconf to produce a configure script.
39
40 AC_PREREQ(2.61)
41-AC_INIT([upstart], [0.9.3], [upstart-devel@lists.ubuntu.com])
42+AC_INIT([upstart], [0.9.4], [upstart-devel@lists.ubuntu.com])
43 NIH_COPYRIGHT([[Copyright © 2011 Canonical Ltd.]])
44 AC_CONFIG_SRCDIR([init/main.c])
45 AC_CONFIG_MACRO_DIR([m4])
46
47=== modified file 'debian/changelog'
48--- debian/changelog 2011-03-15 12:15:28 +0000
49+++ debian/changelog 2011-03-24 16:01:02 +0000
50@@ -1,3 +1,24 @@
51+upstart (0.9.4-1ubuntu1) natty; urgency=low
52+
53+ * debian/manpages/upstart-events.7:
54+ - Corrected reference to Upstart man page (actually init).
55+ - Changed to using proper troff quotes.
56+ - Escaped dashes in event names.
57+ - Updated date.
58+ - Table 1:
59+ - Improved name.
60+ - Sorted columns: Events, References, and Notes.
61+ - Added unmounted-remote-filesystems event.
62+
63+ -- James Hunt <james.hunt@ubuntu.com> Thu, 24 Mar 2011 14:34:12 +0000
64+
65+upstart (0.9.4-1) natty; urgency=low
66+
67+ * New upstream release 0.9.4:
68+ - scripts/initctl2dot.py: Fixes to handle 'emits' glob syntax.
69+
70+ -- James Hunt <james.hunt@ubuntu.com> Thu, 24 Mar 2011 14:31:26 +0000
71+
72 upstart (0.9.3-1) natty; urgency=low
73
74 * New upstream release 0.9.3:
75
76=== modified file 'debian/manpages/upstart-events.7'
77--- debian/manpages/upstart-events.7 2011-03-04 17:17:18 +0000
78+++ debian/manpages/upstart-events.7 2011-03-24 16:01:02 +0000
79@@ -1,14 +1,16 @@
80 '\" t
81-.TH upstart-events 7 2011-03-04 "Upstart-Events"
82+.TH upstart-events 7 2011-03-24 upstart
83 .\"
84 .SH NAME
85 upstart-events \- Well-known Upstart events summary
86 .\"
87 .SH Event Summary
88
89-This manual page summarizes well-known \fBUpstart\fP(8) events. It is
90-not an exhaustive list of all possible events, but rather details a
91-standard set of events expected to be generated on any Ubuntu system
92+This manual page summarizes well-known events generated by the Upstart
93+.BR init (8)
94+daemon.
95+It is not an exhaustive list of all possible events, but rather details
96+a standard set of events expected to be generated on any Ubuntu system
97 running Upstart.
98
99 The primary table, \fBTable 1\fP, encodes the well-known events, along
100@@ -20,11 +22,11 @@
101 The \fIRef\fP (Reference) column is used to refer to individual
102 events succinctly in the \fITime\fP column.
103
104-Note that the \'<\' and \'>\' characters in the \fITime\fP column denote
105+Note that the \(aq<\(aq and \(aq>\(aq characters in the \fITime\fP column denote
106 that the event in the \fIEvent\fP column occurs respectively before or
107 after the event specified in the \fITime\fP column (for example, the
108 \fBmounting\fP(7) event occurs "at some time" after the \fBstartup\fP(7)
109-event, and the \fBvirtual-filesystems\fP(7) event occurs after the last
110+event, and the \fBvirtual\-filesystems\fP(7) event occurs after the last
111 \fBmounted\fP(7) event relating to a virtual filesystem has been emitted).
112
113 For further details on events, consult the manual pages and the job
114@@ -38,47 +40,52 @@
115 .po 0
116 .in 0
117 .sp 1
118-\fBTable 1: Event Summary.\fP
119+\fBTable 1: Well-Known Event Summary.\fP
120 .TS
121 box, tab (@);
122 c | c | c | c | c | c
123 c | l | c | c | l | c.
124 Ref@Event@Type@Emit@Time@Note
125 =
126-1@\fBstartup\fP(7)@S@I@Boot@A
127-2@\fBmounting\fP(7)@H@M@> (1)@B
128-3@\fBmounted\fP(7)@H@M@> associated (2)@C
129-4@\fBvirtual-filesystems\fP(7)@S@M@> last virtual FS (3)@D
130- @\fBlocal-filesystems\fP(7)@S@M@> (4)@
131- @\fBremote-filesystems\fP(7)@S@M@> (4)@
132- @\fBfilesystem\fP@S@M@After last (3)@E
133- @\fBall-swaps\fP@S@M@> (1)@
134- @\fBcontrol-alt-delete\fP(7)@S@A@> (1)@F
135- @\fBkeyboard-request\fP(7)@S@A@> (1)@G
136- @\fBpower-status-changed\fP(7)@S@I@> (1)@H
137- @\fBrunlevel\fP(7)@M@T@> (1)@
138- @login-session-start@H@D@< DM running@I
139- @desktop-session-start@H@D@> \fBX\fP(7) session created@J
140-5@net-device-added@S@U@> (1)@K
141- @net-device-changed@S@U@> (1)@K
142-6@net-device-removed@S@U@> (1)@K
143- @net-device-up@S@F,N@> (5)@K
144- @net-device-down@S@F@< (6)@K
145- @drm-device-added@S@U@> (1)@K
146- @graphics-device-added@S@U@> (1)@K
147- @\fBstarting\fP(7)@H@I@< job starts@L
148- @\fBstarted\fP(7)@S@I@> job started@L
149- @\fBstopping\fP(7)@H@I@< job stops@L
150- @\fBstopped\fP(7)@S@I@> job stopped@L
151- @\fBsocket\fP(7)@S@I@> socket connection@
152- @dbus-activation@S@B@> D-Bus client request@
153+ @\fBall\-swaps\fP@S@M@> (5)@
154+ @\fBcontrol\-alt\-delete\fP(7)@S@A@> (5)@A
155+ @dbus\-activation@S@B@> D\-Bus client request@
156+ @desktop\-session\-start@H@D@> \fBX\fP(7) session created@B
157+ @drm\-device\-added@S@U@> (5)@C
158+ @\fBfilesystem\fP@S@M@After last (1)@D
159+ @graphics\-device\-added@S@U@> (5)@C
160+ @\fBkeyboard\-request\fP(7)@S@A@> (5)@E
161+ @\fBlocal\-filesystems\fP(7)@S@M@> (6)@
162+ @login\-session\-start@H@D@< DM running@F
163+1@\fBmounted\fP(7)@H@M@> associated (2)@G
164+2@\fBmounting\fP(7)@H@M@> (5)@H
165+3@net\-device\-added@S@U@> (5)@C
166+ @net\-device\-changed@S@U@> (5)@C
167+ @net\-device\-down@S@F@< (4)@C
168+4@net\-device\-removed@S@U@> (5)@C
169+ @net\-device\-up@S@F,N@> (3)@C
170+ @\fBpower\-\%status\-\%changed\fP(7)@S@I@> (5)@I
171+ @\fBremote\-\%filesystems\fP(7)@S@M@> (6)@
172+ @\fBrunlevel\fP(7)@M@T@> (5)@
173+ @\fBsocket\fP(7)@S@S@> socket connection@
174+5@\fBstartup\fP(7)@S@I@Boot@J
175+ @\fBstarted\fP(7)@S@I@> job started@K
176+ @\fBstarting\fP(7)@H@I@< job starts@K
177+ @\fBstopped\fP(7)@S@I@> job stopped@K
178+ @\fBstopping\fP(7)@H@I@< job stops@K
179+ @T{
180+unmounted\-\:remote\-\:filesystems
181+T}@H@V@T{
182+> last remote FS unmounted
183+T}@L
184+6@\fBvirtual\-\:filesystems\fP(7)@S@M@> last virtual FS (1)@M
185 .TE
186 .po \n[old_po]
187 .in \n[old_in]
188 .P
189 Key:
190- \'FS\' is an abbreviation for filesystem.
191- \'DM\' is an abbreviation for Display Manager.
192+ \(aqFS\(aq is an abbreviation for filesystem.
193+ \(aqDM\(aq is an abbreviation for Display Manager.
194
195 .\"
196 .P
197@@ -119,15 +126,16 @@
198 Ref@Emitter@Notes
199 =
200 A@System Administrator (initiator)@Technically emitted by init(8).
201-B@\fBdbus-daemon\fP(1)@Run with "\fI--activation=upstart"\fP
202+B@\fBdbus\-daemon\fP(1)@Run with "\fI\-\-activation=upstart"\fP
203 D@Display Manager@e.g. gdm/kdm/xdm.
204 F@\fBifup\fP(8) or \fBifdown\fP(8)@See \fI/etc/network/\fP.
205 I@\fBinit\fP(8)@
206 M@\fBmountall\fP(8)@
207-N@network-interface job@
208-S@\fBupstart-socket-bridge\fP(8)@
209+N@network\-interface job@
210+S@\fBupstart\-socket\-bridge\fP(8)@
211 T@\fBtelinit\fP(8), \fBshutdown\fP(8)@
212-U@\fBupstart-udev-bridge\fP(8)@
213+U@\fBupstart\-udev\-bridge\fP(8)@
214+V@System V init system@
215 .TE
216 .po \n[old_po]
217 .in \n[old_in]
218@@ -145,42 +153,41 @@
219 c | l.
220 Note@Detail
221 =
222-A@Initial event.
223-B@T{
224-Emitted when mount attempt for single entry from \fBfstab\fP(5)
225-for any filesystem type is about to begin.
226-T}
227-C@Generated for each mount that completes successfully.
228-D@Emitted when all virtual filesystems (such as \fI/proc\fR) mounted.
229-E@Note this is in the singular - there is no \'filesystems\' event.
230-F@T{
231+A@T{
232 Requires administrator to press Control-Alt-Delete key
233 combination on the console.
234 T}
235-G@T{
236+B@Event generated when user performs graphical login.
237+C@T{
238+These are specific examples. \fBupstart\-udev\-bridge\fP(8) will emit
239+events which match the pattern, "\fIS\fP\-device\-\fIA\fP" where
240+\(aqS\(aq is the udev \fIsubsystem\fP and \(aqA\(aq is the udev \fIaction\fP. See
241+\fBudev\fP(7) and for further details. If you have sysfs
242+mounted, you can look in \fI/sys/class/\fP for possible values for subsystem.
243+T}
244+D@Note this is in the singular - there is no \(aqfilesystems\(aq event.
245+E@T{
246 Emitted when administrator presses Alt-UpArrow key combination on
247 the console.
248 T}
249-H@Emitted when Upstart receives the SIGPWR signal.
250-I@T{
251+F@T{
252 Denotes Display Manager running (about to be displayed), but no users
253 logged in yet.
254 T}
255-
256-J@Event generated when user performs graphical login.
257+G@Generated for each mount that completes successfully.
258+H@T{
259+Emitted when mount attempt for single entry from \fBfstab\fP(5)
260+for any filesystem type is about to begin.
261+T}
262+I@Emitted when Upstart receives the SIGPWR signal.
263+J@Initial event.
264 K@T{
265-These are specific examples. \fBupstart-udev-bridge\fP(8) will emit
266-events which match the pattern, "\fIS\fP-device-\fIA\fP" where \'S\' is
267-the udev \fIsubsystem\fP and \'A\' is the udev \fIaction\fP. See
268-\fBudev\fP(7) and for further details. If you have
269-.BR sysfs (2)
270-mounted, you can look in \fI/sys/class/\fP for possible values for subsystem.
271-T}
272-L@T{
273 Although the events are emmitted by \fBinit\fP(8), the instigator may be
274 \fBinitctl\fP(8) if a System Administrator has manually started or
275 stopped a job.
276 T}
277+L@\fI/etc/init/umountnfs.sh\fP.
278+M@Emitted when all virtual filesystems (such as \fI/proc\fR) mounted.
279 .TE
280 .po \n[old_po]
281 .in \n[old_in]
282@@ -193,7 +200,7 @@
283 Upstart emits the \fBstarting\fP(7) event denoting the job is
284 "about to start". The \fBstarting\fP(7) event completes.
285 .IP \n+[step] 3
286-If the \fBpre-start\fP stanza exists, the pre-start process is
287+If the \fBpre\-start\fP stanza exists, the pre\-start process is
288 spawned.
289 .IP \n+[step] 3
290 Upstart spawns the main process.
291@@ -202,7 +209,7 @@
292 descendent of the immediate child process if \fBexpect fork\fP or
293 \fBexpect daemon\fP has been specified.
294 .IP \n+[step] 3
295-If the \fBpost-start\fP stanza exists, the post-start process is
296+If the \fBpost\-start\fP stanza exists, the post\-start process is
297 spawned.
298 .IP \n+[step] 3
299 Upstart emits the \fBstarted\fP(7) event.
300@@ -214,7 +221,7 @@
301
302 .nr step 1 1
303 .IP \n[step] 3
304-If the \fBpre-stop\fP stanza exists, the pre-stop process is
305+If the \fBpre\-stop\fP stanza exists, the pre\-stop process is
306 spawned.
307 .IP \n+[step] 3
308 The main process is stopped:
309@@ -234,7 +241,7 @@
310 .IP \n+[step] 3
311 Upstart emits the \fBstopping\fP(7) event.
312 .IP \n+[step] 3
313-If the \fBpost-stop\fP stanza exists, the post-stop process is
314+If the \fBpost\-stop\fP stanza exists, the post\-stop process is
315 spawned.
316 .IP \n+[step] 3
317 Upstart emits the \fBstopped\fP(7) event.
318
319=== modified file 'init/tests/test_control.c'
320--- init/tests/test_control.c 2011-02-23 09:35:03 +0000
321+++ init/tests/test_control.c 2011-03-24 16:01:02 +0000
322@@ -933,9 +933,12 @@
323
324 strcpy (filename, dirname);
325 strcat (filename, "/baz");
326+
327+ /* XXX: note that this will generate an error message when this
328+ * test runs sine "/baz" does not exist as a directory.
329+ */
330 source3 = conf_source_new (NULL, filename, CONF_DIR);
331
332-
333 message = nih_new (NULL, NihDBusMessage);
334 message->connection = NULL;
335 message->message = NULL;
336
337=== modified file 'po/upstart.pot'
338--- po/upstart.pot 2011-03-15 16:22:27 +0000
339+++ po/upstart.pot 2011-03-24 16:01:02 +0000
340@@ -6,9 +6,9 @@
341 #, fuzzy
342 msgid ""
343 msgstr ""
344-"Project-Id-Version: upstart 0.9.3\n"
345+"Project-Id-Version: upstart 0.9.4\n"
346 "Report-Msgid-Bugs-To: new@bugs.launchpad.net\n"
347-"POT-Creation-Date: 2011-03-15 14:08+0000\n"
348+"POT-Creation-Date: 2011-03-24 11:26+0000\n"
349 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
350 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
351 "Language-Team: LANGUAGE <LL@li.org>\n"
352
353=== modified file 'scripts/initctl2dot.py'
354--- scripts/initctl2dot.py 2011-03-10 14:06:37 +0000
355+++ scripts/initctl2dot.py 2011-03-24 16:01:02 +0000
356@@ -32,12 +32,12 @@
357 # Usage:
358 #
359 # initctl show-config -e > initctl.out
360-# initctl2dot.py -f initctl.out -o upstart.dot
361+# initctl2dot -f initctl.out -o upstart.dot
362 # dot -Tpng -o upstart.png upstart.dot
363 #
364 # Or more simply:
365 #
366-# initctl2dot.py -o - | dot -Tpng -o upstart.png
367+# initctl2dot -o - | dot -Tpng -o upstart.png
368 #
369 # See also:
370 #
371@@ -48,6 +48,7 @@
372
373 import sys
374 import re
375+import fnmatch
376 import os
377 from string import split
378 import datetime
379@@ -78,12 +79,15 @@
380 def header(ofh):
381 global options
382
383- str = "digraph upstart {"
384- str += " node [shape=record];"
385- str += " rankdir=LR;"
386- str += " overlap=false;"
387- str += " bgcolor=\"%s\";" % options.color_bg
388- str += " fontcolor=\"%s\";" % options.color_text
389+ str = "digraph upstart {\n"
390+
391+ # make the default node an event to simplify glob code
392+ str += " node [shape=\"diamond\", fontcolor=\"%s\", fillcolor=\"%s\", style=\"filled\"];\n" \
393+ % (options.color_event_text, options.color_event)
394+ str += " rankdir=LR;\n"
395+ str += " overlap=false;\n"
396+ str += " bgcolor=\"%s\";\n" % options.color_bg
397+ str += " fontcolor=\"%s\";\n" % options.color_text
398
399 ofh.write(str)
400
401@@ -107,11 +111,12 @@
402 (cmd, os.uname()[1])
403
404 epilog += "Boxes of color %s denote jobs.\\n" % options.color_job
405- epilog += "Diamonds of color %s denote events.\\n" % options.color_event
406+ epilog += "Solid diamonds of color %s denote events.\\n" % options.color_event
407+ epilog += "Dotted diamonds denote 'glob' events.\\n"
408 epilog += "Emits denoted by %s lines.\\n" % options.color_emits
409 epilog += "Start on denoted by %s lines.\\n" % options.color_start_on
410 epilog += "Stop on denoted by %s lines.\\n" % options.color_stop_on
411- epilog += "\";"
412+ epilog += "\";\n"
413 epilog += "}\n"
414 ofh.write(epilog)
415
416@@ -121,7 +126,7 @@
417 def sanitise(s):
418 return s.replace('-', '_').replace('$', 'dollar_').replace('[', \
419 'lbracket').replace(']', 'rbracket').replace('!', \
420- 'bang').replace(':', '_')
421+ 'bang').replace(':', '_').replace('*', 'star').replace('?', 'question')
422
423
424 # Convert a dollar in @name to a unique-ish new name, based on @job and
425@@ -148,10 +153,17 @@
426
427 def show_event(ofh, name):
428 global options
429- ofh.write("""
430- %s [label=\"%s\", shape=diamond, fontcolor=\"%s\", fillcolor=\"%s\", style=\"filled\"];
431- """ % (mk_event_node_name(name), name, options.color_event_text, options.color_event))
432-
433+ str = "%s [label=\"%s\", shape=diamond, fontcolor=\"%s\", fillcolor=\"%s\"," % \
434+ (mk_event_node_name(name), name, options.color_event_text, options.color_event)
435+
436+ if '*' in name:
437+ str += " style=\"dotted\""
438+ else:
439+ str += " style=\"filled\""
440+
441+ str += "];\n"
442+
443+ ofh.write(str)
444
445 def show_events(ofh):
446 global events
447@@ -193,7 +205,7 @@
448 global options
449
450 ofh.write("""
451- %s [label=\"<job> %s | { <start> start on | <stop> stop on }\", fontcolor=\"%s\", style=\"filled\", fillcolor=\"%s\"];
452+ %s [shape=\"record\", label=\"<job> %s | { <start> start on | <stop> stop on }\", fontcolor=\"%s\", style=\"filled\", fillcolor=\"%s\"];
453 """ % (mk_job_node_name(name), name, options.color_job_text, options.color_job))
454
455
456@@ -288,6 +300,8 @@
457 global options
458 global restrictions_list
459
460+ glob_jobs = {}
461+
462 if restrictions_list:
463 jobs_list = restrictions_list
464 else:
465@@ -308,6 +322,14 @@
466 show_stop_on_event_edge(ofh, job, s)
467
468 for e in jobs[job]['emits']:
469+ if '*' in e:
470+ # handle glob patterns in 'emits'
471+ glob_events = []
472+ for _e in events:
473+ if e != _e and fnmatch.fnmatch(_e, e):
474+ glob_events.append(_e)
475+ glob_jobs[job] = glob_events
476+
477 show_job_emits_edge(ofh, job, e)
478
479 if not restrictions_list:
480@@ -325,6 +347,12 @@
481 for e in jobs[j]['emits']:
482 show_job_emits_edge(ofh, j, e)
483
484+ # Create links from jobs (which advertise they emits a class of
485+ # events, via the glob syntax) to all the events they create.
486+ for g in glob_jobs:
487+ for ge in glob_jobs[g]:
488+ show_job_emits_edge(ofh, g, ge)
489+
490 if not restrictions_list:
491 return
492

Subscribers

People subscribed via source and target branches

to all changes: