ランレベルにSMBサービスを追加するには?

ランレベルにSMBサービスを追加するには?

システムからsmbを起動したいです。 etc/rc.d/rc6.d/にsmbを起動するスクリプトを入れる必要がありますか、それとも後で自動起動サービスに表示されるようにする方法はありますか#chkconfig smb on?問題が規定通りに実行されると、 #chkconfig smbd onシステムを何度も起動するのに役立ち、最終的にSambaデーモンが再び停止するのはなぜですか?

# chkconfig --list

Note: This output shows SysV services only and does not include native
      systemd services. SysV configuration data might be overridden by native
      systemd configuration.

dund            0:off   1:off   2:off   3:off   4:off   5:off   6:off
livesys         0:off   1:off   2:off   3:on    4:on    5:on    6:off
livesys-late    0:off   1:off   2:off   3:on    4:on    5:on    6:off
netconsole      0:off   1:off   2:off   3:off   4:off   5:off   6:off
network         0:off   1:off   2:off   3:off   4:off   5:off   6:off
pand            0:off   1:off   2:off   3:off   4:off   5:off   6:off
rfcomm          0:off   1:off   2:off   3:off   4:off   5:off   6:off
spice-vdagentd  0:off   1:off   2:off   3:off   4:off   5:on    6:off 

#systemctl restart smb.servicechkconfig --level 5 smb onにもかかわらず、この出力は変更されません。 Sambaが機能するようにするには、端末ですべての起動を実行する必要があります。場合によっては、次のような奇妙な出力が表示されます。

# ps aux |grep smb
root       859  0.0  0.1  25328  3184 ?        Ss   15:18   0:00 /usr/sbin/smbd
root       863  0.0  0.0  25844  1244 ?        S    15:18   0:00 /usr/sbin/smbd

Samba 共有が機能しない場合、または Samba を手動で再起動すると、このメッセージが表示されます。

# ps aux |grep smb
root      1729  0.0  0.1  25328  3184 ?        Ss   15:26   0:00 /usr/sbin/smbd
root      1731  0.0  0.0  25844  1244 ?        S    15:26   0:00 /usr/sbin/smbd
nobody    1732  0.0  0.1  25632  3072 ?        S    15:27   0:00 /usr/sbin/smbd

このトピックに関する追加情報

#systemctl list-unit-files --type=service |grep smb
smb.service                                 enabled 
# systemctl list-unit-files --type=service |grep avahi
avahi-daemon.service                        enabled 
# systemctl list-unit-files --type=service |grep nmb
nmb.service                                 enabled
#chkconfig --version
chkconfig version 1.3.59

再起動するたびに、Sambaデーモンの起動コマンドを手動で入力しないように、~ / Desktopにlxde fedora環境用のデスクトップランチャーを作成しました。

[Desktop Entry]
Encoding=UTF-8
Type=Application
Name=mc
Name[en_US]=setsmb
Icon=share_32
Exec=/usr/bin/lxterminal -e "su root -c 'systemctl restart smb.service && systemctl restart nmb.service'"

ベストアンサー1

すべてのランレベルで自動的に開始されるSambaサービスを一覧表示するには、「chkconfig」コマンドを使用します。

[root@localhost ~]# chkconfig --list smb

次の「chkconfig」コマンドを使用すると、Sambaサーバーがランレベル5で起動することがあります。

[root@localhost ~]# chkconfig --level 5 smb on

構成の変更を確認します。

[root@localhost ~]# chkconfig --list smb

おすすめ記事