oooo1 at front.ru
2012-May-28 16:17 UTC
[Samba] Samba4 alpha >20 version: Samba & smbd daemons !
In Samba4 alpha 21 and 22 Smbd daemon has to be run except Samba daemon to get access to your shared NetBios resources (folders) .That is in case of alpha versions after 20, Samba daemon starts in its own smbd daemon automatically and with with some parameters such as --configfile and --foreground (but without -D parametr that is not as daemon) .After Samba is started there are 2 processes: Samba & smbd.1. So, after killing of Samba process samba doesn' t delete samba.pid & smb-fileserver.conf.pid, is it riht behaivour of its daemons ?As I remembered nmbd daemon does - it deletes nmbd.pid file.Does Samba daemon have to delete its pid file and pid files of all other processes started by it, in particular smbd process or not ? 2. When Samba are not run and smbd hsa been started without Samba daemon, there 2 processes in memory, but smbd only, not Samba & smbd.And these processes can not be killed by killall command, can be killed by kill -9 # pid only. But after that if start Samba normally (Samba and smbd are started) users can' t get access to NetBios resources before full server reboot and there are messages such as this address are already in use for port 139, this address are already in use for port 445 in log file after restart Samba daemon after ru of kill -9 #pid. Th same situation if Samba starts not correctly and smbd couldn' t be started with Samba and it needs to start smbd manually. I have got this situation too, but at the time couldn' t investigate why it is so.May be to make impossible to start smbd daemon without Samba daemon or make possible to correctly unload its process. In Samba4 alpha up to 20 version Samba daemon served as authorization as AD services as file access - all in one and it didn' t need to run smbd and smbd wasn' t started, smbd wasn' t in memory at all.
Andrew Bartlett
2012-May-28 22:51 UTC
[Samba] Samba4 alpha >20 version: Samba & smbd daemons !
On Mon, 2012-05-28 at 20:17 +0400, oooo1 at front.ru wrote:> In Samba4 alpha 21 and 22 Smbd daemon has to be run except Samba > daemon to get access to your shared NetBios resources (folders) .That > is in case of alpha versions after 20, Samba daemon starts in its own > smbd daemon automatically and with with some parameters such as > --configfile and --foreground (but without -D parametr that is not as > daemon) .After Samba is started there are 2 processes: Samba & smbd.1. > So, after killing of Samba process samba doesn' t delete samba.pid & > smb-fileserver.conf.pid, is it riht behaivour of its daemons ?As I > remembered nmbd daemon does - it deletes nmbd.pid file.Does Samba > daemon have to delete its pid file and pid files of all other > processes started by it, in particular smbd process or not ?It certainly should, or if not, a new startup of the internally-managed smbd should override it, noticing that the previous smbd is no longer there.> 2. When Samba are not run and smbd hsa been started without Samba > daemon, there 2 processes in memory, but smbd only, not Samba & > smbd.And these processes can not be killed by killall command, can be > killed by kill -9 # pid only.I wonder why that is. If you get them under gdb (gdb -p <pid>) where are they stuck?> But after that if start Samba normally (Samba and smbd are started) > users can' t get access to NetBios resources before full server reboot > and there are messages such as this address are already in use for > port 139, this address are already in use for port 445 in log file > after restart Samba daemon after ru of kill -9 #pid. Th same situation > if Samba starts not correctly and smbd couldn' t be started with Samba > and it needs to start smbd manually.You should never need to start smbd manually - it should always be managed within the 'samba' process.> I have got this situation too, but at the time couldn' t investigate > why it is so.May be to make impossible to start smbd daemon without > Samba daemon or make possible to correctly unload its process.Certainly I'm thinking we should fail to start when we cannot bind to our key ports. I'll work on a patch to do that - move the bind of port 139 and 445 into 'samba', and have it then terminate the whole server if it cannot start up. Making 'smbd' fail to start on it's own will be trickier, but may also be required.> In Samba4 alpha up to 20 version Samba daemon served as authorization > as AD services as file access - all in one and it didn' t need to run > smbd and smbd wasn' t started, smbd wasn' t in memory at all.The 's3fs' project is responsible for these issues, and I've seen some of them before, but as they are making life painful for our users, I'll give them a new priority. See https://wiki.samba.org/index.php/Samba4/s3fs for what we are trying to do and why. Andrew Bartlett -- Andrew Bartlett http://samba.org/~abartlet/ Authentication Developer, Samba Team http://samba.org
oooo1 at front.ru
2012-May-30 08:39 UTC
[Samba] Samba4 alpha >20 version: Samba & smbd daemons !
Firstly, I have forgotten to say that it all would be under Ubuntu 12.04 TLS. I didn' t test or run it under other OSes. I have found out one point of these issue. For example Samba and smbd daemons have started normally (by Samba daemon run only) . Then in some circumstances smbd either falls out (I haven't investigated yet why) or I stop it normally but as I wrote earlier all pid files have not be deleted. And at the next time I try to start Samba daemon, it is started but smbd fails, because of existing smbd-fileserver.conf.pid file (there is message that so pid file exists in smbd log) . Regarding kill -9, I run ps ajx | grep smbd and get process ID. Then I use kill -9 got procID . About Gdb, I haven' t use it yet. I offer to make error messages when user trys to start smbd daemon in alone or without Samba started that is in 1 case: Samba is not started, user runs smbd - error "you can not to do so" or something else; Samba is startded, user runs smbd - handling of this situation is up to yuo as developer. It is some fool protection. And talking about pid files, I offer to add its deletion function to appopriative daemons (during unloading Samba daemon - samba daemon deletes its pid file, during unloading smbd daemon by Samba daemon - smbd deletes its pid file) . And how can I make to you as R&D person and your R&D team some donations ? Not much, but about $200. In Samba4 alpha 21 and 22 Smbd daemon has to be run except Samba daemon to get access to your shared NetBios resources (folders) .That is in case of alpha versions after 20, Samba daemon starts in its own smbd daemon automatically and with with some parameters such as --configfile and --foreground (but without -D parametr that is not as daemon) .After Samba is started there are 2 processes: Samba & smbd.1. So, after killing of Samba process samba doesn' t delete samba.pid & smb-fileserver.conf.pid, is it riht behaivour of its daemons ?As I remembered nmbd daemon does - it deletes nmbd.pid file.Does Samba daemon have to delete its pid file and pid files of all other processes started by it, in particular smbd process or not ? 2. When Samba are not run and smbd hsa been started without Samba daemon, there 2 processes in memory, but smbd only, not Samba & smbd.And these processes can not be killed by killall command, can be killed by kill -9 # pid only. But after that if start Samba normally (Samba and smbd are started) users can' t get access to NetBios resources before full server reboot and there are messages such as this address are already in use for port 139, this address are already in use for port 445 in log file after restart Samba daemon after ru of kill -9 #pid. Th same situation if Samba starts not correctly and smbd couldn' t be started with Samba and it needs to start smbd manually. I have got this situation too, but at the time couldn' t investigate why it is so.May be to make impossible to start smbd daemon without Samba daemon or make possible to correctly unload its process. In Samba4 alpha up to 20 version Samba daemon served as authorization as AD services as file access - all in one and it didn' t need to run smbd and smbd wasn' t started, smbd wasn' t in memory at all. null