Subject: Re: bug#35584: CD/DVD does not work

From: Danny Milosavljevic <[email-masked]>
Date: Wed, 29 Jul 2020 15:18:49 +0200

Hi,

On Wed, 29 Jul 2020 00:15:39 +0000
Luis Felipe via Bug reports for GNU Guix <[email-masked]> wrote:

> There is one thing I hadn't noticed before, though. If I insert a DVD while I'm in a GNOME session, it doesn't work (that's the bug), but if I reboot with the DVD still in, log in to GNOME and open Nautilus, the DVD is listed and it works correctly. After doing this, if I extract the DVD and insert it again, it still doesn't work.

Checking nautilus sources, it uses GVolumeMonitor which is part of glib (gio).
That uses GUnixMountMonitor, and that checks /proc/mounts and fstab.

fstab is found like this:

static char *
get_fstab_file (void)
{
#ifdef HAVE_LIBMOUNT
  return (char *) mnt_get_fstab_path ();
#else
#if defined(HAVE_SYS_MNTCTL_H) && defined(HAVE_SYS_VMOUNT_H) && defined(HAVE_SYS_VFS_H)
  /* AIX */
  return "/etc/filesystems";
#elif defined(_PATH_MNTTAB)
  return _PATH_MNTTAB;
#elif defined(VFSTAB)
  return VFSTAB;
#else
  return "/etc/fstab";
#endif
#endif
}

libmount is part of util-linux, which has:

/**
 * mnt_get_fstab_path:
 *
 * Returns: path to /etc/fstab or $LIBMOUNT_FSTAB.
 */
const char *mnt_get_fstab_path(void)
{
        const char *p = safe_getenv("LIBMOUNT_FSTAB");
        return p ? : _PATH_MNTTAB;
}

In order to debug this problem, please try setting the environment variable
before starting nautilus, like this:

killall nautilus
export LIBMOUNT_FSTAB=/etc/fstab
nautilus

Then check whether detecting changes in CD/DVD state work fine like this.