[Samba] Samba 4.2.0rc4 fails to start up

Jeremy Allison jra at samba.org
Tue Feb 10 13:57:24 MST 2015


On Tue, Feb 10, 2015 at 03:19:12PM -0500, Thomas Schulz wrote:
> I am trying to see if Samba 4.2.0rc4 will run on a Solaris 10 i386 system.
> After getting it to build, startup fails. Starting it up as
> 
> smbd -i -d 10
> 
> The output indicates that everything is starting normally until the
> following is output:
> 
> messaging_dgm_lockfile_create: ftruncate failed: Invalid argument

Code for that is here: source3/lib/messages_dgm.c:messaging_dgm_lockfile_create()

        /* no O_EXCL, existence check is via the fcntl lock */

        lockfile_fd = open(lockfile_name.buf, O_NONBLOCK|O_CREAT|O_WRONLY,
                           0644);
        if (lockfile_fd == -1) {
                ret = errno;
                DEBUG(1, ("%s: open failed: %s\n", __func__, strerror(errno)));
                return ret;
        }

        lck = (struct flock) {
                .l_type = F_WRLCK,
                .l_whence = SEEK_SET
        };

        ret = fcntl(lockfile_fd, F_SETLK, &lck);
        if (ret == -1) {
                ret = errno;
                DEBUG(1, ("%s: fcntl failed: %s\n", __func__, strerror(ret)));
                goto fail_close;
        }

        unique_len = snprintf(buf, sizeof(buf), "%ju\n", (uintmax_t)unique);

        /* shorten a potentially preexisting file */

        ret = ftruncate(lockfile_fd, unique_len);
        if (ret == -1) {
                ret = errno;
                DEBUG(1, ("%s: ftruncate failed: %s\n", __func__,
                          strerror(ret)));
                goto fail_unlink;
        }

Can you extend the DEBUG(1,) message to print out (a) the
filename and (b) the value of unique_len.

I'm guessing you're hitting this (from the Solaris man
pages):

The ftruncate() and truncate() functions will fail if:

EINTR
A signal was caught during execution.
EINVAL
The length argument was less than 0.

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Would be my guess...

EFBIG or EINVAL The length argument was greater than the maximum file size.

EIO
An I/O error occurred while reading from or writing to a file system.
EROFS
The named file resides on a read-only file system.
The truncate() function will fail if:

EACCES
A component of the path prefix denies search permission, or write permission is denied on the file.
EFAULT
The path argument points outside the process’ allocated address space.
EINVAL
The path argument is not an ordinary file.




More information about the samba mailing list