.mntcheck file not being created.


  • Moderator

    I just installed svn 4405 cloud 5469 on Fedora 23 Server - minimal install.

    The issue is that configureStorage() subroutine has both the code for creating /images/.mntcheck and /images both under the same if statement that checks if /images exists or not.

    And, because I had created a mount point called /images during the OS installation (to give images their own partition), the if statement sees it exists, then doesn’t create /images/.mntcheck.

    Here’s what I did to fix it. It’s quite easy when I have example syntax right in front of me ;-)

    svn/trunk/lib/common/functions.sh

    configureStorage() {
        dots "Setting up storage";
        if [ ! -d "$storage" ]; then
            mkdir "$storage" >/dev/null 2>&1
            chmod -R 777 "$storage" >/dev/null 2>&1
        fi
        if [ ! -d "$storage/.mntcheck" ]; then
            touch "$storage/.mntcheck" >/dev/null 2>&1
            chmod -R 777 "$storage" >/dev/null 2>&1
        fi
    

  • Moderator

    @Tom-Elliott said:

    For future reference, -d in bash speak means to test if the directory exists, -f would be the proper argument to test if a file is present.

    That makes a lot of sense. Prob would explain the error I kept having…


  • Senior Developer

    I’ve added this to the installer, so that it will check if the .mntcheck files are present and create them if necessary. For future reference, -d in bash speak means to test if the directory exists, -f would be the proper argument to test if a file is present.


  • Moderator

    @ch3i It’s probably wise to only change permissions if the directory / file was just created. Otherwise custom setups will get their permissions changed to 777 every time they run the installer.



  • It is my experience as well, the .mntcheck filea are not created. I did a fresh install on CentOS 6.7 a couple of weeks ago. My images are stored in /home/images

    I spent some time figure out why an upload did not work. The .mnt files where not created during the install. I had to install them manually.


  • Senior Developer

    Rereading a bit, it would make sense that the .mntcheck files aren’t being created if /images exists. This is for good reason. Most will know to create the .mntcheck. I will look into adding this to the inits as it would make greater sense.


  • Senior Developer

    I, too, am using the selinux policy from jbob and noticed a strange problem, though it’s most likely related to my centos being 6.7 vs his setup which is focused at centos 7. My database would not be contacted if selinux was set to enforcing, changing to permissive fixed the connection problem I was seeing. I’m wondering, now, if this same problem is preventing the creation of the .mntcheck files. If it were the case of .mntcheck not being created wouldn’t there be a problem with imaging for everybody who installs fresh?


  • Moderator

    @Wayne-Workman You can execute chmod -R 777 "$storage" >/dev/null 2>&1 outside the IFs after them, one ligne of code saved lol


Log in to reply
 

356
Online

39.3k
Users

11.0k
Topics

104.4k
Posts

Looks like your connection to FOG Project was lost, please wait while we try to reconnect.