手机版
你好,游客 登录 注册 搜索
背景:
阅读新闻

Fedora 16 安装 Samba 3.6

[日期:2012-03-11] 来源:Linux社区  作者:icanoncn [字体:大 中 小]

而在 /lib/systemd/system/ 文件夹里有一个 smbd.service 和一个 nmbd.service 文件,

于是果断 vi 看了一下: 

smbd.service:

[Unit]

Description=Samba SMB Daemon

After=syslog.target network.target

 

[Service]

Type=forking

PIDFile=/run/smbd.pid

LimitNOFILE=16384

EnvironmentFile=-/etc/sysconfig/samba

ExecStart=/usr/sbin/smbd $SMBDOPTIONS

 

[Install]

WantedBy=multi-user.target


nmbd.service:

[Unit]

Description=Samba NMB Daemon

After=syslog.target network.target

 

[Service]

Type=forking

PIDFile=/run/nmbd.pid

EnvironmentFile=-/etc/sysconfig/samba

ExecStart=/usr/sbin/nmbd $NMBDOPTIONS

 

[Install]

WantedBy=multi-user.target


注:以下蓝色部分似乎不太正确

我还知道 smb 的两个命令 就是 /usr/sbin/smbd 与 /usr/sbin/nmbd

于是我尝试建立个符号链接到 cd /lib/systemd/system/runlevel5.target.wants

#ln -s /lib/systemd/system/smbd.service  /lib/systemd/system/runlevel5.target.wants/smbd.service

#ln -s /lib/systemd/system/nmbd.service  /lib/systemd/system/runlevel5.target.wants/nmbd.service

也可以将符号链接放到  /etc/systemd/system/grafical.target.wants 或者放到  /etc/systemd/system/default.grafical.target.wants

这两个文件夹的区别我还没有弄懂……

重启一下,果然启动samba;


用 systemctl enable 命令 即可

------------------------------ 

# systemctl is-enabled smb.service

 屏幕显示:disabled

# systemctl enable smb.service

 屏幕显示:ln -s '/lib/systemd/system/smb.service' '/etc/systemd/system/multi-user.target.wants/smb.service'

 # systemctl is-enabled smb.service

屏幕显示: enabled

------------------------------

# systemctl is-enabled nmb.service

 屏幕显示:disabled

# systemctl enable nmb.service

 屏幕显示:ln -s '/lib/systemd/system/nmb.service' '/etc/systemd/system/multi-user.target.wants/nmb.service'

 # systemctl is-enabled nmb.service

屏幕显示: enabled 

 ------------------------------ 

linux
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款