Special Samba/CIFS Share

Status
Not open for further replies.

emcadmin

Dabbler
Joined
Jan 14, 2013
Messages
15
I'm trying to setup a cifs share on freenas. I'm unable to get it working. The configuration that I'm trying to apply is taken from one of the linux samba servers that already does this and works.

The working snippit is this (NOTE This is on the linux server with samba 3.5.11):
[global]
default service = defcdserv
[defcdserv]
path = /cdserv/mount/%S
writeable = no
browseable = no
public = yes
root preexec = /cdserv/mount-cdserv.sh %S %m "%T"
root postexec = /cdserv/umount-cdserv.sh %S %m "%T"

I added default service = defcdserv to the Auxiliary parameters in the CIFS service in the UI.
I added a share called defcdserv with path of /mnt/data2/cdserv/mount/%S
Export readonly and allow guest is checked.
I added the following to the Auxiliary parameters for this share:
locking = no
root preexec = /mnt/data2/cdserv/mount-cdserv.sh %S %m "%T"
root postexec = /mnt/data2/cdserv/umount-cdserv.sh %S %m "%T"

I checked /usr/local/etc/smb.conf and all the options that I expected to be there were there.
the mount-cdserv.sh script handles the actual mounting of ISO files in the location (which is in the script). It also logs information on what share, what machine, and when.
When a windows user accesses \\<freenasbox>\<isoname> the script is supposed to be called like this:
/mnt/data2/cdserv/mount-cdserv.sh <isoname> <client name> "<time/date>"
NOTE: Samba replaces _ with / when it executes the program.

For example, I have psp_7.0.iso in the iso location (real location is irrelevent). The user will access \\nas\psp_7.0
Samba will execute as root /mnt/data2/cdserv/mount-cdserv.sh psp/7.0 client "2013/04/17 15:12:45"
The script creates /mnt/data2/cdserv/mount/psp/7.0, sets up the next md device to the iso file and mounts it to this location and it will log this information to the log file:
MOUNT: psp_7.0 client 2013/04/17 15:12:45

What actually happens is the script is called as /mnt/data2/cdserv/mount-cdserv.sh defcdserv client "2013/04/17 15:12:45"
and will fail.

In a nutshell, %S isn't working correctly.

P.S. This is similar to how the homes share works, except it also runs a program.
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
Please do not cross post. You asked this question already.
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
Yeah, I've never seen anyone implement what you are trying to do. My guess is nobody had the answer.
 

emcadmin

Dabbler
Joined
Jan 14, 2013
Messages
15
It's possible that it's a bug in the samba server. It's should work. It does on my debian box. I've been using it for years and it's saved me from having to find the CD of <insert name here>.
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
It doesn't matter. You've asked this question twice and gotten no response. So you're not likely to get your problem solved here.
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
Have a link describing the issue or something? Its nice for future readers to see a thread discussing the problem and not just the answer...
 
Status
Not open for further replies.
Top