大网数据广告活动
服务器运维问答

How can make changes to my smb.conf file go live without a reboot?

· 52CE 我爱测

On our Centos 7 server, I added create mask = 770 to my smb.conf in order to force permissions on the files our Windows users store in a directory. Then from the command line, I entered the following: # systemctl restart smb.serv…

问题原文

原帖链接 · Paris Finley · CC BY-SA 4.0

On our Centos 7 server, I added create mask = 770 to my smb.conf in order to force permissions on the files our Windows users store in a directory. Then from the command line, I entered the following:

# systemctl restart smb.service

# systemctl restart nmb.service

...but the files were not saved with the right permissions. They were saved correctly after a reboot. So what happened in the reboot that (maybe) I could have done from the command line?

Here's the section of the smb.conf:

[image-storage]
     comment = archived image location
     path = /our/samba/path/to/image_storage
     valid users = @NameOfOurGroup
     create mask = 770
     browsable = yes
     writable = yes
     guest ok = no
     force user = imagestore

社区高分解答

原帖链接 · Bill Huneke · CC BY-SA 4.0

Restarting just the service seems like an improvement on rebooting. Even better still is to make use of the config reload that comes with many linux services, including Samba. This feature is often accessed with a SIGHUP signal or via a control program.

Use smbcontrol (man page) to reload the config with the lowest downtime and lowest-possible impact on services already using your shares. So, just run this:

smbcontrol smbd reload-config

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2019-07-22)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。