sambaの設定

sambaの設定には悩んだ。
いままで同様に/etc/samba/smb.confを編集
[global]に文字コードなどを追加

dos charset = CP932
unix charset = UTF8
display charset = UTF8
interfaces = eth0
security = user

共有設定の追加

[share]
comment = Windows Public
path = /home/windows
browseable = yes
read only = no
create mask = 0660
directory mask = 0770
valid users = @windows
force group = windows

ユーザの追加

# adduser xx
# pdbedit -a xx

testparm /etc/samba/smb.confでrlimit-max: rlimit_max (1024) below minimum Windows limit (16384)のエラーが表示されるので、オープンファイルの上限を拡張する。

# ulimit -n 16384

これでエラーはなくなるので、ほんとはinitスクリプトに追加すべきと思うが、
/etc/security/limits.confを編集して、root – nofile 16384を追加
これでよいはずであるが、マシンの再起動後に動いていない。
sambaのチェックリストで調べても、原因がわからない。
とにかくなぜか、nmbdが正しく動いていない。
しかし、sambaを再起動すると、正常に動いている。

# nmblookup -S `hostname`
querying xx on xx.xx.xx.xx
name_query failed to find name xx
# /etc/init.d/samba restart
# nmblookup -S `hostname`
querying xx on xx.xx.xx.xx
xx.xx.xx.xx xx<00>
Looking up status on xx.xx.xx.xx

結局sambaの起動時にnetworkの準備ができていないためと勝手に結論づけた。
とりあえず、initスクリプトのLSBタグを変更し、起動順を変更した。
/etc/init.d/sambaを編集して、# Required-Start:タグの最後に$allを追加

# update-rc.d samba defaults

最近はinsservを使うらしい。

コメント