Entries Tagged as ''

proftpd配置虚用户

配了个proftpd

不想用系统帐号

也不想用数据库

反正用户书也不多

就直接用文件

于是

authuserfile

authgroupfile

分别指向了认证的用户文件和用户组文件

authuserfile里的信息可以由proftpd带的一个叫ftpasswd的perl脚本程序实现

ftpasswd –passwd –file=/pathtoproftpd/etc/proftpd.user –name=username –uid=1001 –home=/www/www.domainname.com –shell=/bin/false

ftpasswd是一个很好用的工具

在proftpd源代码目录下的crontab目录下

这里的一个文档

FreeBSD的自动安装

折腾这个事儿很长时间了

一方面现在装FreeBSD很少

不急

所以一直也没弄好

最近快年底了,得赶紧弄完

所以今天终于搞定了

结构是局域网上有一台install server

上面开着ftp、tftp服务

要装的机器pxe去抓tftp上的启动image启动机器

然后用户输入装机用的网络设备、ip、掩码、网关、dns服务器

然后系统就自动去ftp server上抓东西安装

安装完毕

自动重起

文件install.cfg的内容:

 

debug=yes

command=sh /stand/setmedia.sh

system

configFile=/stand/setmedia.cfg

loadConfig

 文件setmedia.sh的内容:

#!/bin/sh

set PATH=$PATH:/bin:/usr/bin:/sbin:/usr/sbin:/sbin

export PATH

tmpfile=/stand/install.tmp

config=/stand/setmedia.cfg

#menu=/stand/menu.cfg

menu=""

eval icount=0

for i in `ifconfig -l`; do

        menu="${menu}${i} ${i} "

#       echo -n "$i $i " >> ${menu}

        icount=$((${icount} + 1))

done

if [ -z "${iface}" ]; then

        dialog –title "Select Install Interface" \

                –menu "Please select the network interface for install you with to perform." \

                        -1 -1 ${icount} `echo ${menu}` 2>${tmpfile}

        read iface < ${tmpfile}

        rm -f ${tmpfile}

fi

if [ -z "${ip}" ]; then

        dialog –title "Input IP Address" \

                –inputbox "Please input the ip address of ${iface} for install you with to perform." \

                        -1 -1 2>${tmpfile}

        read ip < ${tmpfile}

        rm -f ${tmpfile}

fi

if [ -z "${netmask}" ]; then

        dialog –title "Input Netmask" \

                –inputbox "Please input the netmask of the network." \

                        -1 -1 2>${tmpfile}

        read netmask < ${tmpfile}

        rm -f ${tmpfile}

fi

if [ -z "${gateway}" ]; then

        dialog –title "Input Gateway" \

                –inputbox "Please input the default gateway of the network." \

                        -1 -1 2>${tmpfile}

        read gateway < ${tmpfile}

        rm -f ${tmpfile}

fi

if [ -z "${nameserver}" ]; then

        dialog –title "Input Nameserver’s IP" \

                –inputbox "Please input the ip of the nameserver." \

                        -1 -1 2>${tmpfile}

        read nameserver < ${tmpfile}

        rm -f ${tmpfile}

fi

if [ -z "${server}" ]; then

        dialog –title "Select Install Server" \

                –menu "Please select the server you wish to install from." \

                        -1 -1 3 \

                        "192.168.222.21" "@idc1" \

                        "10.102.5.31" "@idc2" \

                        "10.1.21.49" "@office1" 2>${tmpfile}

        read server < ${tmpfile}

        rm -f ${tmpfile}

fi

echo "hostname=autoinst.sohu.com" >> ${config}

echo "domainname=sohu.com" >> ${config}

echo "nameserver=${nameserver}" >> ${config}

echo "defaultrouter=${gateway}" >> ${config}

echo "ipaddr=${ip}" >> ${config}

echo "netmask=${netmask}" >> ${config}

echo "" >> ${config}

echo "_ftpPath=ftp://${server}/pub/os/FreeBSD/releases/i386/4.11" >> ${config}

echo "netDev=${iface}" >> ${config}

echo "mediaSetFTP" >> ${config}

echo "distSetMinimum" >> ${config}

disks=`sysctl -n kern.disks`

if [ ! -z "${disks}" ]; then

        disk=`echo ${disks} | sed -e ’s/ .*//g’`

fi

echo "disk=${disk}" >> ${config}

echo "partition=all" >> ${config}

echo "bootManager=standard" >> ${config}

echo "diskPartitionEditor" >> ${config}

echo "#diskPartitionWrite" >> ${config}

echo "${disk}s1-1=ufs 1024000 /" >> ${config}

echo "${disk}s1-2=swap 4096000 none" >> ${config}

echo "${disk}s1-3=ufs 4096000 /var" >> ${config}

echo "${disk}s1-4=ufs 2048000 /root" >> ${config}

echo "${disk}s1-5=ufs 10240000 /usr" >> ${config}

echo "${disk}s1-6=ufs 0 /opt" >> ${config}

echo "diskLabelEditor" >> ${config}

echo "installCommit" >> ${config}

echo "shutdown" >> ${config}

 

FreeBSD4.11release的make boot.flp的问题

前一篇文章提到make boot.flp有问题

后来

我有重新用4.11reelease的source make world后

cd /usr/src/release;make boot.flp

这次倒不是出上次的错误

但还是出新错误

"

cd: can’t cd to /R/stage/trees/bin/dev

*** Error code 2

Stop.
*** Error code 1

Stop

"
 

freebsd下make boot.flp时的问题

工作需要定制FreeBSD启动包boot.flp

于是

cd /usr/src/release;make boot.flp

结果出错:

 

cc -O -pipe -I/usr/src/sbin/dhclient/common/../../../contrib/isc-dhcp -I/usr/src/sbin/dhclient/common/../../../contrib/isc-dhcp/includes -c /usr/src/sbin/dhclient/common/../../../contrib/isc-dhcp/common/alloc.c -o alloc.o ld: could not exec elf/ld in /usr/obj/usr/src/i386/usr/libexec: No such file or directory *** Error code 1 Stop in /usr/src/sbin/dhclient/common. *** Error code 1 Stop in /usr/src/sbin/dhclient. *** Error code 1 Stop in /usr/src/release/boot_crunch. *** Error code 1 Stop in /usr/src/release. *** Error code 1 Stop in /usr/src/release.

重新装了Developer包

还是出这个错

55555555

用源代码编mysql的时候”fails sanity check”的错误

linux2.6的kernel(RedHat enterprise AS 4)

编译mysql4.1.11的时候

./configure

结果出错:

configure: error: C++ preprocessor "/lib/cpp" fails sanity check

ls -l /lib/cpp

这个文件又存在

后来仔细检查

才发现是系统少装了一个包:gcc-c++

apt-get install gcc-c++

则问题解决

FreeBSD4.11启动的时候当在”resetting devices ..”

这两天测试装机

发现一个问题

FreeBSD4.11启动机器的时候

当显示:80

"ata0: resetting devices .."

然后就死掉了

硬盘是ibm的80G的ide硬盘

查了一些资料

说是disable掉ide的dma模式就会好了

于是

再重新启动

在出现9秒等待的时候

敲空格键中止

输入:

set hw.ata.ata_dma="0"

set hw.ata.atapi_dma="0"

boot

终于起来了