[augeas-devel] FreeBSD /etc/rc.conf
Richard W.M. Jones
rjones at redhat.com
Wed Mar 16 16:32:03 UTC 2011
On Thu, Nov 18, 2010 at 10:49:27AM +0000, Richard W.M. Jones wrote:
> On Thu, Nov 18, 2010 at 10:55:38AM +0100, Raphaël Pinson wrote:
> > You can certainly use shellvars.aug to parse this file. Add /etc/rc.conf
> > to filter_misc in shellvars.aug, see if it works and send the patch.
>
> Yes, that simple change does work. Attached is a formal patch.
>
> $ sudo guestfish --ro -d FreeBSD8x64
>
> Welcome to guestfish, the libguestfs filesystem interactive shell for
> editing virtual machine filesystems.
>
> Type: 'help' for help on commands
> 'man' to read the manual
> 'quit' to quit the shell
>
> ><fs> run
> ><fs> mount-vfs ro,ufstype=ufs2 ufs /dev/vda5 /
> ><fs> aug-init / 0
> ><fs> aug-ls /files/etc
> /files/etc/aliases
> /files/etc/crontab
> /files/etc/fstab
> /files/etc/group
> /files/etc/hosts
> /files/etc/inetd.conf
> /files/etc/ntp.conf
> /files/etc/pam.d
> /files/etc/rc.conf
> /files/etc/services
> /files/etc/ssh
> /files/etc/sysctl.conf
> ><fs> aug-ls /files/etc/rc.conf
> /files/etc/rc.conf/#comment[1]
> /files/etc/rc.conf/#comment[2]
> /files/etc/rc.conf/#comment[3]
> /files/etc/rc.conf/#comment[4]
> /files/etc/rc.conf/#comment[5]
> /files/etc/rc.conf/hostname
> /files/etc/rc.conf/ifconfig_re0
> /files/etc/rc.conf/keymap
> /files/etc/rc.conf/sshd_enable
> ><fs> aug-get /files/etc/rc.conf/hostname
> "freebsd8x64.home.annexia.org"
>
> Note the quotes around the name. I have noticed the same thing when
> parsing /etc/sysconfig/keyboard using Augeas. That is also a "shell
> script" configuration file (although probably not containing shell
> commands in 99% of cases).
>
> Do you consider the presence of quotes to be a bug?
>
> Could Augeas cope if I changed this setting to a string which
> contained spaces but was not quoted?
>
> Rich.
>
> --
> Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
> libguestfs lets you edit virtual machines. Supports shell scripting,
> bindings from many languages. http://et.redhat.com/~rjones/libguestfs/
> See what it can do: http://et.redhat.com/~rjones/libguestfs/recipes.html
> >From 1ff3b05c7f5fa7afc4a03cf8b1f6006787f3693d Mon Sep 17 00:00:00 2001
> From: Richard W.M. Jones <rjones at redhat.com>
> Date: Thu, 18 Nov 2010 10:48:19 +0000
> Subject: [PATCH] Add FreeBSD /etc/rc.conf file to Shellvars lens.
>
> ---
> lenses/shellvars.aug | 1 +
> 1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/lenses/shellvars.aug b/lenses/shellvars.aug
> index 86423bd..86790a5 100644
> --- a/lenses/shellvars.aug
> +++ b/lenses/shellvars.aug
> @@ -103,6 +103,7 @@ module Shellvars =
> let filter_misc = incl "/etc/arno-iptables-firewall/debconf.cfg"
> . incl "/etc/cron-apt/config"
> . incl "/etc/environment"
> + . incl "/etc/rc.conf"
>
> let filter = filter_sysconfig
> . filter_ifcfg
> --
> 1.7.3.2
>
I just checked augeas.git and this patch wasn't applied. Any reason
for that?
Rich.
--
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming blog: http://rwmj.wordpress.com
Fedora now supports 80 OCaml packages (the OPEN alternative to F#)
http://cocan.org/getting_started_with_ocaml_on_red_hat_and_fedora
-------------- next part --------------
>From a48fb7217fd8dcdb78f5c75569fc2f176b6258f2 Mon Sep 17 00:00:00 2001
From: Richard W.M. Jones <rjones at redhat.com>
Date: Thu, 18 Nov 2010 10:48:19 +0000
Subject: [PATCH] Add FreeBSD /etc/rc.conf file to Shellvars lens.
---
lenses/shellvars.aug | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/lenses/shellvars.aug b/lenses/shellvars.aug
index d25768d..3a64b38 100644
--- a/lenses/shellvars.aug
+++ b/lenses/shellvars.aug
@@ -118,6 +118,7 @@ module Shellvars =
let filter_misc = incl "/etc/arno-iptables-firewall/debconf.cfg"
. incl "/etc/cron-apt/config"
. incl "/etc/environment"
+ . incl "/etc/rc.conf"
let filter = filter_sysconfig
. filter_ifcfg
--
1.7.4
More information about the augeas-devel
mailing list