CLOSED: mnt/samba/newsgroups/incomplete issues

modem7
Posts: 215
Joined: Tue Mar 20, 2012 6:00 pm

CLOSED: mnt/samba/newsgroups/incomplete issues

Postby modem7 » Wed Nov 14, 2018 6:04 pm

Heya guys,

Thought I'd create a new thread that kinda continues on from viewtopic.php?f=4&t=7199.

I'm trying to delete the contents of /mnt/samba/newsgroups/incomplete/ but it's giving me access denied.

I've tried chmod -R 775 /mnt/samba/newsgroups/incomplete/ and it gives me:

Code: Select all

mode of '/mnt/samba/newsgroups/incomplete/file' changed from 0770 (rwxrwx---) to 0775 (rwxrwxr-x)
But no changes have actually been made.


The original directory is /var/hda/files/drives/bay1/newsgroups/ with the following:

Code: Select all

drwxrwxrwx 273 apache users 32768 Nov 15 00:31 incomplete
/mnt/samba/newsgroups/incomplete/ is:

Code: Select all

drwxrwx--- 2 alex users 0 Nov 15 00:31 incomplete
I've tried chmod and chown with no effect. I'm probably being an idiot again, but would be good to see where I'm being an idiot.

Basically: Sab isn't deleting these files, so over time the size creeps up. I have a script that deletes things, but it obviously doesn't register with greyhole leaving quite a few orphans.


The script I used to run before I noticed the orphan issue was:

Code: Select all

plink.exe -v -l user -batch -load Amahi -ssh "sudo chown -R alex:users /mnt/samba/newsgroups/incomplete; rm -rf /mnt/samba/newsgroups/incomplete/*; sudo chown -R apache:users /mnt/samba/newsgroups/incomplete"
Thanks!

madhatta
Posts: 28
Joined: Tue Oct 09, 2018 8:56 pm

Re: mnt/samba/newsgroups/incomplete issues

Postby madhatta » Thu Nov 15, 2018 11:43 am

It looks like the locally mounted shares were created with 770 as you were concerned about in your last post but that shouldn't matter as apache and alex are both part of the users group. Did you see if you had a sabnzbd user and verify that it is also in the users group? If not that may be why it is not able to delete the files automatically.

As far as the ownership and permissions, I **think** that should be changed in smb.conf which is generated based on the hda_production database that you control through the hda dashboard. Check on your dashboard what the permissions are supposed to be for that share and change it if you can. If you modify the smb.conf manually it will be overwritten whenever the hda-ctl (I think it is called) service is restarted (manual, hda restart, etc.). But ... I am not sure changing ownership from apache to alex, deleting and then back to apache is necessary. I don't think you can change those locally mount shares through chown and if both accounts are in the users group, 770 permissions should suffice, I would think. My actual file folders and my samba shares are owned by my 1stadminuser (amahi) though so I can't verify. I just know I have had problems changing the local samba share permissions through command line.

If you have problems changing anything in the hda_production database I made a post here that details how to get into that table and make changes but as noted by bigfoot, it's not recommended by the Amahi team. I would try changing that line in the locally mounted shares service to 775 from 770 first (dir_mode=0770 to 0775 or hell even 777 as a test). It's a worth a shot before you go mucking with your database.

viewtopic.php?f=4&t=6965&start=10#p40663

Edit: Out of curiosity, are using alex:users to try and delete the files manually (doing it outside the script)? What happens when you try to modify the contents in that share with a remote system actually connected using SMB (presumably then using account alex) over the network and not trying to access/modify the files through the locally mounted samba share in command line?

What happens if you try to delete the files in the share, from command line, when elevated to root/sudo?

Also what credentials/group are using to instantiate the locally_mounted_shares called from .smb_credentials?

modem7
Posts: 215
Joined: Tue Mar 20, 2012 6:00 pm

Re: mnt/samba/newsgroups/incomplete issues

Postby modem7 » Fri Nov 16, 2018 2:58 pm

[newsgroups]
comment = newsgroups
path = /var/hda/files/drives/bay1/newsgroups
writeable = yes
browseable = yes
create mask = 0775
force create mode = 0664
directory mask = 0775
force directory mode = 0775

dfree command = /usr/bin/greyhole-dfree
vfs objects = greyhole
/var/hda/files/drives/bay1/newsgroups/incomplete
If I try to delete via windows mount (using alex:users), it gives permission denied.
If I try to delete via SSH via 'alex', it gives permission denied.
If I try to delete via SSH via sudo on alex, it allows, but greyhole doesn't react (understandably).

/mnt/samba/newsgroups/incomplete
If I try to delete via windows mount (using alex:users), it gives permission denied.
If I try to delete via SSH via 'alex', it gives permission denied.
If I try to delete via SSH via sudo on alex, it gives permission denied.

WinSCP also reports not even being able to open the folders within /incomplete as well (using alex:users).
[alex@localhost ~]$ ls -la /var/hda/files/drives/bay1/newsgroups/
total 40
drwxrwxrwx 3 alex users 4096 Nov 2 22:21 .
drwxr-xr-x 25 root root 4096 Aug 17 21:30 ..
drwxrwxrwx 271 apache users 32768 Nov 16 21:49 incomplete
[alex@localhost ~]$ ls -la /mnt/samba/newsgroups/
total 0
drwxrwx--- 2 alex users 0 Nov 2 22:21 .
drwxrwxr-x 11 alex users 146 Nov 15 18:15 ..
drwxrwx--- 2 alex users 0 Nov 16 21:49 incomplete

modem7
Posts: 215
Joined: Tue Mar 20, 2012 6:00 pm

Re: mnt/samba/newsgroups/incomplete issues

Postby modem7 » Thu Nov 22, 2018 6:32 pm

OK, interesting:

So, if I do the test with let's say /mnt/samba/tv, it works absolutely fine, I can delete as expected.

However, newsgroups/incomplete is normally owned by apache. If I change ownership, restart the local mount shares service, I get further, but when trying to delete anything in /mnt/samba/newsgroups/incomplete, I get a "directory not empty" error instead.

If I keep that directory as owned by "alex" instead of "apache", sabnzbd errors out and is unable to create/modify/delete anything within that folder.

I'm truly stumped. That folder is currently sitting at around 20gb or so of incomplete files.




Failing this, is there a way of just mounting the incomplete folder, so that I can delete it in a way that samba/greyhole can see the deletions? That's really all I need the mount script for in this case.

User avatar
bigfoot65
Project Manager
Posts: 11924
Joined: Mon May 25, 2009 4:31 pm

Re: mnt/samba/newsgroups/incomplete issues

Postby bigfoot65 » Thu Nov 22, 2018 7:21 pm

Odd. No clue why this issue occurs.

I will state that Greyhole is not recommended for use with apps like Sabnzbd. Anything that downloads directly to a Greyhole share can cause issues. See what not to put in Greyhole shares.

That may be part of your issue.
ßîgƒσστ65
Applications Manager

My HDA: Intel(R) Core(TM) i5-3570K CPU @ 3.40GHz on MSI board, 16GB RAM, 1TBx1+2TBx2+4TBx2

modem7
Posts: 215
Joined: Tue Mar 20, 2012 6:00 pm

Re: mnt/samba/newsgroups/incomplete issues

Postby modem7 » Sat Nov 24, 2018 7:23 pm

Managed to solve by removing the directory from greyhole, then manually deleting anything that was stuck/coming back from the relevant drives in the pool

User avatar
bigfoot65
Project Manager
Posts: 11924
Joined: Mon May 25, 2009 4:31 pm

Re: mnt/samba/newsgroups/incomplete issues

Postby bigfoot65 » Sat Nov 24, 2018 7:56 pm

Ok. Sounds like this is solved so will mark closed.
ßîgƒσστ65
Applications Manager

My HDA: Intel(R) Core(TM) i5-3570K CPU @ 3.40GHz on MSI board, 16GB RAM, 1TBx1+2TBx2+4TBx2

Who is online

Users browsing this forum: No registered users and 7 guests