必要に迫られて、netatalk2.1.5が動いているファイルサーバーにsamba3.5.6をいれました。
# tar zxvf ./samba-3.5.6.tar.gz
# cd ./samba-3.5.6/source3
# ./autogen.sh
./autogen.sh: need autoconf 2.53 or later to build samba from GIT
あらま。
なにか入っていないといわれるので、、
# apt-get install autoconf
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
linux-headers-2.6.32-24-server linux-headers-2.6.32-24 linux-headers-2.6.32-26
linux-headers-2.6.32-26-server
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
automake autotools-dev m4
Suggested packages:
autoconf2.13 autoconf-archive gnu-standards autoconf-doc libtool gettext
The following NEW packages will be installed:
autoconf automake autotools-dev m4
0 upgraded, 4 newly installed, 0 to remove and 29 not upgraded.
Need to get 1,730kB of archives.
After this operation, 5,005kB of additional disk space will be used.
Do you want to continue [Y/n]? y
Fetched 1,730kB in 1s (878kB/s)
Selecting previously deselected package m4.
(Reading database ... 97865 files and directories currently installed.)
Unpacking m4 (from .../archives/m4_1.4.13-3_amd64.deb) ...
Selecting previously deselected package autoconf.
Unpacking autoconf (from .../autoconf_2.65-3ubuntu1_all.deb) ...
Selecting previously deselected package autotools-dev.
Unpacking autotools-dev (from .../autotools-dev_20090611.1_all.deb) ...
Selecting previously deselected package automake.
Unpacking automake (from .../automake_1%3a1.11.1-1_all.deb) ...
Processing triggers for install-info ...
Processing triggers for man-db ...
Setting up m4 (1.4.13-3) ...
Setting up autoconf (2.65-3ubuntu1) ...
Setting up autotools-dev (20090611.1) ...
Setting up automake (1:1.11.1-1) ...
update-alternatives: using /usr/bin/automake-1.11 to provide /usr/bin/automake (automake) in auto mode.
# ./autogen.sh
# ./configure
# make
# make install
# /usr/local/samba/bin/smbstatus
/usr/local/samba/bin/smbstatus: error while loading shared libraries: libwbclient.so.0: cannot open shared object file: No such file or directory
おっと。またもや。
ということで、、、
# apt-get install libwbclient0
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
linux-headers-2.6.32-24-server linux-headers-2.6.32-24 linux-headers-2.6.32-26
linux-headers-2.6.32-26-server
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
libtalloc2
The following NEW packages will be installed:
libtalloc2 libwbclient0
0 upgraded, 2 newly installed, 0 to remove and 29 not upgraded.
Need to get 129kB of archives.
After this operation, 287kB of additional disk space will be used.
Do you want to continue [Y/n]? y
Fetched 129kB in 0s (181kB/s)
Selecting previously deselected package libtalloc2.
(Reading database ... 98154 files and directories currently installed.)
Unpacking libtalloc2 (from .../libtalloc2_2.0.1-1_amd64.deb) ...
Selecting previously deselected package libwbclient0.
Unpacking libwbclient0 (from .../libwbclient0_2%3a3.4.7~dfsg-1ubuntu3.2_amd64.deb) ...
Setting up libtalloc2 (2.0.1-1) ...
Setting up libwbclient0 (2:3.4.7~dfsg-1ubuntu3.2) ...
Processing triggers for libc-bin ...
ldconfig deferred processing now taking place
ここで再度。
# /usr/local/samba/bin/smbstatus
params.c:OpenConfFile() - Unable to open configuration file "/usr/local/samba/lib/smb.conf":
No such file or directory
Can't load /usr/local/samba/lib/smb.conf - run testparm to debug it
はい、はい。なーんにもないわけですね。
# vi /usr/local/samba/lib/smb.conf
smb.confには
--
[global]
dos charset = CP932
display charset = UTF-8
netbios name = FS-CIFS
server string = %h Samba Server
map to guest = Bad User
obey pam restrictions = Yes
pam password change = Yes
passwd program = /usr/bin/passwd %u
passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
unix password sync = Yes
syslog = 0
log file = /var/log/samba/log.%m
max log size = 1000
max xmit = 65535
domain logons = Yes
os level = 65
preferred master = Yes
dns proxy = No
wins support = Yes
panic action = /usr/share/samba/panic-action %d
admin users = administrator
create mask = 0754
directory mask = 0754
block size = 4096
delete veto files = Yes
ea support = Yes
kernel oplocks = No
oplocks = No
level2 oplocks = No
vfs objects = streams_xattr
[nao-cifs]
path = /st1/nao
username = nao
write list = nao
read only = No
write cache size = 262144
hide dot files = No
--
こんな感じで。
それから、起動ファイルを作成。本当はupstartとか使うんでしたっけ??
よくわからないので、init.dでいきます。
# vi /etc/init.d/samba
ファイルにはこんな感じで。
--
#!/bin/sh
# Provides: samba
# Required-Start: $
network $local_fs $remote_fs
# Required-Stop: $network $local_fs $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Should-Start: slapd
# Should-Stop: slapd
# Short-Description: start Samba daemons (nmbd and smbd)
### END INIT INFO
# Defaults
# Reads config
file (will override defaults above)
[ -r /etc/default/samba ] && . /etc/default/samba
PIDDIR=/usr/local/samba/var/locks
NMBDPID=$PIDDIR/nmbd.pid
SMBDPID=$PIDDIR/smbd.pid
# clear conflicting settings from the environment
unset TMPDIR
# See if the daemons are there
test -x /usr/local/samba/sbin/nmbd -a -x /usr/local/samba/sbin/smbd || exit 0
. /lib/lsb/init-functions
case "$1" in
start)
log_daemon_msg "Starting Samba daemons"
# Make sure we have our PIDDIR, even if it's on a tmpfs
install -o root -g root -m 755 -d $PIDDIR
NMBD_DISABLED=`testparm -s --parameter-name='disable
netbios' 2>/dev/null`
if [ "$NMBD_DISABLED" != 'Yes' ]; then
log_progress_msg "nmbd"
if ! start-stop-daemon --start --quiet --oknodo --exec /usr/local/samba/sbin/nmbd -- -D
then
log_end_msg 1
exit 1
fi
fi
if [ "$RUN_MODE" != "inetd" ]; then
log_progress_msg "smbd"
if ! start-stop-daemon --start --quiet --oknodo --exec /usr/local/samba/sbin/smbd -- -D; then
log_end_msg 1
exit 1
fi
fi
log_end_msg 0
;;
stop)
log_daemon_msg "Stopping Samba daemons"
log_progress_msg "nmbd"
start-stop-daemon --stop --quiet --pidfile $NMBDPID
# Wait a little and remove stale PID file
sleep 1
if [ -f $NMBDPID ] && ! ps h `cat $NMBDPID` > /dev/null
then
# Stale PID file (nmbd was succesfully stopped),
# remove it (should be removed by nmbd itself IMHO.)
rm -f $NMBDPID
fi
if [ "$RUN_MODE" != "inetd" ]; then
log_progress_msg "smbd"
start-stop-daemon --stop --quiet --pidfile $SMBDPID
# Wait a little and remove stale PID file
sleep 1
if [ -f $SMBDPID ] && ! ps h `cat $SMBDPID` > /dev/null
then
# Stale PID file (nmbd was succesfully stopped),
# remove it (should be removed by smbd itself IMHO.)
rm -f $SMBDPID
fi
fi
log_end_msg 0
;;
reload)
log_daemon_msg "Reloading /usr/local/samba/lib/smb.conf" "smbd only"
start-stop-daemon --stop --signal HUP --pidfile $SMBDPID
log_end_msg 0
;;
restart|force-reload)
$0 stop
sleep 1
$0 start
;;
status)
status="0"
NMBD_DISABLED=`testparm -s --parameter-name='disable netbios' 2>/dev/null`
if [ "$NMBD_DISABLED" != "Yes" ]; then
status_of_proc -p $NMBDPID /usr/local/samba/sbin/nmbd nmbd || status=$?
fi
if [ "$RUN_MODE" != "inetd" ]; then
status_of_proc -p $SMBDPID /usr/local/samba/sbin/smbd smbd || status=$?
fi
if [ "$NMBD_DISABLED" = "Yes" -a "$RUN_MODE" = "inetd" ]; then
status="4"
fi
exit $status
;;
*)
echo "Usage: /etc/init.d/samba {start|stop|reload|restart|force-reload|status}"
exit 1
;;
esac
exit 0
--
実行権限つけて。
# chmod +x /etc/init.d/samba
シンボリックリンク作って。
# ln -s /etc/init.d/samba /etc/rc3.d/S20samba
# /etc/rc3.d/S20samba start
* Starting Samba daemons
...done.
ユーザー作ります。
# /usr/local/samba/bin/pdbedit -a nao
new password:
retype new password:
Unix username: nao
NT username:
Account Flags: [U ]
User SID: S-1-5-21-542004972-3484054483-2600468714-1000
Primary Group SID: S-1-5-21-542004972-3484054483-2600468714-513
Full Name:
Home Directory: \\fs-cifs\nao
HomeDir Drive:
Logon Script:
Profile Path: \\fs-cifs\nao\profile
Domain: WORKGROUP
Account desc:
Workstations:
Munged dial:
Logon time: 0
Logoff time: 9223372036854775807 seconds since the Epoch
Kickoff time: 9223372036854775807 seconds since the Epoch
Password last set: Fri, 28 Jan 2011 00:35:17 JST
Password can change: Fri, 28 Jan 2011 00:35:17 JST
Password must change: never
Last bad password : 0
Bad password count : 0
Logon hours : FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
Macなどからつなげてみます。
OK
ちなみに、
# /usr/local/samba/bin/smbstatus
Samba version 3.5.6
PID Username Group Machine
-------------------------------------------------------------------
21195 nao nao macbookpro (192.168.1.60)
17053 nao nao 192.168.1.67 (192.168.1.67)
Service pid machine Connected at
-------------------------------------------------------
nao-cifs 21195 macbookpro Fri Jan 28 23:40:14 2011
nao-cifs 17053 192.168.1.67 Fri Jan 28 01:44:22 2011
Locked files:
Pid Uid DenyMode Access R/W Oplock SharePath Name Time
--------------------------------------------------------------------------------------------------
とりあえずファイルは読めるようになりました
拡張属性周りはまだノーチェック。