mm..odd
There are two reasons why the script php script will report "fail" when mounting the share partition.
(1) it can not create the directory /share/1000
(2) it can not mount the partition on /share/1000
For (1) it uses the command
- Code: Select all
exec("sudo /bin/mkdir -p ".$dir ,$result,$ret);
To make this work the user "nobody" must be defined, which is done in creating the passwd file before the mount script runs
For (2) it use the mount command
When (1) or (2) fails an entry is made in the system log (/var/log/messages) there you should be able to find if command (1) failed or (2). Of course if (1) fails also (2) will fail as no mountpoint is present.
Now the strange point is that at second boot everything goes ok. As in the clean firmware the passwd file is not present but created at first boot this could be the cause of the problem when the passwd file is created after the mount script. (At second boot the passwd file from first boot is still there. That has been changed in fvdw7-0 and later version first create the passwd file and then mount the share partition. At every boot the passwd file is deleted and recreated so when it works at second boot then the passwd file is not the problem to my opinion.
Please have a look at /var/log/messages after the first boot maybe that helps us to give an indication what wrong. There should be an massage like ..Failed to create DIR ... and/or ..Failed to mount
You can also check if the folder /share/1000 is present or not , if it is present then the the command (1) was succesful as in the clean firmware the folder/share/1000 is not present. In that case the mount command fails at first boot
for reference this is the function used in the php script
- Code: Select all
function dm_mount_all() // Mounting all the MD's
{
global $config,$g;
$error = 0;
if (is_booting())
echo " * Starting mount of volumes...\n";
$share=SHARE_MOUNTPOINT;
if ($config['vols']['vol'])
{
foreach ($config['vols']['vol'] as $value)
{
$volerr = 0;
if (is_booting())
echo " - Mounting volume {$value['name']}: \n";
//Check if the dir exist ?
$dir=$share."/".$value['fs'];
$cmd="mount ".$value['md']." ".$dir;
if (is_booting())
$cmd=$cmd." > /dev/null 2>&1";
if (!(is_dir($dir)))
{
exec("sudo /bin/mkdir -p ".$dir ,$result,$ret);
if ($ret!=0)
{
logError(__FILE__, __LINE__ , "Failed to create DIR", LOG_WARNING);
$error = 1;
$volerr = 1;
}
}
//Mounting
exec($cmd ,$result,$ret);
if ($ret!=0)
{
logError(__FILE__, __LINE__ , "Failed to mount ".$dir, LOG_WARNING);
$error = 1;
$volerr = 1;
}
if ($volerr == 0)
{
if (is_booting())
echo "\t\t\t\t\t\t\t [ OK ] \n";
}
else
{
if (is_booting())
echo "\t\t\t\t\t\t\t [ Fail ] \n";
}
}
}
if ($error == 1)
{
if (is_booting())
{
echo " * Finishing mount of volumes... \t\t\t [ Fail ] \n";
}
return FAIL_E;
}
else
{
if (is_booting())
{
echo " * Finishing mount of volumes... \t\t\t [ OK ] \n";
}
return OK_E;
}
}