2012年10月9日 星期二

HPUX Samba Setup


===============Install HPUX samba steps==========================

1. 新版HP_SAMBA放在dgs:/vision/hp_samba 目錄有cifs & ldap.
2. 安裝前要先check 是否有裝ldap server 若沒有要先install ldap server 再 install CIFS server 否則 server無法更新.(install & check step as attach file)
3. 在dgs:/vision/hp_samba 目錄下有smb.conf file 抓回去直接更改 ip 放到 /etc/opt/samba 目錄下.
4. 在/etc/rc.config.d 的samba 內容要改 RUN_SAMBA=1 (原先為 RUN_SAMBA=0)
5. 在/etc/passwd 要新增hmisa account 否則samba 啟動後只會看到nmbd 看不 smbd .


========要安裝HP samba,必須先安裝ldap server再安裝cifs server======

1.將ldap及cifs之depot file先上傳至主機任一目錄,如:/tmp/hpsw
2.如果目前有samba process在run,必須先將Samba先停止,再做安裝的動作。
3.先確認ldap版本及cifs版本
  swlist -l product|grep -i ldap
  LdapUxClient          B.04.20        LDAP-UX Client Services
  NisLdapServer         B.04.20        The NIS/LDAP Gateway (ypldapd)
  swlist -l product|grep -i cifs
  沒裝就看不到東西。
4.check ldap及cifs目前source之版本
  #swlist -d -s /data/J4269AA_B.04.20_HP-UX_B.11.11_32_64.depot
  # Initializing...
  # Contacting target "ss2"...
  #
  # Target:  ss2:/data/J4269AA_B.04.20_HP-UX_B.11.11_32_64.depot
  #

  #
  # Bundle(s):
  #

    J4269AA       B.04.20        LDAP-UX Integration
5.確認要安裝的版本之後就執行swinstall
  #swinstall -s /data/J4269AA_B.04.20_HP-UX_B.11.11_32_64.depot
   (先安裝ldap)
  #swinstall -s /data/HP-UX_11.11_B8725AA_A.02.04.06_HP-UX_B.11.11_32_64.depot
   (後安裝cifs)
  確認沒有error即可。
  (errorlog會放在/var/adm/sw/swagent.log中)
6.編輯/etc/opt/samba/smb.conf,放入相對應的smaba config。
7.在/etc/rc.config.d 的samba 內容要改 RUN_SAMBA=1 (原先為 RUN_SAMBA=0)即可啟動。
8.確認執行狀態,執行路徑如果是在/opt/samba/bin就代表正確啟動了新版hp_samba。
9.將/opt/samba/bin加入root的.profile PATH中,即可使用smbstatus -l|grep ip去查詢連上的session情況。

以下是samba scripts內容:

======samba_up.sh=======
[Shin-chu]ss2:/home/sos#cat hp_samba_up.sh
#  hp_samba_up
#!/bin/sh
sh -x /sbin/init.d/samba stop
sh -x /sbin/init.d/samba start
=======================
======samba_down.sh======
[Shin-chu]ss2:/home/sos#cat hp_samba_down.sh
#!/bin/sh
ps -e | grep smbd | cut -c1-6 > /home/op/samba_proc
ps -e | grep nmbd | cut -c1-6 >> /home/op/samba_proc
for proc in `cat /home/op/samba_proc`
do
  kill -9 $proc
done
=========================