Page Index Toggle Pages: [1] 2 
Topic Tools
Hot Topic (More than 10 Replies) Advanced Settings will not save some some Windows Machines (Read 4,345 times)
JonB
YaBB Administrator
YaBB Next Team
Operations Team
Beta Testers
Support Team
*****
Offline



Posts: 3,818
Location: Land of the Blazing Sun!

YaBB 2.6.0
Re: Advanced Settings will not save some some Windows Machines
Reply #17 - Oct 25th, 2012 at 6:09pm
Post Tools
@ The Boy -

Thanks for nothing noting that.  As you know that's a function of our flat-file system's penchant for 'many teeny' files LOL. Normally, Inode depletion is not a common problem (at least in my experience).

Ext3 or ext4 filesystem?  This has not been a problem I have needed to address. What has been your solution? A script with 'dump'? New drive and filesystem??? Reallocate inodes (I have heard this can be done - don't know)?

Thanks
Cool





« Last Edit: Oct 25th, 2012 at 10:07pm by JonB »  

I find your lack of faith disturbing.
Back to top
IP Logged
 
The Boy
Full Member
***
Offline



Posts: 339
Location: UK
Re: Advanced Settings will not save some some Windows Machines
Reply #16 - Oct 22nd, 2012 at 2:56pm
Post Tools
I problem I was constantly running into with my large YaBB on a Linux server, was not free space, but free inodes.


root@slcs-deb-1:~# df -k
Filesystem           1K-blocks      Used Available Use% Mounted on
2373864  40% /var/www/www.omegaowners.com/html
/dev/sdd1             16508572   root@slcs-deb-1:~# df -i
Filesystem            Inodes   IUsed   IFree IUse% Mounted on
/dev/sdc1             262144  259955    2189  100% /var/www/www.omegaowners.com/html


I know not many YaBBs as large as mine exist, and those that do need special care, but worth have an inode check at the same time?


//Edited to remove irrelavent filesystems from list
« Last Edit: Oct 22nd, 2012 at 2:57pm by The Boy »  
Back to top
WWW  
IP Logged
 
Dandello
YaBB Administrator
YaBB Next Team
Operations Team
Beta Testers
Support Team
*****
Offline



Posts: 2,264
Location: Earth

YaBB 2.6.0
Re: Advanced Settings will not save some some Windows Machines
Reply #15 - Sep 24th, 2012 at 12:26am
Post Tools
And I think this version works better (but needs testing on JonB's temperamental Win machine.)
  

Settings_Advanced.zip ( 4 KB | 87 Downloads )

If you only have one solution to a problem you're not trying hard enough!
Back to top
WWW  
IP Logged
 
Dandello
YaBB Administrator
YaBB Next Team
Operations Team
Beta Testers
Support Team
*****
Offline



Posts: 2,264
Location: Earth

YaBB 2.6.0
Re: Advanced Settings will not save some some Windows Machines
Reply #14 - Sep 23rd, 2012 at 10:57pm
Post Tools
Code
Select All
if ($^O ne 'MSWin32') {
	# Free Disk Space Checking for Linux/Unix OS
	my @disk_space = qx{df -k .};
	map { $_ =~ s/ +/  /g } @disk_space;
} 



Otherwise it stops the *nix quota check from working. (Another one of those spooky WTF things.)
« Last Edit: Sep 23rd, 2012 at 10:58pm by Dandello »  

If you only have one solution to a problem you're not trying hard enough!
Back to top
WWW  
IP Logged
 
Dandello
YaBB Administrator
YaBB Next Team
Operations Team
Beta Testers
Support Team
*****
Offline



Posts: 2,264
Location: Earth

YaBB 2.6.0
Re: Advanced Settings will not save some some Windows Machines
Reply #13 - Sep 23rd, 2012 at 10:27pm
Post Tools
I did get a version that actually checks space on Windows.  Wink

Edited:
Still working on getting to behave for both Win and *nix.
« Last Edit: Sep 23rd, 2012 at 10:53pm by Dandello »  

If you only have one solution to a problem you're not trying hard enough!
Back to top
WWW  
IP Logged
 
JonB
YaBB Administrator
YaBB Next Team
Operations Team
Beta Testers
Support Team
*****
Offline



Posts: 3,818
Location: Land of the Blazing Sun!

YaBB 2.6.0
Re: Advanced Settings will not save some some Windows Machines
Reply #12 - Sep 23rd, 2012 at 10:07pm
Post Tools
The patch you suggested works correctly at least for now, for 32 bit Windows XP and likely Vista & Win 7.

here is the properly indented fixed code - just tested.

Code (Perl)
Select All
if ($^O ne 'MSWin32') {
	# Free Disk Space Checking for Linux/Unix OS
	my @disk_space = qx{df -k .};
	map { $_ =~ s/ +/  /g } @disk_space;

	my @find = qx(find . -noleaf -type f -printf "%s-");

	$hostusername = $hostusername || (split(/ +/, qx{ls -l YaBB.$yyext}))[2];
	my @quota = qx{quota -u $hostusername -v};
	$quota[0] =~ s/^ +//;
	$quota[0] =~ s/ / /g;
	$quota[1] =~ s/^ +//;
	$quota[1] =~ s/ / /g;
	my $quota_select = qq~$quota[0]<br />$quota[1]~;
	if ($quota[2]) {
		my $ds = (split(/ +/, $disk_space[1], 2))[0] if !$enable_quota;
		$quota_select .= qq~<br /><select name="enable_quota_value">~;
			for (my $i = 2; $i < @quota; $i++) {
			$quota[$i] =~ s/^ +//;
			$quota[$i] =~ s/ +/&nbsp;&nbsp;/g;
			$quota_select .= qq~<option value="$i" ~ . ${isselected($i == $enable_quota || ($ds && $quota[$i] =~ /^$ds/))} . qq~>$quota[$i]</option>~;
		}
		$quota_select .= '</select>';
	}
}  



That code suppresses the diskchecking, and no command windows are launched + you are able to save settings now.

Let us leave it at that fix please.

Smiley
  

I find your lack of faith disturbing.
Back to top
IP Logged
 
Dandello
YaBB Administrator
YaBB Next Team
Operations Team
Beta Testers
Support Team
*****
Offline



Posts: 2,264
Location: Earth

YaBB 2.6.0
Re: Advanced Settings will not save some some Windows Machines
Reply #11 - Sep 23rd, 2012 at 9:18pm
Post Tools
In theory there's
Code
Select All
`fsutil volume diskfree 

that according to somebody at PerlMonks should do the trick (maybe). Then in Subs.pl there's
Code
Select All
			my @x = qx{DIR /-C}; # Do an ordinary DOS dir command and grab the output
			my $lastline = pop(@x); # should look like: 17 Directory(s), 21305790464 Bytes free
			return -1 if $lastline !~ m/byte/i; # error trapping if output fails. The word byte should be in the line
			$lastline =~ /^\s+(\d+)\s+(.+?)\s+(\d+)\s+(.+?)\n$/;
			$FreeBytes = $3 - 100000; # 100000 bytes reserve
 


which, in theory, is equivalent to
Code
Select All
my @x = qx{df -k .}; # Do an ordinary *nix df -k . command and grab the output
			my $lastline = pop(@x); # should look like: /dev/path 151694892 5495660 134063644 4% /
			return -1 if $lastline !~ m/\%/; # error trapping if output fails. The % sign should be in the line
			$FreeBytes = ((split(/ +/, $lastline, 5))[3] * 1024) - 100000; # 100000 bytes reserve
 



Haven't had time to play around with this.
Edited:
I keep saying 'in theory' since I can't actually confirm that the Window's freespace check works at all on my XP test machine.
« Last Edit: Sep 23rd, 2012 at 9:27pm by Dandello »  

If you only have one solution to a problem you're not trying hard enough!
Back to top
WWW  
IP Logged
 
JonB
YaBB Administrator
YaBB Next Team
Operations Team
Beta Testers
Support Team
*****
Offline



Posts: 3,818
Location: Land of the Blazing Sun!

YaBB 2.6.0
Re: Advanced Settings will not save some some Windows Machines
Reply #10 - Sep 23rd, 2012 at 7:18pm
Post Tools
I don't think there is a Windows OS command equivalent to 'df' - in part because Windows views the filesystem as something very different than *nix does. The present code would ONLY work on a Linux server that is set up correctly. Windows only supports quotas on certain versions of Windows and certain Filesystems (specifically NTFS) and often only with the use of a true Windows Domain.

Its probably only really relevant on hosted Linux systems, and a subset of those.

It's like the periodic debate I have to have over why Unix file permissions cannot be applied to virtual shares on non-Linux systems - the guest OS for the share (which is mounted as CIFS) just doesn't have that mechanism (ditto Samba integration).  The permissions are 'forced' in the mount statement, and are the *nix equivalent of RWE but there is no support for the concept of ownership, users or group in CIFS - thus the permissions are transient to that session.  I tell people who want to argue about it that they could probably get a nice job with VMware or Oracle if they could engineer that.   Cheesy

I had one guy tell me he has written a hack for that (with VirtualBox), but he didn't have time to post the solution. (I was not holding my breath  Roll Eyes )

For now; we know the nature of the issue, and how to fix it. I remain interested in its root cause, but I don't think it is worth spending more time on at this juncture.

Thanks for all the input - this is the kind of thing that goes with the Admin Center and Installer rethinking we need to do for Next Edition.  At that time, we should revisit the ideas of automated system checking and configuration/environment data gathering.

Wink




  

I find your lack of faith disturbing.
Back to top
IP Logged
 
Dandello
YaBB Administrator
YaBB Next Team
Operations Team
Beta Testers
Support Team
*****
Offline



Posts: 2,264
Location: Earth

YaBB 2.6.0
Re: Advanced Settings will not save some some Windows Machines
Reply #9 - Sep 23rd, 2012 at 4:30pm
Post Tools
In Subs there's some freespace checking to determine if low-space maintenance mode should be turned on - but it's not the same code as Settings_Advanced uses for pretty much the same function and it looks like it's checking drive C - which may not be correct for some systems (like mine, my server directory is on D).

The quick and dirty solution would be putting an OS checker in Settings_Advanced as that looks like how that section of code is supposed to act anyway - ignoring the *nix only command. And this should work as apparently commenting out two lines works to correct this problem when it does occur.

A proper solution is to figure out how to get that section of code to properly return the data it needs, even on a Windows machine.

The code I got from PerlMonks kinda works - but doesn't bring back the actual freespace on my Windows machine - so I'm missing something in translation.
  

If you only have one solution to a problem you're not trying hard enough!
Back to top
WWW  
IP Logged
 
JonB
YaBB Administrator
YaBB Next Team
Operations Team
Beta Testers
Support Team
*****
Offline



Posts: 3,818
Location: Land of the Blazing Sun!

YaBB 2.6.0
Re: Advanced Settings will not save some some Windows Machines
Reply #8 - Sep 23rd, 2012 at 2:28pm
Post Tools
I have been thinking about this.

I still think it has to do with fact there's an ext3 partition, but I can't see anywhere in Settings_Advanced.pl where the code itself would know how to make the decision to run the OS commands.

It clearly does make that decision on this one machine, as I can actually see the command windows opening + I can't save Advanced Settings. Yet on another XP machine, the code does not execute those command calls and everything is AOK.

Well, my thought is that YaBB.pl and AdminIndex.pl had to have run first, and the clue to the trigger is somewhere in that code.

Just my thoughts as usual.
Wink
  

I find your lack of faith disturbing.
Back to top
IP Logged
 
xnoddyx
Support Team
Documentation Team
YaBB Moderators
YaBB Next Team
Beta Testers
****
Offline



Posts: 1,587
Location: UK:Scotland/livingston

None
Re: Advanced Settings will not save some some Windows Machines
Reply #7 - Sep 22nd, 2012 at 6:29pm
Post Tools
Dandello wrote on Sep 22nd, 2012 at 4:33pm:
Just posted the problematic code section to PerlMonks - with any luck someone will take pity on me and actually respond - they like runnable code snippets and this one doesn't qualify in any way.

lol funny you should say that it was looking at File Locking here http://www.perlmonks.org/?node_id=7058 that had given me this thought xnoddyx wrote on Sep 21st, 2012 at 10:06pm:
ok i'm just grabbing at thin air here but can part of this be down to the (Use File-Locking) so yabb can see *nix and win NT so when Advanced Settings are loaded it's cool but when it has to save it's like ooooooo  *nix and win NT file system emmmmmm emmmm         and has a data dump and flushes all new settings and dont save them due to the Free Disk Space Checking settings on the same page ?
           

Grin
« Last Edit: Sep 22nd, 2012 at 6:29pm by xnoddyx »  

YaBB install help video
1. what yabb forum are you running and the url
2. describe in as much detail as you can what happens and also post screenshots if you can
3. please be patient we live in different time zones and have other commitments but we will help you
as bill and ted say (Be excellent to each other)
Back to top
IP Logged
 
Dandello
YaBB Administrator
YaBB Next Team
Operations Team
Beta Testers
Support Team
*****
Offline



Posts: 2,264
Location: Earth

YaBB 2.6.0
Re: Advanced Settings will not save some some Windows Machines
Reply #6 - Sep 22nd, 2012 at 4:33pm
Post Tools
Just posted the problematic code section to PerlMonks - with any luck someone will take pity on me and actually respond - they like runnable code snippets and this one doesn't qualify in any way.
  

If you only have one solution to a problem you're not trying hard enough!
Back to top
WWW  
IP Logged
 
Dandello
YaBB Administrator
YaBB Next Team
Operations Team
Beta Testers
Support Team
*****
Offline



Posts: 2,264
Location: Earth

YaBB 2.6.0
Re: Advanced Settings will not save some some Windows Machines
Reply #5 - Sep 21st, 2012 at 10:23pm
Post Tools
Well, the code the space checking is using uses some *nix specific stuff. (Looked it up  Roll Eyes) So I suspect some Windows systems could choke on it if there's some shell process that uses the same code for something else.

As I indicated, I can't duplicate it. And there's probably a better, more generic, way to write it as well.

However, in theory, putting the offending code inside a
Code
Select All
if ($^O ne 'MSWin32') {

} 


should take care of it.
« Last Edit: Sep 21st, 2012 at 10:27pm by Dandello »  

If you only have one solution to a problem you're not trying hard enough!
Back to top
WWW  
IP Logged
 
xnoddyx
Support Team
Documentation Team
YaBB Moderators
YaBB Next Team
Beta Testers
****
Offline



Posts: 1,587
Location: UK:Scotland/livingston

None
Re: Advanced Settings will not save some some Windows Machines
Reply #4 - Sep 21st, 2012 at 10:06pm
Post Tools
JonB wrote on Sep 21st, 2012 at 8:33pm:
THEN - it hit me and why it is so rare.  This machine dual boots as a Linux server. I'm guessing that if YaBB can see a *nix filesystem, its going to perform those Linux checks.  Since there isn't a 'mounted' Linux system, what is returned is likely 'garbage'. Fast forward to the Save routine for Advanced Settings:

ok i'm just grabbing at thin air here but can part of this be down to the (Use File-Locking) so yabb can see *nix and win NT
so when Advanced Settings are loaded it's cool but when it has to save it's like ooooooo Huh *nix and win NT file system emmmmmm emmmm  Cheesy Cheesy Cheesy Cheesy Cheesy Cheesy Cheesy and has a data dump and flushes all new settings and dont save them due to the Free Disk Space Checking settings on the same page ?
  

YaBB install help video
1. what yabb forum are you running and the url
2. describe in as much detail as you can what happens and also post screenshots if you can
3. please be patient we live in different time zones and have other commitments but we will help you
as bill and ted say (Be excellent to each other)
Back to top
IP Logged
 
Dandello
YaBB Administrator
YaBB Next Team
Operations Team
Beta Testers
Support Team
*****
Offline



Posts: 2,264
Location: Earth

YaBB 2.6.0
Re: Advanced Settings will not save some some Windows Machines
Reply #3 - Sep 21st, 2012 at 9:44pm
Post Tools
I've got grub but XP is my default OS.

How about a version of the fix with the 'bad' code clearly commented out - that way it can go into the codex and help files (Of course, that does assume that people actually read the help files.)  Roll Eyes

I have to look through the code and see if it would be safe to just run an OS check to disable that feature for Windows users.
  

If you only have one solution to a problem you're not trying hard enough!
Back to top
WWW  
IP Logged
 
Page Index Toggle Pages: [1] 2 
Topic Tools
 
  « Board Index ‹ Board  ^Top