News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Maintenance Mode disabled after saving other settings

Started by Adrek, June 24, 2012, 01:20:50 PM

Previous topic - Next topic

Adrek

Today I ran to small problem.

I installed fresh SMF 2.0.2, added Polish language and new theme (modified Inferno by DS). After that I enabled Maintenance Mode and while later changed some options in Cookies and Sessions. I was surprised that someone (spammer :P) actually posted something on my site, because I thought that site is disabled. So I checked settings and another surprise - Maintenance Mode is not active


Then I made this tests:
Go to: Administration Center » Server Settings » General

Enable Maintenance Mode

Now go to: Administration Center » Server Settings » Database and Paths
Save settings (don't change anything)

Go to: Administration Center » Server Settings » General
Maintenance Mode is disabled.


Lets do it again:
Go to: Administration Center » Server Settings » General

Enable Maintenance Mode

Now go to: Administration Center » Server Settings » Cookies and Sessions
Save settings (don't change anything)

Go to: Administration Center » Server Settings » General
Maintenance Mode is disabled.

Wasn't sure if this is something for bugs board, so now it's here. If this is SMF bug please move this thread to proper board:)
Polskie wsparcie SMF na simplemachines.org

the simplest solution is most likely the right one

MrPhil

Just to be sure, after you Enable maintenance mode, have you checked to confirm that it is, in fact, enabled? In Settings.php, you should see $maintenance = 1; (or maybe 2), and only the Admin can get in on 1 (and not even that on 2). Are you seeing $maintenance set back to 0 without your explicitly doing that?

I suppose it's possible that SMF could be automatically clearing maintenance mode to 0 after certain settings-related operations, so that admins don't forget to clear it manually, but that would not be a logical thing to do. More likely there's a bug in the code that reports to you whether it's in maintenance mode or not, or that it's failing to put the forum into that mode.

Your Settings.php isn't read-only, is it? (444 permissions, or similar) That would prevent it from being put into maintenance mode in the first place.

Adrek

Quote from: MrPhil on June 24, 2012, 10:59:47 PM
Just to be sure, after you Enable maintenance mode, have you checked to confirm that it is, in fact, enabled? In Settings.php, you should see $maintenance = 1; (or maybe 2), and only the Admin can get in on 1 (and not even that on 2). Are you seeing $maintenance set back to 0 without your explicitly doing that?
Yes, it is enabled, in Settings.php I have $maintenance = 1;, and in theme is information about enabled maintenance mode


Quote from: MrPhil on June 24, 2012, 10:59:47 PM
Your Settings.php isn't read-only, is it? (444 permissions, or similar) That would prevent it from being put into maintenance mode in the first place.
Settings.php has CHMOD 644
Polskie wsparcie SMF na simplemachines.org

the simplest solution is most likely the right one

MrPhil

644 isn't necessarily writable by SMF (PHP), if PHP isn't running as "owner". If SMF was able to change $maintenance, then presumably 644 is OK (writable). Otherwise it might need to be 664 or even 666.

Adrek

yeah SMF changed setting in file, so file is writable
Polskie wsparcie SMF na simplemachines.org

the simplest solution is most likely the right one

ziycon

Can you set the default theme in place and see if this issue occurs still, if it still occurs can you tell us what mods you have installed please?

Advertisement: