Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 662570

Summary: net-fs/samba add conf.d lockdir variable
Product: Gentoo Linux Reporter: Forza <forza>
Component: Current packagesAssignee: Gentoo's SAMBA Team <samba>
Status: UNCONFIRMED ---    
Severity: enhancement CC: forza
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Forza 2018-08-01 08:20:31 UTC
I think it would be beneficial to have a variable for lockdir in conf.d. 

init.d/samba should check for the lockdir location and create it if missing.

### /etc/init.d/samba
start() {
    ${my_service_PRE}
    [ -d "${piddir}" ] || mkdir -p "${piddir}"
    [ -d "${lockdir}" ] || mkdir -p "${lockdir}"

### /etc/conf.d/samba
daemon_list="smbd nmbd"
piddir="/run/samba"
lockdir="/tmp/samba"
Comment 1 Forza 2018-08-01 08:23:46 UTC
Forgot to mention the accompanying smb.conf line:

### /etc/samba/smb.conf
lock directory = /tmp/samba/locks
Comment 2 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2018-08-01 08:25:33 UTC
And what if a user chagnes the dir in /etc/samba/smb.conf but not in conf.d?
Comment 3 Forza 2018-08-01 08:32:52 UTC
I suppose it is the same issue as if you write some other error in the config file? For example if you put wrong path to the pidfile in conf.d.

Otherwise, maybe a more complicated way is to check for the "lock files" line, if exists in smb.conf.