dhcp support NSS file system?

Shane Kerr Shane_Kerr at isc.org
Thu Aug 2 13:17:17 UTC 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Just to be sure, you mean Novell Storage Services, right?

kalyanasundaram S wrote:
> It logs the message but nothing much. The initial log messages are,

> Aug  2 15:59:19 test-54 dhcpd: Can't backup lease database /media/nss/LOCALVOL/var/lib/dhcp/db/dhcpd.leases to /media/nss/LOCALVOL/var/lib/dhcp/db/dhcpd.leases~: Invalid argument

This is coming from the following code in db.c:

- ----------------------------------------------------------------------------
            if (link (path_dhcpd_db, backfname) < 0) {
                log_error ("Can't backup lease database %s to %s: %m",
                           path_dhcpd_db, backfname);
                goto fail;
            }
- ----------------------------------------------------------------------------

So, either:

1. backfname is not valid for NSS, or
2. hard links are not working on NSS.

I think it is probably the second, because the backup filename is just the
normal file name with a tilde, '~', added to it.

This page has a lot to say about hard links on NSS:

http://tinyurl.com/2sesr3

You have to do stuff with Linux users, you have to enable hard links on the
system, and so on.

> Aug  2 15:59:27 test-54 dhcpd: Can't create new lease file: Permission denied

This is coming from the following code in db.c:

- ----------------------------------------------------------------------------
        if (snprintf (newfname, sizeof newfname, "%s.%d",
                     path_dhcpd_db, (int)t) >= sizeof newfname)
                log_fatal("new_lease_file: lease file path too long");

        db_fd = open (newfname, O_WRONLY | O_TRUNC | O_CREAT, 0664);
        if (db_fd < 0) {
                log_error ("Can't create new lease file: %m");
                return 0;
        }
- ----------------------------------------------------------------------------

The server is creating a temporary file to put leases in - that is the file name
with the ".##########" at the end. (It's not random, it is the number of seconds
since 1970.)

I don't know how the permission structure works on NSS, so it is hard to
diagnose. However "Permission denied" is a pretty good hint. ;) Check the user
that named is running as, and the permissions on the directory.

But I don't understand why the files are created and then you get the error. :(
If the command fails, the file should not be there!

- --
Shane
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGsdlYMsfZxBO4kbQRApURAJ43zkdbjFzAFV5DmZq36vXdhxHFTwCfVdNM
lBgVoEkcMG+imok/sqJSH4I=
=HNww
-----END PGP SIGNATURE-----


More information about the dhcp-users mailing list