Monday, July 14, 2008

Installing SAMBA 3 on NetBSD with pkgsrc

Hye all..

There's a few way to install pkg/applications in *BSD, and today i'll show u how to install SAMBA in NetBSD.

What do u need:

1- a working NetBSD box, with internet access, and u have root access
2- method of installing, we use pkgsrc
3-hard work, willing to learn, blablabla
ok. so after we have a working NetBSD box, we need to install pkgsrc or at least already have it. Do u?
# export PKG_PATH=""
# export PKG_PATH
# pkg_add -v cvsup
increasing RLIMIT_NOFILE to max. 1772 open files
trying PKG_PATH
Spawning FTP coprocess
ftp -detv

wait until the installation of cvsup pkg is finished, then ure ready to kick-off the cvsup

# cd /usr/pkg/share/examples/cvsup/
# ls

sample of cvsup config file can be choose now, I use

# cp /usr/pkg/share/examples/cvsup/ /root/

edit using your text editor ( vi, pico, joe, nano etc ) the config file, i use nano ( not in default NetBSD install, u can install it thru pkg_add ):
# nano

# Example cvsup config file provided by
# Onno van der Linden
# This file can be used to obtain the checked-out NetBSD source files

*default tag=. # Get the current files. Replace the
# ``.'' with a cvs tag to get other
# NetBSD releases.
*default release=cvs
*default delete use-rel-suffix
*default umask=022
*default # Machine to connect to
*default base=/var/ # Location to put the sources
*default prefix=/usr/ # Where to put the sup subdirectory

*default compress # Use this unless your network link
# is a T1 or faster

# You can get everything using the ``netbsd'' collection.
# netbsd-doc

# Alternatively, comment out the ``netbsd'' collection and just get one or
# more of the partial collections by uncommenting them below.

#netbsd-doc prefix=/var/


# netbsd-xsrc

edit the file according to above, save it and ure ready to update!

# cvsup -g -L 2
Parsing supfile "./"
Connecting to
Connected to
Server software version: SNAP_16_1h
Negotiating file attribute support
Exchanging collection information
Establishing multiplexed-mode data connection
Updating collection netbsd-pkgsrc/cvs
Edit pkgsrc/audio/mpegaudio/PLIST
Add delta 2002. wiz
Edit pkgsrc/audio/mpegaudio/patches/patch-aa
Add delta 2002. wiz
Edit pkgsrc/audio/mpegaudio/patches/patch-ab
Add delta 2002. wiz
Edit pkgsrc/audio/mpg123-nas/PLIST
Add delta 2002. rh
Edit pkgsrc/audio/mpg321/PLIST
Add delta 2002. rh
Edit pkgsrc/audio/oggasm/PLIST
Add delta 2002. zuntum
Edit pkgsrc/audio/spiralsynth/PLIST
Add delta 2002. rh
Edit pkgsrc/audio/wmmp3/PLIST
Add delta 2002. rh
Edit pkgsrc/audio/wmsmixer/PLIST
Add delta 2002. agc
Edit pkgsrc/chat/bitchx/Makefile
Add delta 1.45 2008. dholland
Edit pkgsrc/chat/finch/Makefile
Add delta 1.14 2008. tnn
Edit pkgsrc/chat/goofey/PLIST
Add delta 2002. grant
Edit pkgsrc/chat/libpurple/Makefile.common
Add delta 1.18 2008. tnn
Edit pkgsrc/chat/libpurple/distinfo
Add delta 1.16 2008. tnn
Edit pkgsrc/chat/libpurple/patches/patch-aa
Add delta 1.9 2008. tnn
Edit pkgsrc/chat/pidgin/Makefile
Add delta 1.13 2008. tnn
Edit pkgsrc/chat/pidgin-sametime/Makefile
Add delta 1.5 2008. tnn
Edit pkgsrc/chat/pidgin-silc/Makefile
Add delta 1.8 2008. tnn
Edit pkgsrc/chat/pidgin-silc/distinfo
Add delta 1.12 2008. tnn
Edit pkgsrc/chat/silc-client/Makefile
Add delta 1.49 2008. tonnerre
Edit pkgsrc/chat/silc-client/Makefile.common
Add delta 1.11 2008. tonnerre
Edit pkgsrc/chat/silc-client/PLIST
Add delta 1.23 2008. tonnerre
Edit pkgsrc/chat/silc-client/PLIST.perl
Add delta 1.7 2008. tonnerre
Edit pkgsrc/chat/silc-client/distinfo
Add delta 1.32 2008. tonnerre
Edit pkgsrc/chat/silc-client/
Add delta 1.5 2008. tonnerre
Edit pkgsrc/chat/silc-client/patches/patch-aa
Add delta 1.13 2008. tonnerre
Edit pkgsrc/chat/silc-client/patches/patch-ab
Add delta 1.13 2008. tonnerre
Edit pkgsrc/chat/silc-client/patches/patch-ac
Add delta 1.10 2008. tonnerre
Edit pkgsrc/chat/silc-client/patches/patch-ad
Add delta 1.5 2008. tonnerre
Checkout pkgsrc/chat/silc-client/patches/patch-ae
Edit pkgsrc/comms/asterisk/Makefile
Add delta 1.56 2008. sborrill
Edit pkgsrc/comms/asterisk/files/
Add delta 1.3 2008. sborrill
Edit pkgsrc/comms/conserver/patches/patch-aa
Add delta 2002. hubertf
Edit pkgsrc/comms/esms/PLIST
Add delta 2002. tron
Edit pkgsrc/comms/obexapp/distinfo
Add delta 1.8 2008. plunky
Edit pkgsrc/comms/obexapp/patches/patch-af
Add delta 1.3 2008. plunky
Edit pkgsrc/converters/ack/PLIST
Add delta 2002. seb
Edit pkgsrc/converters/ack/patches/patch-aa
Add delta 2002. seb
Edit pkgsrc/converters/hztty/PLIST
Add delta 2002. agc
Edit pkgsrc/converters/nkf/PLIST
Add delta 2002. seb
Edit pkgsrc/converters/qkc/PLIST
Add delta 2002. seb
Edit pkgsrc/converters/tex2rtf/PLIST
Add delta 2002. rh
Edit pkgsrc/cross/bfd-mdsetimage/Makefile
Add delta 1.22 2008. joerg
Checkout pkgsrc/databases/pear-MDB2/Makefile
Checkout pkgsrc/databases/pear-MDB2/distinfo
Checkout pkgsrc/databases/pear-MDB2/patches/patch-aa
Checkout pkgsrc/databases/pear-MDB2/patches/patch-ab
Checkout pkgsrc/databases/pear-MDB2_Driver_mysql/Makefile
Checkout pkgsrc/databases/pear-MDB2_Driver_mysql/distinfo
Checkout pkgsrc/databases/pear-MDB2_Driver_mysql/patches/patch-aa
Checkout pkgsrc/databases/pear-MDB2_Driver_mysql/patches/patch-ab
Checkout pkgsrc/databases/pear-MDB2_Driver_pgsql/Makefile
Checkout pkgsrc/databases/pear-MDB2_Driver_pgsql/distinfo
Checkout pkgsrc/databases/pear-MDB2_Driver_pgsql/patches/patch-aa
Checkout pkgsrc/databases/pear-MDB2_Driver_pgsql/patches/patch-ab
Edit pkgsrc/devel/Makefile
Add delta 1.945 2008. rhaen
Edit pkgsrc/devel/Renaissance/Makefile
Add delta 1.17 2008. joerg

wait until it finished... and now installation of applications/software/pkg/programs

# cd /usr/pkgsrc/net/samba/
# make install clean
=> Bootstrap dependency digest>=20010302: found digest-20080510
===> Skipping vulnerability checks.
WARNING: No /var/db/pkg/pkg-vulnerabilities file found.
WARNING: To fix run: `/usr/pkg/sbin/download-vulnerability-list'.
=> Checksum SHA1 OK for samba-3.0.30.tar.gz
=> Checksum RMD160 OK for samba-3.0.30.tar.gz
===> Installing dependencies for samba-3.0.30
The supported build options for samba are:

ads cups fam ldap pam winbind

You can select which build options to use by setting PKG_DEFAULT_OPTIONS
or the following variable. Its current value is shown:

PKG_OPTIONS.samba (not defined)

The following variables will affect the build process of this package,
samba-3.0.30. Their current value is shown below:

* VARBASE = /var

=== lots of output msg ====================

=> Automatic manual page handling
=> Running POST-INSTALL script actions
samba-3.0.30: copying /usr/pkg/share/examples/samba/smb.conf.default to /usr/pkg/etc/samba/smb.conf
The following files should be created for samba-3.0.30:

/etc/rc.d/smbd (m=0755)

/etc/rc.d/samba (m=0755)

/etc/rc.d/nmbd (m=0755)

=> Please note the following:

$NetBSD: MESSAGE,v 1.4 2005/11/14 08:05:27 jlam Exp $

When upgrading a Samba installation and "lock directory" has been set
to a non-default value in the configuration files, then "state directory"
needs to be set appropriately and/or the files located in the lock
directory should be moved to the state directory. Please read the
documentation on "state directory" in the smb.conf(5) manual page for
more information.

=> Registering installation for samba-3.0.30
samba-3.0.30 requires installed package perl-5.8.8nb8
samba-3.0.30 requires installed package readline-5.2nb1
===> Cleaning for samba-3.0.30

so just copy it to the location..

# cd /etc/rc.d
# ls
DAEMON fixsb mixerctl powerd staticroute
LOGIN fsck mopd ppp swap1
NETWORKING ftpd motd pwcheck swap2
SERVERS hostapd mountall quota sysctl
accounting identd mountcritlocal racoon sysdb
altqd ifwatchd mountcritremote raidframe syslogd
amd inetd mountd raidframeparity timed
apmd ipfilter moused rarpd tpctl ipfs mrouted rbootd ttys
bootparams ipmon named root veriexec
btconfig ipnat ndbootd route6d virecover
btdevctl ipsec network routed wdogctl
bthcid irdaattach newsyslog rpcbind wpa_supplicant
ccd iscsi_target nfsd rtadvd wscons
cgd isdnd nfslocking rtclocaltime wsmoused
cleartmp kdc ntpd rtsold xdm
cron ldconfig ntpdate rwho xfs
dhclient lkm1 pf savecore ypbind
dhcpd lkm2 pf_boot screenblank yppasswdd
dhcrelay lkm3 pflogd sdpd ypserv
dmesg local poffd securelevel
downinterfaces lpd postfix sshd
# cp /usr/pkg/share/examples/rc.d/smbd .
# cp /usr/pkg/share/examples/rc.d/samba .
# cp /usr/pkg/share/examples/rc.d/nmbd .

# chmod 755 smbd
# chmod 755 nmbd
# chmod 755 samba

edit the /etc/rc.conf file to enable samba, and start during boot. So add this line:

#nano /etc/rc.conf

so now start the SAMBA!!

# /etc/rc.d/samba start
Starting nmbd.
Starting smbd.

or u can also use:

# /etc/rc.d/samba restart
Stopping smbd.
kill: 28409: No such process
Stopping nmbd.
Starting nmbd.
Starting smbd.

check if it runs:

# ps aux | grep /usr/pkg
root 23981 0.0 3.2 1088 1548 ? Ss 11:21AM 0:00.01 /usr/pkg/sbin/nmbd -D
root 24742 0.0 5.5 3316 2684 ? Is 11:21AM 0:00.02 /usr/pkg/sbin/smbd -D
root 24978 0.0 2.7 3316 1320 ? I 11:21AM 0:00.01 /usr/pkg/sbin/smbd -D

# smbclient -L localhost
Domain=[NETBSD MYGROUP] OS=[Unix] Server=[Samba 3.0.30]

Sharename Type Comment
--------- ---- -------
IPC$ IPC IPC Service (Samba 3.0.30 ())
Domain=[NETBSD MYGROUP] OS=[Unix] Server=[Samba 3.0.30]

Server Comment
--------- -------

Workgroup Master
--------- -------

no password is set, so u just press "ENTER"
so now your SAMBA is running, u can edit/tailor your SAMBA config file as u wish!

# nano /usr/pkg/etc/samba/smb.conf

and restart the SAMBA again to see the result!!


No comments: