nbd-server claims oldstyle exports not configured

Bug #1342949 reported by Brian Candler on 2014-07-16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
nbd (Ubuntu)

Bug Description

[ubuntu 14.04]

Given the following config file:

---- /etc/nbd-server/config ----
# If you want to run everything as root rather than the nbd user, you
# may either say "root" in the two following lines, or remove them
# altogether. Do not remove the [generic] section, however.
 user = nbd
 group = nbd
 includedir = /etc/nbd-server/conf.d
 listenaddr =
 oldstyle = true

# What follows are export definitions. You may create as much of them as
# you want, but the section header has to be unique.
        exportname = /data/nbd/disk1.img
        flush = true
        fua = true
        port = 20001

When you restart nbd-server the following severe-sounding warning is reported:

# service nbd-server restart
Restarting the Network Block Device server is pretty harsh on clients still using it.
waiting 5 seconds...You have been warned!
Restarting Network Block Device server: Stopping Network Block Device server: nbd-server.

** (process:19655): WARNING **: A port was specified, but oldstyle exports were not requested. This may not do what you expect.

** (process:19655): WARNING **: Please read 'man 5 nbd-server' and search for oldstyle for more info

However very clearly "oldstyle = true" has been set in the config. This config is definitely being read, because setting "oldstyle = blah" gives an error about invalid boolean.

Looking at source: it seems that glob_flags is not updated until after parse_cfile has returned:

        servers = parse_cfile(config_file_pos, &genconf, &err);

        /* Update global variables with parsed values. This will be
         * removed once we get rid of global configuration variables. */
        glob_flags |= genconf.flags;

However this warning comes from within parse_cfile and based on the previous glob_flags setting.

                if(s.port && !(glob_flags & F_OLDSTYLE)) {
                        g_warning("A port was specified, but oldstyle exports were not requested. This may not do what you expect.");
                        g_warning("Please read 'man 5 nbd-server' and search for oldstyle for more info");

And a process *is* running and listening on port 20001.

ProblemType: Bug
DistroRelease: Ubuntu 14.04
Package: nbd-server 1:3.7-1
ProcVersionSignature: Ubuntu 3.13.0-30.55-generic
Uname: Linux 3.13.0-30-generic x86_64
ApportVersion: 2.14.1-0ubuntu3.2
Architecture: amd64
Date: Wed Jul 16 20:34:44 2014
InstallationDate: Installed on 2014-07-16 (0 days ago)
InstallationMedia: Ubuntu-Server 14.04 LTS "Trusty Tahr" - Release amd64 (20140416.2)
 PATH=(custom, no user)
SourcePackage: nbd
UpgradeStatus: No upgrade log present (probably fresh install)

Brian Candler (b-candler) wrote :
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in nbd (Ubuntu):
status: New → Confirmed
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers