What script is used to start services during boot?
First of all, let me explain the exact issue that I am trying to resolve with this posting:
Recently, I switched over to Fedora 19 64-bit from Ubuntu. I use Samba for my LAN networking. After I installed Samba 4 on Fedora, I found that (with the appropriate modifications to the /etc/samba/smb.conf file) that the smb service was already running by default. I never needed to add the smb service startup to any of the Fedora boot scripts myself. However, the nmb service is NOT running by default, and I do not know where the smb service WAS started (so that I might add the nmb service startup along side of it...). Answers I have received in my attempts to find out where the Fedora services are started during system boot always seem to involve some older version of Fedora (that is, none of the advice seems to use the form:
"systemctl start smb.service"
as is the form currently in use by Fedora!).
I know that to start the nmb service, you use:
"systemctl start nmb.service"
, but I need to know WHERE to place this command in order to automate this, in the same way that the smb service is started!
Please, could someone simply point me to what file(s) are involved in the starting of services on the NEWER Fedora releases? Or, even better, where exactly I might find out specific information on the way Fedora currently boots in general (that is, a "walk-through" of the exact boot sequence Fedora 19 uses?).
All of the advice I have come across so far seems to involve the "rc.local" script or something of that sort, and I am pretty sure that this is NOT the way Fedora is currently being booted (although I am not even entirely sure on THAT point, either...). I just can't locate any script files that contain lines of the form "systemctl start [some.service]", and I am in no way skilled at using Bash to go searching for all files containing such lines, either!
I have urgent need to get this Fedora machine on-line with the rest of my LAN, and it seems like I am looking for the proverbial "needle in a haystack" due to the many changes which Fedora has gone through in recent years...(I kinda long for those old "rc3.d", "init.d", "rc.local" script days!). They just don't seem to be used by Fedora in its present incarnations...; or am I wrong in this? I find many comments within these old-style script files stating that they are not used in this way presently, and I find NO "rc.local" file within my Fedora 19 installation at all! So suggestions of the type that utilize those script files are of no help!
Just a point in the right direction (eg. the title of a guide, and the specific chapter(s)within that guide dealing with the issue I have described above) will suffice!
Thanks in advance..
Fedora 15 replace the old init scripts with systemd. This means you no longer have to type a hard to remember command like
Yep, just a little research on Systemd gave me just what I required!
A bit of confusion still exists on my part, though! I was able to access my workgroup from my Fedora 19 machine right after installing Samba 4 and setting up the smb.conf file correctly, but I was unable to access my Fedora-based pc from any other pc on the LAN (thus, I ascertained that nmb was not being started at bootup...). However, when I issued the command:
->sudo systemctl list-unit-files
I was informed by the generated output that NEITHER smb OR nmb was currently enabled!? Now, how does Samba work without its smb daemon enabled / running? It was because I was able to access my workgroup using Samba that I assumed the smb daemon was somehow being started, while the nmb daemon was being ignored. Also, when I then issued the command:
the smbd process was NOT among the listed processes! I have always been able to find BOTH the smbd and nmbd daemons among the running processes when I have issued this command on other Linux distros in the past...
Now, I have enabled both smb and nmb with the following commands:
->sudo systemctl enable smb.service
->sudo systemctl enable nmb.service
and both smb and nmb are running after a fresh boot. Problem solved!
But still, I am confused; when I issued the command:
BEFORE I had enabled either smb or nmb, NEITHER service was listed as a running process! It seems that I had a Samba server operational without its smb daemon running! What was actually going on there? Anybody out there know what I am talking about? How was I able to access my Windows workgroup after installing Samba 4, but having never issued the command to start up the smb daemon? If (as I have to assume) the smb daemon WAS being started at boot up, then why was its process not listed with the ps command?
Of course, I checked the output of the ps command AFTER enabling both smb and nmb services and rebooting, and there once more were the processes for smbd and nmbd (no surprise there!).
Anyways, thanks again for pointing me to Systemd, smallpond! I really appreciate the info...
There are actually two parts to samba i.e the server and the client which are independent of each other. The server is nmbd and smbd allows windows PC to access linux shares and printers. I assume you were using nautilus which has a SMB client built in so it can browse windows shares. You can mount windows shares via cifs or access them via the command line tool smbclient.
That explains the mystery!
You have provided the answer to a mystery I couldn't figure out! While I am NOT using Nautilus, I AM using my favorite file manager, Konqueror, which I must then assume also has a "built-in" smb client as well? So, whenever I saw the smbd daemon process running on my other Linux distros, it may not have been necessary, because the file manager cum browser has a built-in smb client! Only the nmbd process was actually doing me any real good (am I right so far?)!
So all I needed to do in my case (because I always run Konqueror as my Linux file manager) was start the nmb service, and all would have been fine! Well what do ya know about that; you really do learn something knew every day! I had always assumed that, when I saw the smbd daemon process running, it was actually necessary for Samba to operate as an smb client! So, when I could NOT find that process running on Fedora 19, I could not for the life of me understand how I was able to connect to my workgroup and its servers! I thought I NEEDED smbd to be running for Samba to work for me!
Excellent! Thanks again!
Might I provide a little insight on my confusion about how Linux + Samba works as a whole?
I started using Slackware 13.37 as my first distro, and watched the boot sequence output with great interest, because I was fascinated by exactly how much was being done during the sequence! During the bootup of Slackware, I always paid close attention to when and where Samba was started, and what was being done by the init script. Moreover, I noticed that first the smbd daemon was started, followed immediately by the nmbd daemon. Now, knowing that those two processes were actually the working processes of Samba, I just always assumed after that that BOTH were always required in order to have Samba operational!
That was why I could not figure out where the smbd daemon was being started on Fedora (I assumed it MUST have been, but in what script?); then, when the smbd process was not even shown as running when I used the ps command, I was really confused!
Not only that, but I knew I needed to start up the nmb service, and did not know where to do this, as of course there was NO matching location where smb was being started (as was the case on Slackware, as I have already explained...)!
So, on the one hand, I have now learned how to start a service with Systemd, and on the other I now know that, while smbd CAN be running without harm, it isn't necessary as long as you are using a file manager that has built-in smb client support! Super!
Thanks again to all responders! I really love LQ!!!
|All times are GMT -5. The time now is 02:03 AM.|