Fix: Pb in package with install.lock
This commit is contained in:
parent
2caf09b1dc
commit
3ff83a3bb3
@ -49,10 +49,8 @@ echo Run the dolibarr postinst script
|
|||||||
|
|
||||||
# Define vars
|
# Define vars
|
||||||
docdir='/var/lib/dolibarr/documents'
|
docdir='/var/lib/dolibarr/documents'
|
||||||
#docdir='/usr/share/dolibarr/documents'
|
|
||||||
installfileorig="/usr/share/dolibarr/build/deb/install.forced.php.install"
|
installfileorig="/usr/share/dolibarr/build/deb/install.forced.php.install"
|
||||||
installconfig="/etc/dolibarr/install.forced.php"
|
installconfig="/etc/dolibarr/install.forced.php"
|
||||||
#config="/usr/share/dolibarr/htdocs/conf/conf.php"
|
|
||||||
config="/etc/dolibarr/conf.php"
|
config="/etc/dolibarr/conf.php"
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -54,10 +54,8 @@ echo Run the dolibarr postrm script
|
|||||||
|
|
||||||
|
|
||||||
docdir='/var/lib/dolibarr/documents'
|
docdir='/var/lib/dolibarr/documents'
|
||||||
#docdir='/usr/share/dolibarr/documents'
|
|
||||||
#config="/usr/share/dolibarr/htdocs/conf/conf.php"
|
|
||||||
config="/etc/dolibarr/conf.php"
|
config="/etc/dolibarr/conf.php"
|
||||||
lockfile="/usr/share/dolibarr/install.lock"
|
lockfile="$docdir/install.lock"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -154,8 +154,6 @@ export apachefileorig="$targetdir/build/rpm/httpd-dolibarr.conf"
|
|||||||
export apacheconfig="%{_sysconfdir}/dolibarr/apache.conf"
|
export apacheconfig="%{_sysconfdir}/dolibarr/apache.conf"
|
||||||
#export config="/usr/share/dolibarr/htdocs/conf/conf.php"
|
#export config="/usr/share/dolibarr/htdocs/conf/conf.php"
|
||||||
export config="%{_sysconfdir}/dolibarr/conf.php"
|
export config="%{_sysconfdir}/dolibarr/conf.php"
|
||||||
export lockfile="/usr/share/dolibarr/install.lock"
|
|
||||||
|
|
||||||
|
|
||||||
# Detect OS
|
# Detect OS
|
||||||
os='unknown';
|
os='unknown';
|
||||||
@ -223,11 +221,9 @@ if [ "x$os" = "xfedora-redhat" -a -s /sbin/restorecon ]; then
|
|||||||
# semanage add records into /etc/selinux/targeted/contexts/files/file_contexts.local
|
# semanage add records into /etc/selinux/targeted/contexts/files/file_contexts.local
|
||||||
semanage fcontext -a -t httpd_sys_script_rw_t "/etc/dolibarr(/.*?)"
|
semanage fcontext -a -t httpd_sys_script_rw_t "/etc/dolibarr(/.*?)"
|
||||||
#semanage fcontext -a -t httpd_sys_script_rw_t "/usr/share/dolibarr(/.*?)"
|
#semanage fcontext -a -t httpd_sys_script_rw_t "/usr/share/dolibarr(/.*?)"
|
||||||
semanage fcontext -a -t httpd_sys_script_rw_t "/usr/share/dolibarr/install.lock"
|
|
||||||
semanage fcontext -a -t httpd_sys_script_rw_t "/var/lib/dolibarr(/.*?)"
|
semanage fcontext -a -t httpd_sys_script_rw_t "/var/lib/dolibarr(/.*?)"
|
||||||
restorecon -R -v /etc/dolibarr
|
restorecon -R -v /etc/dolibarr
|
||||||
#restorecon -R -v /usr/share/dolibarr
|
#restorecon -R -v /usr/share/dolibarr
|
||||||
restorecon -v /usr/share/dolibarr/install.lock
|
|
||||||
restorecon -R -v /var/lib/dolibarr
|
restorecon -R -v /var/lib/dolibarr
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -288,7 +284,6 @@ export apachefileorig="$targetdir/build/rpm/httpd-dolibarr.conf"
|
|||||||
export apacheconfig="%{_sysconfdir}/dolibarr/apache.conf"
|
export apacheconfig="%{_sysconfdir}/dolibarr/apache.conf"
|
||||||
#export config="/usr/share/dolibarr/htdocs/conf/conf.php"
|
#export config="/usr/share/dolibarr/htdocs/conf/conf.php"
|
||||||
export config="%{_sysconfdir}/dolibarr/conf.php"
|
export config="%{_sysconfdir}/dolibarr/conf.php"
|
||||||
export lockfile="$targetdir/install.lock"
|
|
||||||
|
|
||||||
|
|
||||||
# Detect OS
|
# Detect OS
|
||||||
@ -345,8 +340,8 @@ echo Removed remaining $config
|
|||||||
%{__rm} -f $config
|
%{__rm} -f $config
|
||||||
echo Removed remaining $installconfig
|
echo Removed remaining $installconfig
|
||||||
%{__rm} -f $installconfig
|
%{__rm} -f $installconfig
|
||||||
echo Removed remaining $lockfile
|
echo Removed remaining $docdir/install.lock
|
||||||
%{__rm} -f $lockfile
|
%{__rm} -f $docdir/install.lock
|
||||||
|
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
|||||||
@ -27,7 +27,7 @@
|
|||||||
* \file htdocs/filefunc.inc.php
|
* \file htdocs/filefunc.inc.php
|
||||||
* \ingroup core
|
* \ingroup core
|
||||||
* \brief File that include conf.php file and functions.lib.php
|
* \brief File that include conf.php file and functions.lib.php
|
||||||
* \version $Id: filefunc.inc.php,v 1.21 2011/07/31 23:19:04 eldy Exp $
|
* \version $Id: filefunc.inc.php,v 1.22 2011/08/04 12:07:29 eldy Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
define('DOL_VERSION','3.1.0-beta'); // Also defined in htdocs/install/inc.php (Ex: x.y.z-alpha, x.y.z)
|
define('DOL_VERSION','3.1.0-beta'); // Also defined in htdocs/install/inc.php (Ex: x.y.z-alpha, x.y.z)
|
||||||
@ -60,6 +60,7 @@ error_reporting(E_ALL ^ E_NOTICE);
|
|||||||
//error_reporting(E_ALL);
|
//error_reporting(E_ALL);
|
||||||
|
|
||||||
|
|
||||||
|
# Define vars
|
||||||
$conffiletoshowshort = "conf.php";
|
$conffiletoshowshort = "conf.php";
|
||||||
# Define localization of conf file
|
# Define localization of conf file
|
||||||
$conffile = "conf/conf.php";
|
$conffile = "conf/conf.php";
|
||||||
|
|||||||
@ -20,7 +20,7 @@
|
|||||||
/**
|
/**
|
||||||
* \file htdocs/index.php
|
* \file htdocs/index.php
|
||||||
* \brief Dolibarr home page
|
* \brief Dolibarr home page
|
||||||
* \version $Id: index.php,v 1.200 2011/07/31 23:19:05 eldy Exp $
|
* \version $Id: index.php,v 1.201 2011/08/04 12:07:30 eldy Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
define('NOCSRFCHECK',1); // This is login page. We must be able to go on it from another web site.
|
define('NOCSRFCHECK',1); // This is login page. We must be able to go on it from another web site.
|
||||||
@ -545,8 +545,9 @@ if ($user->admin && empty($conf->global->MAIN_REMOVE_INSTALL_WARNING))
|
|||||||
{
|
{
|
||||||
$message='';
|
$message='';
|
||||||
|
|
||||||
// Install lock missing
|
// Check if install lock file is present
|
||||||
if (! file_exists('../install.lock') && is_dir(DOL_DOCUMENT_ROOT."/install"))
|
$lockfile=DOL_DATA_ROOT.'/install.lock';
|
||||||
|
if (! empty($lockfile) && ! file_exists($lockfile) && is_dir(DOL_DOCUMENT_ROOT."/install"))
|
||||||
{
|
{
|
||||||
$langs->load("other");
|
$langs->load("other");
|
||||||
//if (! empty($message)) $message.='<br>';
|
//if (! empty($message)) $message.='<br>';
|
||||||
@ -573,7 +574,7 @@ if ($user->admin && empty($conf->global->MAIN_REMOVE_INSTALL_WARNING))
|
|||||||
|
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|
||||||
llxFooter('$Date: 2011/07/31 23:19:05 $ - $Revision: 1.200 $');
|
llxFooter('$Date: 2011/08/04 12:07:30 $ - $Revision: 1.201 $');
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -23,7 +23,7 @@
|
|||||||
* \file htdocs/install/etape5.php
|
* \file htdocs/install/etape5.php
|
||||||
* \ingroup install
|
* \ingroup install
|
||||||
* \brief Last page of upgrade or install process
|
* \brief Last page of upgrade or install process
|
||||||
* \version $Id: etape5.php,v 1.107 2011/07/31 23:26:19 eldy Exp $
|
* \version $Id: etape5.php,v 1.108 2011/08/04 12:07:30 eldy Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
include_once("./inc.php");
|
include_once("./inc.php");
|
||||||
@ -314,6 +314,7 @@ if ($action == "set")
|
|||||||
if (! empty($force_install_lockinstall))
|
if (! empty($force_install_lockinstall))
|
||||||
{
|
{
|
||||||
// Install is finished, we create the lock file
|
// Install is finished, we create the lock file
|
||||||
|
$lockfile=DOL_DATA_ROOT.'/install.lock';
|
||||||
$fp = @fopen($lockfile, "w");
|
$fp = @fopen($lockfile, "w");
|
||||||
if ($fp)
|
if ($fp)
|
||||||
{
|
{
|
||||||
@ -363,6 +364,7 @@ elseif (preg_match('/upgrade/i',$action))
|
|||||||
if (! empty($force_install_lockinstall))
|
if (! empty($force_install_lockinstall))
|
||||||
{
|
{
|
||||||
// Upgrade is finished, we create the lock file
|
// Upgrade is finished, we create the lock file
|
||||||
|
$lockfile=DOL_DATA_ROOT.'/install.lock';
|
||||||
$fp = @fopen($lockfile, "w");
|
$fp = @fopen($lockfile, "w");
|
||||||
if ($fp)
|
if ($fp)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -21,7 +21,7 @@
|
|||||||
/** \file htdocs/install/inc.php
|
/** \file htdocs/install/inc.php
|
||||||
* \ingroup core
|
* \ingroup core
|
||||||
* \brief File that define environment for install pages
|
* \brief File that define environment for install pages
|
||||||
* \version $Id: inc.php,v 1.137 2011/07/31 23:26:18 eldy Exp $
|
* \version $Id: inc.php,v 1.138 2011/08/04 12:07:30 eldy Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
define('DOL_VERSION','3.1.0-beta'); // Also defined in htdocs/master.inc.php (Ex: x.y.z-alpha, x.y.z)
|
define('DOL_VERSION','3.1.0-beta'); // Also defined in htdocs/master.inc.php (Ex: x.y.z-alpha, x.y.z)
|
||||||
@ -70,16 +70,15 @@ else
|
|||||||
$includeconferror='';
|
$includeconferror='';
|
||||||
|
|
||||||
|
|
||||||
|
# Define vars
|
||||||
$conffiletoshowshort = "conf.php";
|
$conffiletoshowshort = "conf.php";
|
||||||
# Define localization of conf file
|
# Define localization of conf file
|
||||||
$conffile = "../conf/conf.php";
|
$conffile = "../conf/conf.php";
|
||||||
$conffiletoshow = "htdocs/conf/conf.php";
|
$conffiletoshow = "htdocs/conf/conf.php";
|
||||||
$lockfile = '../../install.lock';
|
|
||||||
# For debian/redhat like systems
|
# For debian/redhat like systems
|
||||||
#$conffile = "/etc/dolibarr/conf.php";
|
#$conffile = "/etc/dolibarr/conf.php";
|
||||||
#$conffiletoshow = "/etc/dolibarr/conf.php";
|
#$conffiletoshow = "/etc/dolibarr/conf.php";
|
||||||
#$lockfile = '/etc/dolibarr/install.lock'; # Web has no permission to write here
|
|
||||||
$lockfile = '../../install.lock';
|
|
||||||
|
|
||||||
if (! defined('DONOTLOADCONF') && file_exists($conffile))
|
if (! defined('DONOTLOADCONF') && file_exists($conffile))
|
||||||
{
|
{
|
||||||
@ -128,7 +127,6 @@ if (! defined('DONOTLOADCONF') && file_exists($conffile))
|
|||||||
}
|
}
|
||||||
$conf->global->MAIN_LOGTOHTML=1;
|
$conf->global->MAIN_LOGTOHTML=1;
|
||||||
|
|
||||||
|
|
||||||
// Define prefix
|
// Define prefix
|
||||||
if (! isset($dolibarr_main_db_prefix) || ! $dolibarr_main_db_prefix) $dolibarr_main_db_prefix='llx_';
|
if (! isset($dolibarr_main_db_prefix) || ! $dolibarr_main_db_prefix) $dolibarr_main_db_prefix='llx_';
|
||||||
define('MAIN_DB_PREFIX',(isset($dolibarr_main_db_prefix)?$dolibarr_main_db_prefix:''));
|
define('MAIN_DB_PREFIX',(isset($dolibarr_main_db_prefix)?$dolibarr_main_db_prefix:''));
|
||||||
@ -179,6 +177,7 @@ if (preg_match('/install.lock/i',$_SERVER["SCRIPT_FILENAME"]))
|
|||||||
}
|
}
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
$lockfile=DOL_DATA_ROOT.'/install.lock';
|
||||||
if (file_exists($lockfile))
|
if (file_exists($lockfile))
|
||||||
{
|
{
|
||||||
print 'Install pages have been disabled for security reason (by lock file install.lock into dolibarr root directory).<br>';
|
print 'Install pages have been disabled for security reason (by lock file install.lock into dolibarr root directory).<br>';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user