ProfileSysAdmin ParadiseBlogLists Tools Help

Blog


    June 08

    /usr/openwin/bin/xinit: connection refused

    During installing Solaris, if you encounter the following error messages.  Please check whether you forget to plug your usb mouse or the mouse problem.
     
    ...............................
    giving up
    /usr/openwin/bin/xinit: connection refused (error no 146):unable to connect to x server
    /usr/openwin/bin/xinit/: no such process (error 2) server error
    ...................
    May 11

    FSCK.ext3: permission denied while trying to open /dev/ida!c0d0p2

    Just tried to install Fedora Core 5 on my HP DL380 Server.  I was experienced with loading it after the installation.  The following error shown:
     
    checking filesystems
    FSCK.ext3: permission denied while trying to open /dev/ida!c0d0p2
    You must have r/w access to the filesystem or be root
    ( FAILED)
    An error occured during the file system check
    Dropping you to a shell; the system will reboot
    When you leave the shell
    Warning ---SELinux is active
    Disabling security, enforcement for system recovery
    Run 'setenforce 1' to reenable
    Give root password for maintenance
    ( or type control-D to continue )
    Solution:
    It is caused by selinux.  Try to use the Rescue disk of FC5 to boot up the system.  Edit /etc/sysconfig/selinux to disable it.  Everything will be alright after the restart.
    March 10

    Compilation failure for GD Library

    I was going to install a software on my Solaris 8 Box which required GD Library to install first.
     
    I downloaded the newest version gd-2.0.33  from http://www.boutell.com/gd/ and failed to compile it with the follow errors:
     
    Undefined                      first referenced
     symbol                            in file
    gdImageCreateFromGd2Part            gdparttopng.o
    ld: fatal: Symbol referencing errors. No output written to .libs/gdparttopng
    collect2: ld returned 1 exit status
     
    I got hopeless without finding any solution on the Internet.  I ensured libpng was installed well.
     
    Suddenly my mind came a hint.  I changed the set path with looking /usr/local/bin first and then /usr/bin.  At last, it was solved.  I guessed it was because there wass older version pack in /usr/bin which made it failed.
    March 02

    Compile Sendmail

    It is hard to find detail information from Internet about compiling sendmail.  But it is not as smooth as you think.
     
    Environment: Solaris 8 (You are recommended to install Developer Distribution or above which installed most of the Sun packages and libraries)
    Sendmail Version: 8.13.5
     
    1, Download Sendmail Source from www.sendmail.org
    2, Download and install Berkeley DB from www.sleepycat.com or www.sunfreeware.org .  I tried v3.3.11.  (Better use v3.x version.  There are many unknown error when trying v4.x)
    3, Download and install make v3.8 from www.sunfreeware.org
    4, Download and install gcc v3.4.2 from www.sunfreeware.org
    5, Download and install libiconv 2.8 from www.sunfreeware.org
    6, Check whether the following sun packages installed or not:
    SUNWbtool, SUNWhea, SUNWlibC, SUNWlibCf, SUNWlibm, SUNWscpr, SUNWscpu, SUNWsra, SUNWsrh, SUNWxcu4, SUNWxcu4t, SUNWsprot, SUNWarc, SUNWarcx
    7, Check the UNIX_PATH to include the following path:
    /usr/bin /usr/sbin /usr/local/bin /usr/local/sbin /usr/local/BerkeleyDB.3.3 /usr/local/include /usr/include /usr/ccs/bin
    8, create the following directories if not existed:
    /usr/share/man/cat1
    /usr/share/man/cat5
    /usr/share/man/cat8
    9, Extract sendmail source to a temporary locaiton.
    10, Change to directory sendmail_src_home/sendmail
    11, Execute "sh Build" (If there is error, most probably it is caused by missing some SUN packages)
    12, If no error reported, change to directory sendmail_src_home/cf/domain
    13, Copy generic.m4 to YOUR_HOSTNAME.m4 (for example mailsrv.abc.com.m4)
    14, Change to directory sendmail_src_home/cf/cf
    15, Copy generic-solaris.mc to config.mc and insert the following lines below the line OSTYPE(...) in config.mc.  The FEATURE is optional in case you want to use such database.
    DOMAIN(YOUR_HOSTNAME)dnl
    FEATURE(`access_db',`dbm -T<TMPF> /etc/mail/access')dnl
    FEATURE(`mailertable',`dbm /etc/mail/mailertable')dnl
    FEATURE(`virtusertable',`dbm /etc/mail/virtuertable')dnl
    16, Execute "sh Build config.cf"
    17, Copy the config.cf to replace /etc/mail/sendmail.cf
    18, Change to directory sendmail_src_dir/sendmail
    19, Execute "sh Build install"
    20, If no error reported, change to directory sendmail_src_dir and execute "sh Build install" again
    21, Possibly it is successfully installed.
    22, Execute "/etc/rc2.d/S88sendmail stop" and "/etc/rc2.d/S88sendmail start"
    23, telnet localhost 25 and see whether the sendmail is installed with the compile version.
     
    February 27

    Zimbra Mail Server Installation

    Recently, I am trying to study a new enterprise email server for my company.  To save money, I tend to find an open source system.  There are 3 popular choices, here is the comments to them.
     
    Scalix - not supports unicode.
    OpenXchange - not provide wizards installation and web console in the free license version
     
    As of above concerns, I selected Zimbra (www.zimbra.com).
     
    The open source version already provides rich email functions.  I am not going to list here.  The information can be found on their websites.
     
    I have tried installed it on FC3 and FC4.  It is quite stable and the installation is very smooth.  You may just spend ten somethings minutes to install it.
     
    Some tips on the system installation:-
    1, After a clean OS installation, remove the hostname, which created when installing the OS,  from the 127.0.0.1 entry of /etc/hosts and add another entry for the mail domain.
    127.0.0.1  localhost.localdomain  localhost
    Your_Server_IP  abc.com  mailsrv
    2, install fetchmail and libstdc by execute
    yum install fetchmail
    yum install compat-libstdc++-33
    3, Download the Open Source Version of Zimbra from their website.  Extract it into the OS, for example /tmp
    4, cd /tmp/zcs and execute ./install.sh
    5, They are just some "y" and information provided aftewards.  You will be asked to input domain name.  Just input the mail domain as of input at the /etc/hosts.  In this example, that is "abc.com"
    6, Then another few steps for "y".
    7.  Congratulation, you got it.   It's too easy.
    8.  Open http://IP:7071 and login with the admin account
    9.  Enjoy.

    限制Linux的用戶郵件容量(Quota)

    我公司是用Sendmail作為MTA,郵件會儲存於/var/spool,若要限制用戶的郵箱容量,最直接的方法是從Linux的File System著手,只需要限制/var下面屬放某用戶的檔案容量便可以。
     
    環境:Fedora Core 3
     
    1, 執行rpm -qi quota ,看看有沒有安裝quota的包包
    2, 編輯/etc/fstab,在指定的partition(例如 /var)的defaults值後面加上 usrquota或grpquota或兩者並存

    修改前
    /dev/sys                /sys                    sysfs   defaults
    /dev/VolGroup00/LogVol03 /usr                    ext3    defaults
    /dev/VolGroup00/LogVol02 /var                    ext3    defaults

    修改後
    /dev/sys                /sys                    sysfs   defaults
    /dev/VolGroup00/LogVol03 /usr                    ext3    defaults
    /dev/VolGroup00/LogVol02 /var                    ext3    defaults,usrqouta,grpquota
     
    usrquota是限制獨立用戶的quota
    grpqouta限制一個group的總quota


    3, 重啟系統(我試過用 mount -o remount /dev/VolGroup00/LogVol02 /var , 但發現不行)
    4, touch /var/aquota.user (若要使用grpquota, 便也要touch /var/aquota.group), 然後chmod 600 aquota.user, 注意不同kernel使的的quota file就有所不同

    Quota Version 2 (Linux 2.4/2.6 kernel: Red Hat 7.1+/8/9,FC 1-3): aquota.user, aquota.group
    Quota Version 1 (Linux 2.2 kernel: Red Hat 6, 7.0): quota.user, quota.group


    5, 執行quotacheck -vguma (有些kernel 要執行 quotacheck -vgum /var 才行)
    6, 然後執行quotaon -av
    7, 現在便可以開始為每一個用戶設定特定quota


    edquota -u USERNAME (若為group, 便執行 edquota -p GROUPNAME)

    以上指令會預設會用vi 編輯指定用戶或群組的quota file (若開啟不到,應該是預設的編輯器有錯誤,可在csh下執行 setenv EDITOR=vi), 調檔案內soft及hard值

    若容量達soft值,系統會發出warnings給用戶,hard值就是最大quota,因為warnings只有用戶telnet/ssh login才能發出,用pop登入是不會發出,這個情況下,soft值同hard值設定一樣也可以。

    soft跟hard值都是kb作為單位,所以設定1024就等同1Mb的quota


    8, 儲存後就即時生效,可以用edquota -p original_user another_user將一個用戶的quota值複製給其他用戶
    9, 可以quota -v USERNAME去檢查用戶的容量
    10, 未完的,以上雖解決了quota的限制設定,但有兩個問題隨之會產生:

    當Sendmail MTA嘗試發寄電郵到一個over quota的郵箱時,只會在maillog產生一個Error
    local mailer (/usr/bin/procmail) exited with EX_TEMPFAIL,預設系統是不會發回 notification給發件者,從而發件者一直不知自己發的郵件是寄不到收件者
    要解決這個問題只需要編輯 /etc/mail/sendmail.cf,然後尋找Mlocal字串,它對下有一句 A=procmail -Y -t -a .......
    將 "-t" 刪去,儲存並重啟sendmail即能解決

     

    另一問題,當使用qpopper作為POP3程式,因為預設下,當一個用戶pop郵件,它會將 /var/mail/MAILFILE抄一份到 /var/mail/.MAILFILE.pop (cache),所以qpopper建議用戶的quota是最大容量的兩倍,但無論設定 soft值或hard值,設定多了一倍容量,用戶都能用到那個限額,那麼抄出來一份也是超過quota所定,故唯一方法是設定qpopper將cache mail指定到 /var以外,同時你確保/var以外的地方是有足夠儲存容量給某一刻時間制做出來的cache擺放,若可以重新compile qpopper, 可以在執行./configure --enable-temp-drop-dir=DIR_NAME,若不能重新compile,就使用run-time option,先建立一個檔案(任意叫pop3.conf),編輯並加入 set temp-dir=DIR_NAME, 儲存後重新執行 qpopper -s -f /DIR/pop3.conf