Debian 上使用 rc.local

2006-04-30,星期日 | 分类:Debian | 标签: | 615 Views

# touch /etc/init.d/rc.local
设置为可执行:
# chmod +x /etc/init.d/rc.local
用 update-rc.d 设置启动级别:
# update-rc.d rc.local start 99 2 3 4 5 . stop 99 0 1 6 .
为了编辑方便,创建一个链接:
# ln -s /etc/init.d/rc.local /etc/rc.local
# cat /etc/rc.local
#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.

## start apache
/usr/local/apache/bin/apachectl start

Debian Sarge 配置 shfs

2005-06-03,星期五 | 分类:Debian | 标签: | 4,877 Views

先看一下内核版本:
# uname -r
2.6.8-2-686-smp

安装相应内核头文件的包:
# apt-get install kernel-headers-2.6.8-2-686-smp

安装 module-assistant :
# apt-get install module-assistant
这是个很好用的工具,可以用它来安装 shfs 模块:
# module-assistant
SELECT -> 选择 shfs 模块 -> 确定

为了方便挂接,接下来设置一下 ssh 的 key 验证:
# ssh-keygen -t rsa
直接回车
# ssh SERVER
# mkdir .ssh
# chmod 0600 .ssh
# exit
# scp .ssh/id_rsa.pub root@SERVER:.ssh/authorized_keys

接下来就可以通过 ssh 挂载远程文件系统了:
# mount -t shfs root@SERVER:/DIR /LOCAL/DIR -o umask=0,uid=106,gid=106
卸载:
# umount /LOCAL/DIR

还可以编辑 /etc/fstab 文件以自动挂载。

Pages: Prev 1 2