SDS Posted May 5, 2006 Share Posted May 5, 2006 we are having avatar issues and one of my "fixes" is to run a cron job that repairs file permissions every 5 minutes. Well, my crontab file was altered in March and it sure as hell wasn't altered by me. My entries look funky now at the beginning of the line: */5 * * * * root chmod 0666 /<path>/av* I don't recall having the */ in there. What does that do? Link to comment Share on other sites More sharing options...
Dan Gross Posted May 5, 2006 Share Posted May 5, 2006 we are having avatar issues and one of my "fixes" is to run a cron job that repairs file permissions every 5 minutes. Well, my crontab file was altered in March and it sure as hell wasn't altered by me. My entries look funky now at the beginning of the line: */5 * * * * root chmod 0666 /<path>/av* I don't recall having the */ in there. What does that do? 684227[/snapback] The "/" is a skip (think of the skip more in terms of "division", in a sense). So you have "*" (every minute) / (skip) 5 (minutes between). It's a different (probably more concise) way of saying "every five minutes." Link to comment Share on other sites More sharing options...
SDS Posted May 5, 2006 Author Share Posted May 5, 2006 The "/" is a skip (think of the skip more in terms of "division", in a sense). So you have "*" (every minute) / (skip) 5 (minutes between). It's a different (probably more concise) way of saying "every five minutes." 684315[/snapback] well, I certainly didn't write it like that - and that is my entry. Plus, it doesn't seem to be working now... Link to comment Share on other sites More sharing options...
taterhill Posted May 5, 2006 Share Posted May 5, 2006 hit it with a hammer..works for me Link to comment Share on other sites More sharing options...
smokinandjokin Posted May 5, 2006 Share Posted May 5, 2006 hit it with a hammer..works for me 684552[/snapback] Or, did you try turning it off and then turning it back on? Or blowing on it, like old school Nintendo? Link to comment Share on other sites More sharing options...
Dan Gross Posted May 5, 2006 Share Posted May 5, 2006 well, I certainly didn't write it like that - and that is my entry. Plus, it doesn't seem to be working now... 684533[/snapback] That particular notation was actually new to me...don't know if some well-meaning admin made a change not knowing you were running an older version of cron...seems weird though... Any chance you can fix the source problem? I know it's best not to go digging in board source code, but it seems like a simple fix, once you locate where the writing goes on. I'm guessing this is only a problem for someone who updates their avatar (instead of create from scratch)? Link to comment Share on other sites More sharing options...
SDS Posted May 5, 2006 Author Share Posted May 5, 2006 That particular notation was actually new to me...don't know if some well-meaning admin made a change not knowing you were running an older version of cron...seems weird though... Any chance you can fix the source problem? I know it's best not to go digging in board source code, but it seems like a simple fix, once you locate where the writing goes on. I'm guessing this is only a problem for someone who updates their avatar (instead of create from scratch)? 684567[/snapback] the situation is aggravating. I have addressed the issue in the source code where I specifically have it issue the proper chmod command on the uploaded image, yet for a certain percentage of users - it doesn't work. My image server app - thttpd - doesn't like image files 777, it wants them 666. Apache doesn't care, so it normally isn't an issue. So, as a backup, I have the chmod command running every 5 minutes in the background, but for some reason it is no longer changing the permissions. Link to comment Share on other sites More sharing options...
Dan Gross Posted May 5, 2006 Share Posted May 5, 2006 the situation is aggravating. I have addressed the issue in the source code where I specifically have it issue the proper chmod command on the uploaded image, yet for a certain percentage of users - it doesn't work. My image server app - thttpd - doesn't like image files 777, it wants them 666. Apache doesn't care, so it normally isn't an issue. So, as a backup, I have the chmod command running every 5 minutes in the background, but for some reason it is no longer changing the permissions. 684571[/snapback] So you're saying the problem arises because the app is writing them out with the "wrong" permissions (execute on), and you have to manually change the permissions for the image server to serve them up? Harumph. And it doesn't work all the time in the source code, with no apparent pattern to when it does/doesn't fail....? Any chance that it never worked and it's actually just keeping the permissions of files that are being overwritten, the net effect being that generally "new" avatars would "not work" (permission 777) and "replacement" avatars (already at 666) would "work?" Link to comment Share on other sites More sharing options...
SDS Posted May 5, 2006 Author Share Posted May 5, 2006 So you're saying the problem arises because the app is writing them out with the "wrong" permissions (execute on), and you have to manually change the permissions for the image server to serve them up? Harumph. And it doesn't work all the time in the source code, with no apparent pattern to when it does/doesn't fail....? Any chance that it never worked and it's actually just keeping the permissions of files that are being overwritten, the net effect being that generally "new" avatars would "not work" (permission 777) and "replacement" avatars (already at 666) would "work?" 684615[/snapback] yes to your 1st statement. no to the second. Since I manually change them every 5 minutes to 666, they all are correct at some point. Various people still have problems. The code is here: //------------------------------------------------- // Copy the upload to the uploads directory //------------------------------------------------- $this->saved_upload_name = $this->out_file_dir.'/'.$this->parsed_file_name; if ( ! @move_uploaded_file( $_FILES[ $this->upload_form_field ]['tmp_name'], $this->saved_upload_name) ) { $this->error_no = 4; return; } else { @chmod( $this->saved_upload_name, 0666 ); } BTW, it stopped working because there are too many files in the dir. Support wrote a script for me to get around this, so my "fix" is back working again. Link to comment Share on other sites More sharing options...
stuckincincy Posted May 5, 2006 Share Posted May 5, 2006 well, I certainly didn't write it like that - and that is my entry. Plus, it doesn't seem to be working now... 684533[/snapback] SDS, I change avatars with some frequency. The tried 'n true clearing of cache after wiping out the old one, and the iffy acceptance of a .gif file and the more or less ready acceptance of a .jpg seems to be normal to me. I know this adds nothing, but for me, there hasn't been an avatar problem. Link to comment Share on other sites More sharing options...
ajzepp Posted May 5, 2006 Share Posted May 5, 2006 That particular notation was actually new to me...don't know if some well-meaning admin made a change not knowing you were running an older version of cron...seems weird though... 684567[/snapback] Hmmmmm....kind of ironic that one mr. Fezmid happens to be out of town right now, sailing across the pacific......hmmmmmm.......... Link to comment Share on other sites More sharing options...
Recommended Posts