LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 1049|回复: 4

怎样在开机时启动samba?

[复制链接]
发表于 2003-11-16 21:13:54 | 显示全部楼层 |阅读模式
怎样在开机时启动samba? 我需要用通过局域网连着的另一台机器的打印机。装了cups和samba。但"lpinfo -v"没有smb一项。
命令 smbstatus 显示:

Samba version 2.2.8a
Service      uid      gid      pid     machine
----------------------------------------------

Failed to open byte range locking database
ERROR: Failed to initialise locking database
Can't initialise locking module - exiting
命令:
lpadmin -p printer -v smb://server:server@printserver/hp6 -m laserjet.ppd -E
显示:
lpadmin: add-printer (set device) failed: client-error-not-possible
可能是 smb没启动?命令smbd也不起作用。
发表于 2003-11-16 21:37:32 | 显示全部楼层
看看有没有 /etc/rc.d/rc.samba这个文件以及它的属性是不是可执行
 楼主| 发表于 2003-11-17 13:59:45 | 显示全部楼层
/etc/rc.d/rc.samba改成可执行重启动后也不行。/etc/rc.d/rc2.d没有samba一项。所以开机不会启动samba?
发表于 2003-11-17 14:04:45 | 显示全部楼层
rc.samba是在rc.M文件里面调用的,你看看rc.M里面是不是把相关的语句注释掉了
 楼主| 发表于 2003-11-17 20:08:13 | 显示全部楼层
#!/bin/sh
#
# rc.M          This file is executed by init(8) when the system is being
#               initialized for one of the "multi user" run levels (i.e.
#               levels 1 through 6).  It usually does mounting of file
#               systems et al.
#
# Version:      @(#)/etc/rc.d/rc.M      2.02    02/26/93
#
# Author:       Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org>
#               Heavily modified by Patrick Volkerding <volkerdi@ftp.cdrom.com>
#
# Adapted for BsV by Jonathan B. Araujo Neto <jones@brfree.com.br>
#



# Tell the viewers what's going to happen...
echoc "==> rc.M Entering multiuser mode...." blue
sleep 2


# Configure ISA plug'n'pray
if [ -x /etc/rc.d/rc.pnp ] ; then
        echoc "Configuring ISA Plug and Pray" red
        . /etc/rc.d/rc.pnp
fi


# This loads any kernel modules that are needed.  These might be required to
if [ -x /etc/rc.d/rc.modules ]; then
  echoc "Loading modules" red
  . /etc/rc.d/rc.modules
fi

# Initialize PCMCIA devices:
if [ -x /etc/rc.d/rc.pcmcia ] ; then
        echoc "Setting up PCMCIA" red
        . /etc/rc.d/rc.pcmcia start
fi
# Initialize USB hotplugging:
if [ -x /etc/rc.d/rc.hotplug ]; then
        echoc "Starting USB hotplug service..." red
        sleep 2
        . /etc/rc.d/rc.hotplug start
fi

# Run serial port setup script:
# (CAREFUL! This can make some systems hang if the rc.serial script isn't
# set up correctly. If this happens, you may have to edit the file from a
# boot disk)
#
if [ -x /etc/rc.d/rc.serial ] ; then
        echoc "Setting up serial devices" red
        . /etc/rc.d/rc.serial
fi


# Initialize the NET subsystem.
if [ -x /etc/rc.d/rc.inet1 ] ;  then
        echoc "Setting up net subsystem" red
        . /etc/rc.d/rc.inet1
fi
if [ -x /etc/rc.d/rc.inet2 ]; then
        echoc "Setting up internal network........" red
        . /etc/rc.d/rc.inet2
fi
# Check quotas and then turn quota system on:
if [ -x /etc/rc.d/rc.quota ] ; then
        echoc "Setting up quota" red
        . /etc/rc.d/rc.quota
fi

# Check for a cdrom and mount it
if [ -x /etc/rc.d/rc.cdrom ] ; then
        echoc "Setting up CDROM" red
        . /etc/rc.d/rc.cdrom
fi



# Load a custom keymap and console font.

if [ -x /etc/rc.d/rc.keymap ] ; then
        echoc "Setting up characters devices: keyboard" red
        . /etc/rc.d/rc.keymap
fi

############添加这一项##########
echoc "starting samba..." red
. /etc/rc.d/rc.samba
##############################



# Start the Cups printer daemon for printing
if [ -x /etc/rc.d/rc.printer ]; then
        echoc "Starting the printer driver..." red
        . /etc/rc.d/rc.printer
fi

# Start the local setup procedure.
if [ -x /etc/rc.d/rc.local ] ; then
        echoc "Starting local setup" red
        . /etc/rc.d/rc.local
fi

# All done.


rc.M添加rc.samba后开机可以启动samba,命令 smbstatus显示:

Samba version 2.2.8a
Service      uid      gid      pid     machine
----------------------------------------------

No locked files
命令lpinfo -v还是没有显示smb一项。
命令:
lpadmin -p printer -v smb://server:server@printserver/hp6 -m laserjet.ppd -E
显示:
lpadmin: add-printer (set device) failed: client-error-not-possible
不知道什么原因。我在debian下没有这些问题。按照上述命令可以很容易地使用局域网的windows打印机。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表