[augeas-devel] augeas on AIX

Kristof Willaert kristof.willaert at gmail.com
Mon Jun 15 08:58:45 UTC 2009


David,

On Sun, Jun 14, 2009 at 6:37 AM, David Lutterkort<lutter at redhat.com> wrote:
> On Sat, 2009-06-13 at 15:22 +0200, Kristof Willaert wrote:
>> I have been trying to build Augeas on AIX (5.3).
>
> Excellent ! I know nothing about AIX, but would love to have Augeas work
> there.

>> So far I have been able
>> to get it to compile and run without segfaulting. Had to work around the
>> non-existing getopt_long in AIX, and manually link a few gnulib .o files into
>> libfa, but it is running.
>
> Can you send details of what you needed to do ? I'd like to add that in.

Sure.
The getopt_long function does not exist in AIX libc, and there is no substitute
in gnulib. So I kind of mangled the source and used getopt instead (getopt_long
only adds the --noload and --nostdinc arguments I think, and just to
get it to compile
they were not crucial).
There is definitely a better way to fix this, but due to my lack of C skills ...

The second problem was a "referenced symbol not found" error in libfa.
Asprintf (and vasprintf) is missing from the AIX libc. Configure notices that:

checking for vasprintf... no

and make compiles asprintf.c and vasprintf.c in gnulib/lib.
But these are not linked into libfa.

So I manually linked them with gcc -shared ..., which did the trick

On a related note, I also compiled Augeas on a stock Solaris 10 (yes we have an
exotic range of machines to administer :), I'll send the fixes I had
to perform if
you want. So far tests on Solaris have been successful.

>> What isn't working, is that I don't see anything in the /files subtree
>> in augtool.
>> The /augeas subtree is populated with all the lenses, but nothing appears
>> in /files:
>>
>> nim  > augtool
>> augtool> ls /
>> augeas/ = (none)
>> files = (none)
>> augtool> ls /files
>> augtool>
>
> Does 'print /augeas//error' show anything ? Might be best if you can run
> 'augtool print >somefile.txt' and send that file as an attachment.

print /augeas//error gives me nothing.

nim  > augtool
augtool> print /augeas//error
augtool>

Augtool print output below. I removed all lenses except the
aliases.aug, util.aug and
sudoers.aug to simplify things (aliases file and sudoers are
syntactically the same
on all unices I think):

nim  > augtool print
/augeas
/augeas/root = "/"
/augeas/version = "0.5.0"
/augeas/version/save
/augeas/version/save/mode[1] = "backup"
/augeas/version/save/mode[2] = "newfile"
/augeas/version/save/mode[3] = "noop"
/augeas/version/save/mode[4] = "overwrite"
/augeas/version/defvar
/augeas/save = "overwrite"
/augeas/load
/augeas/load/Aliases
/augeas/load/Aliases/lens = "@Aliases"
/augeas/load/Aliases/incl = "/etc/aliases"
/augeas/load/Sudoers
/augeas/load/Sudoers/lens = "@Sudoers"
/augeas/load/Sudoers/incl = "/etc/sudoers"
/augeas/load/Sudoers/excl[1] = "*.augnew"
/augeas/load/Sudoers/excl[2] = "*.augsave"
/augeas/load/Sudoers/excl[3] = "*.rpmsave"
/augeas/load/Sudoers/excl[4] = "*.rpmnew"
/augeas/load/Sudoers/excl[5] = "*~"
/augeas/files
/files
nim >

So it does not load any config files (while they are available on the system).

>> When I truss (strace equivalent on AIX) the binary, I see the files
>> the lenses are
>> supposed to edit being stat'ed, but not opened, while on linux the files seem to
>> get opened when starting augtool.
>>
>> Eg. for /etc/sudoers:
>>
>> statx("/", 0x2FF20398, 176, 020)                = 0
>> statx("./", 0x2FF20398, 176, 020)               = 0
>> chdir("etc/")                                   = 0
>> statx("sudoers", 0x2FF208C8, 128, 010)          = 0
>> chdir("/")                                      = 0
>> chdir("/usr/local/share/augeas/lenses/dist")    = 0
>> open("/usr/share/lib/terminfo/x/xterm", O_RDONLY) = 3
>> kread(3, "1A01 $\0 %\0 !\0 �01 d02".., 4096)    = 1686
>> close(3)                                        = 0
>
> Yeah, something's fishy with that ... it also seems that it's not
> reading any lenses; are the lenses
> in /usr/local/share/augeas/lenses/dist ? You should see it open a bunc
> of .aug files.

This was just a snippet of the truss output. The loading of the lenses
does appear,
it is only the loading of the files that seems not to happen.
I attached the complete output.

kristof
-------------- next part --------------
A non-text attachment was scrubbed...
Name: truss.out
Type: application/octet-stream
Size: 35526 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/augeas-devel/attachments/20090615/2969d066/attachment.obj>


More information about the augeas-devel mailing list