SQlite issue with CIFS share

Support for the Debian/Ubuntu package, created by JCFP.
Forum rules
Help us help you:
  • Are you using the latest stable version of SABnzbd? Downloads page.
  • Tell us what system you run SABnzbd on.
  • Adhere to the forum rules.
  • Do you experience problems during downloading?
    Check your connection in Status and Interface settings window.
    Use Test Server in Config > Servers.
    We will probably ask you to do a test using only basic settings.
  • Do you experience problems during repair or unpacking?
    Enable +Debug logging in the Status and Interface settings window and share the relevant parts of the log here using [ code ] sections.
Post Reply
mkeybhoy
Newbie
Newbie
Posts: 11
Joined: November 8th, 2011, 9:18 am

SQlite issue with CIFS share

Post by mkeybhoy »

Hi all,

longtime sabnzbd user on windows, and have recently moved across to Ubuntu as running sabnzb 24x7 in a windows7 virtual machine was too much overhead. Everything went well installing, however I like to have my admin directory in the same folder structure as my downloads, so redirected it to my cifs share

\nzb
\nzb\complete
\nzb\incomplete
\nzb\admin
\nzb\logs

this worked fine except history1.db was always 0 bytes, and I was warned that database was locked. Sabnzbd worked fine, but I never had any history showing. I did some trawling and found a known issue with sqllite and CIFS shares. Unless the parameter nobrl is used when mounting the share, sqllite gets its knickers in a twist. So my

/etc/fstab finally looks like

/etc/fstab

Code: Select all

//192.168.1.xyz/nzb /home/myuser/winshare cifs defaults,rw,iocharset=utf8,codepage=cp850,uid=1000,gid=1000,noauto,user,username=myshareuser,password=mysharepassword,file_mode=0777,dir_mode=0777 0 0
I then mount my share in /etc/rc.local, then run sabnzbd for the first time (having stopped it autorunning at boot - see command below - due to it starting before my shares had mounted)

Code: Select all

$ sudo update-rc.d -f sabnzbdplus
/etc/rc.local

Code: Select all

mount.cifs //192.168.1.xyz/nzb /home/myuser/winshare -o noperm,forceuid,uid=myuser,user=myshareuser,pass=mysharepassword,nobrl

Code: Select all

/etc/init.d/sabnzbd start
I also did

Code: Select all

sudo chmod u+s /sbin/mount.cifs
as part of a process to get the share to mount at boot time as my user rather than root. Never did manage it (winshare is still owned by root after mounting) but sabnzbd working fine now. Hope this helps someone out.
User avatar
shypike
Administrator
Administrator
Posts: 19774
Joined: January 18th, 2008, 12:49 pm

Re: SQlite issue with CIFS share

Post by shypike »

Don't put the sqlite database on a share.
The SQLite library requires native file locking and shares may not support it sufficiently.
I advise to put the admin folder only on local storage.
Preferably also the "temporary download folder", since it will generate a lot of competing network traffic.
User avatar
jcfp
Release Testers
Release Testers
Posts: 1022
Joined: February 7th, 2008, 12:45 pm

Re: SQlite issue with CIFS share

Post by jcfp »

In addition to that, on the Linux sysadmin side, network shares can be mounted directly from /etc/fstab. That even includes the possibility of securely storing the necessary credentials in a separate file. Google knows how.
mkeybhoy
Newbie
Newbie
Posts: 11
Joined: November 8th, 2011, 9:18 am

Re: SQlite issue with CIFS share

Post by mkeybhoy »

Cheers for the info guys. Hear what you are saying about the admin folder. It's working OK at the moment, but I guess not optimally. I did read some recommendations about using a credentials file, but I was just happy to get it working today. That'll be one for another day.

My reason for having the incomple folder also on a share is that, from experience, it tends to grow quite large (currently about 11Gb) which I'd like to keep away from my minimalist ubuntu install (256Mb, 4Gb hard disk)
Post Reply