Software & AppsOperating SystemLinux

Solving Samba Timeout Issue with Systemd on Ubuntu 18.04

Ubuntu 21

In this article, we will delve into how to solve a common issue faced by many Ubuntu 18.04 users: the Samba timeout issue with systemd. Samba is an open-source software suite that provides seamless file and print services to SMB/CIFS clients. However, users often face a timeout issue when trying to start the Samba services using systemctl. This article will provide comprehensive solutions to this problem.

Quick Answer

To solve the Samba timeout issue with systemd on Ubuntu 18.04, you can try changing the Type in the systemd script, editing the smb.conf file, or deleting old systemd files. These solutions should help resolve the problem and get your Samba services running smoothly again.

Understanding the Issue

When you attempt to start Samba services such as nmb, smb, and winbind using systemctl, you might encounter an error message indicating that a timeout is being exceeded. This issue can occur due to various reasons, such as conflicting systemd files from a previous Samba installation or incorrect settings in the systemd script or smb.conf file.

Solution 1: Changing the Type in the systemd script

The first solution involves modifying the systemd script. The systemd script is responsible for defining how the Samba services are started, stopped, and managed.

  1. Open the smb.service file located at /lib/systemd/system/smb.service with a text editor. You can use the command sudo nano /lib/systemd/system/smb.service.
  2. In the file, locate the line that reads Type=notify. Change this to Type=simple.
  3. Save the file and exit the text editor.
  4. Run the command systemctl daemon-reload to reload the systemd manager configuration. This command will parse the configuration files again and reinitialize the system manager.
  5. Try starting the services again with systemctl start smb.service.

Solution 2: Editing the smb.conf file

The second solution involves editing the smb.conf file, which is the main configuration file for the Samba suite.

  1. Open the smb.conf file using a text editor. The command to do this is sudo vi /etc/samba/smb.conf.
  2. In the file, locate the lines that begin with interfaces and bind interfaces only. Comment out these lines by adding a hashtag (#) at the beginning of each line.
  3. Save the file and exit the text editor.
  4. Restart the nmbd service using the command sudo systemctl restart nmbd.
  5. Check the status of the service using systemctl status nmbd.service to ensure it is running.

Solution 3: Deleting old systemd files

If the above solutions do not resolve the issue, it is possible that there are conflicting systemd files from a previous installation of Samba. In this case, you may need to delete the old systemd files.

  1. Check the output of the command systemctl status smbd.service. If it mentions that the file is generated from /etc/init.d/smbd, this indicates the presence of old systemd files.
  2. Delete the old systemd files using the command sudo rm /etc/init.d/smbd.
  3. Restart the services.

In conclusion, the Samba timeout issue with systemd on Ubuntu 18.04 can be resolved by changing the Type in the systemd script, editing the smb.conf file, or deleting old systemd files. These solutions should help you get your Samba services up and running again. If you continue to face issues, consider seeking help from the Ubuntu community or the Samba mailing list.

What is Samba?

Samba is an open-source software suite that provides seamless file and print services to SMB/CIFS clients. It allows Linux servers to integrate with Windows-based systems and share files, printers, and other resources.

Why am I facing a timeout issue when starting Samba services on Ubuntu 18.04?

The timeout issue can occur due to various reasons, such as conflicting systemd files from a previous Samba installation or incorrect settings in the systemd script or smb.conf file.

How can I change the Type in the systemd script to resolve the Samba timeout issue?

To change the Type in the systemd script, open the smb.service file located at /lib/systemd/system/smb.service with a text editor. Locate the line that reads Type=notify and change it to Type=simple. Save the file, reload the systemd manager configuration using systemctl daemon-reload, and then try starting the services again with systemctl start smb.service.

What should I do if editing the smb.conf file doesn’t solve the timeout issue?

If editing the smb.conf file doesn’t resolve the issue, you can try deleting old systemd files. Check the output of systemctl status smbd.service to see if it mentions that the file is generated from /etc/init.d/smbd. If so, delete the old systemd files using sudo rm /etc/init.d/smbd and then restart the services.

Where can I seek further help if I continue to face issues with Samba on Ubuntu 18.04?

If you continue to face issues, you can seek help from the Ubuntu community at askubuntu.com or the Samba mailing list at lists.samba.org/mailman/listinfo/samba.

Leave a Comment

Your email address will not be published. Required fields are marked *