10月10
    近期要用crontab执行一些命令:定期让系统时间和硬件时间同步。因为我总是发现我的linux服务器时间会变慢,最后想到同步这个办法。

    一开始,我将命令:*/1 * * * * root hwclock --hctosys 写到 /root/spool/cron/root文件(直接敲入命令crontab -u root -e 可对其进行编辑),但是总是在执行后root用户收到一封邮件关于cron的,提示错误信息:
From root@localhost.localdomain  Wed Sep 22 10:10:01 2010
Return-Path: <root@localhost.localdomain>
Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
by localhost.localdomain (8.13.8/8.13.8) with ESMTP id o8M2A1bL024533
for <root@localhost.localdomain>; Wed, 22 Sep 2010 10:10:01 +0800
Received: (from root@localhost)
by localhost.localdomain (8.13.8/8.13.8/Submit) id o8M2A1hh024532;
Wed, 22 Sep 2010 10:10:01 +0800
Date: Wed, 22 Sep 2010 10:10:01 +0800
Message-Id: <201009220210.o8M2A1hh024532@localhost.localdomain>
From: root@localhost.localdomain (Cron Daemon)
To: root@localhost.localdomain
Subject: Cron <root@localhost> root hwclock --hctosys
Content-Type: text/plain; charset=UTF-8
Auto-Submitted: auto-generated
X-Cron-Env: <SHELL=/bin/sh>
X-Cron-Env: <HOME=/root>
X-Cron-Env: <PATH=/usr/bin:/bin>
X-Cron-Env: <LOGNAME=root>
X-Cron-Env: <USER=root>

/bin/sh: root: command not found

/bin/sh: root: command not found 表明crontab默认使用的shell是/bin/sh
并且在上面列出了crontab的默认环境变量:
X-Cron-Env: <SHELL=/bin/sh>                //默认使用的shell
X-Cron-Env: <HOME=/root>                        //用户目录
X-Cron-Env: <PATH=/usr/bin:/bin>              //命令搜索路径
X-Cron-Env: <LOGNAME=root>                   //登陆用户名
X-Cron-Env: <USER=root>                         //用户

解决方法1:
root的crontab文件中加入:
SHELL=/bin/sh
PATH=/sbin:/bin:/usr/sbin:/usr/bin

解决方法2(这是我选择的):
写到 /etc/crontab文件,在最后一行假如以下代码:
*/1 * * * * root hwclock --hctosys
代表每隔1分钟执行。
Tags: , , ,
10月10
If you get error:

dd: /dev/adN: Operation not permitted
(wherei N is drive number)

this is happening because you are blocked by GEOM's protection for the MBR of the disk drive.

To solve this turn the protection off with a sysctl variable change from console:
sysctl kern.geom.debugflags=0x10
12月29
因其他原因,仅用FreeBSD disc1安装了一个最基本的系统起来,里面没有ports。
手头上也没有FreeBSD完整版的光盘,想安装软件都麻烦。

解决:
1、保证此FreeBSD系统能正常上网。

2、编辑make.conf
# vi /etc/make.conf
内容:
MASTER_SITE_OVERRIDE=\
ftp://ftp.freebsdchina.org/pub/FreeBSD/ports/distfiles/${DIST_SUBDIR}\
ftp://ftp.tw.freebsd.org/pub/FreeBSD/ports/distfiles/${DIST_SUBDIR}
保存退出。

3、编辑portsnap.conf
# vi /etc/portsnap.conf
将里面的:
SERVERNAME=portsnap.FreeBSD.org
修改为:
SERVERNAME=portsnap.hshh.org
保存退出。

4、执行:
# portsnap fetch extract && portsnap fetch update


注:如果有其他更快一点的站点,用那快一点的站点也可以。
12月23
在/etc/rc.conf文件内加入以下语句即可:
sendmail_enable="NO"
sendmail_submit_enable="NO"
sendmail_outbound_enable="NO"
sendmail_msp_queue_enable="NO"
12月22
出现此种提示,需要安装libdbi-drivers:
# cd /usr/ports/databases/libdbi-drivers
# make install clean
分页: 1/13 第一页 1 2 3 4 5 6 7 8 9 10 下页 最后页 [ 显示模式: 摘要 | 列表 ]