~ubuntu-branches/ubuntu/natty/cloud-init/natty-proposed

« back to all changes in this revision

Viewing changes to debian/patches/333-fix-action-on-emty-def_log_file.patch

  • Committer: Package Import Robot
  • Author(s): Scott Moser
  • Date: 2011-02-19 01:16:10 UTC
  • mfrom: (60.1.25 natty)
  • Revision ID: package-import@ubuntu.com-20110219011610-rcf4ll5uuzqh9bdn
* New upstream release.
* fix for puppet configuration options (LP: #709946) [Ryan Lane]
* fix pickling of DataSource, which broke seeding.
* turn resize_rootfs default to True
* avoid mounts in DataSourceOVF if 'read' on device fails
  'mount /dev/sr0' for an empty virtual cdrom device was taking 18 seconds
* add 'manual_cache_clean' option to select manual cleaning of
  the /var/lib/cloud/instance/ link, for a data source that might
  not be present on every boot
* make DataSourceEc2 retries and timeout configurable
* add 'bootcmd' like 'runcmd' to cloud-config syntax for running things early
* move from '#opt_include' in config file format to conf_d.
  now local config files should live in /etc/cloud/cloud.cfg.d/
* move /etc/cloud/distro.cfg to /etc/cloud/cloud.cfg.d/90_dpkg.cfg
* allow /etc/hosts to be written from hosts.tmpl. which allows
  getting local-hostname into /etc/hosts (LP: #720440)
* better handle startup if there is no eth0 (LP: #714807)
* update rather than append in puppet config [Marc Cluet]
* add cloud-config for mcollective [Marc Cluet]

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
------------------------------------------------------------
2
 
revno: 333
3
 
committer: Scott Moser <smoser@ubuntu.com>
4
 
branch nick: trunk
5
 
timestamp: Thu 2011-01-27 10:27:54 -0500
6
 
message:
7
 
  take correct action if def_log_file and syslog_fix_perms are empty
8
 
=== modified file 'cloudinit/__init__.py'
9
 
--- old/cloudinit/__init__.py   2011-01-27 14:30:37 +0000
10
 
+++ new/cloudinit/__init__.py   2011-01-27 15:27:54 +0000
11
 
@@ -482,13 +482,12 @@
12
 
     util.ensure_dirs(dlist)
13
 
 
14
 
     cfg = util.get_base_cfg(system_config,cfg_builtin,parsed_cfgs)
15
 
-    log_file = None
16
 
-    if 'def_log_file' in cfg:
17
 
-        log_file = cfg['def_log_file']
18
 
+    log_file = util.get_cfg_option_str(cfg, 'def_log_file', None)
19
 
+    perms = util.get_cfg_option_str(cfg, 'syslog_fix_perms', None)
20
 
+    if log_file:
21
 
         fp = open(log_file,"ab")
22
 
         fp.close()
23
 
-    if log_file and 'syslog_fix_perms' in cfg:
24
 
-        perms = cfg['syslog_fix_perms']
25
 
+    if log_file and perms:
26
 
         (u,g) = perms.split(':',1)
27
 
         if u == "-1" or u == "None": u = None
28
 
         if g == "-1" or g == "None": g = None
29
 
 
30
 
=== modified file 'doc/examples/cloud-config.txt'
31
 
--- old/doc/examples/cloud-config.txt   2011-01-26 22:09:52 +0000
32
 
+++ new/doc/examples/cloud-config.txt   2011-01-27 15:27:54 +0000
33
 
@@ -328,3 +328,21 @@
34
 
 # timezone: set the timezone for this instance
35
 
 # the value of 'timezone' must exist in /usr/share/zoneinfo
36
 
 timezone: US/Eastern
37
 
+
38
 
+# def_log_file and syslog_fix_perms work together
39
 
+# if 
40
 
+# - logging is set to go to a log file 'L' both with and without syslog
41
 
+# - and 'L' does not exist
42
 
+# - and syslog is configured to write to 'L'
43
 
+# then 'L' will be initially created with root:root ownership (during
44
 
+# cloud-init), and then at cloud-config time (when syslog is available)
45
 
+# the syslog daemon will be unable to write to the file.
46
 
+# 
47
 
+# to remedy this situation, 'def_log_file' can be set to a filename
48
 
+# and syslog_fix_perms to a string containing "<user>:<group>"
49
 
+#
50
 
+# the default values are '/var/log/cloud-init.log' and 'syslog:adm'
51
 
+# the value of 'def_log_file' should match what is configured in logging
52
 
+# if either is empty, then no change of ownership will be done
53
 
+def_log_file: /var/log/my-logging-file.log
54
 
+syslog_fix_perms: syslog:root
55