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.
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.