[Bug 1583324] Re: Samba won't start when an include statement in smb.conf has a variable substitution

Andreas Hasenack andreas at canonical.com
Tue Jul 17 19:13:57 UTC 2018


This seems to be working in 4.3.11 that is in xenial:
root at xenial-samba-dynamic-include:~# testparm -s
Load smb config files from /etc/samba/smb.conf
rlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384)
WARNING: The "syslog" option is deprecated
Can't find include file /etc/samba/smb.conf.
Loaded services file OK.
WARNING: The 'netbios name' is too long (max. 15 chars).

Server role: ROLE_STANDALONE

# Global parameters
[global]
	server string = %h server (Samba, Ubuntu)
	server role = standalone server
	map to guest = Bad User
	obey pam restrictions = Yes
	pam password change = Yes
	passwd program = /usr/bin/passwd %u
	passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
	unix password sync = Yes
	syslog = 0
	log file = /var/log/samba/log.%m
	max log size = 1000
	dns proxy = No
	usershare allow guests = Yes
	panic action = /usr/share/samba/panic-action %d
	idmap config * : backend = tdb
	include = /etc/samba/smb.conf.
root at xenial-samba-dynamic-include:~# echo $?
0

Notice how it didn't expand %U, and the include file was /etc/samba/smb.conf. (ending dot). Restart works:
root at xenial-samba-dynamic-include:~# systemctl restart smbd nmbd
root at xenial-samba-dynamic-include:~# systemctl status smbd nmbd
● smbd.service - LSB: start Samba SMB/CIFS daemon (smbd)
   Loaded: loaded (/etc/init.d/smbd; bad; vendor preset: enabled)
   Active: active (running) since Tue 2018-07-17 19:12:51 UTC; 3s ago
     Docs: man:systemd-sysv-generator(8)
  Process: 2983 ExecStop=/etc/init.d/smbd stop (code=exited, status=0/SUCCESS)
  Process: 3012 ExecStart=/etc/init.d/smbd start (code=exited, status=0/SUCCESS)
    Tasks: 3
   Memory: 7.1M
      CPU: 127ms
   CGroup: /system.slice/smbd.service
           ├─3023 /usr/sbin/smbd -D
           ├─3024 /usr/sbin/smbd -D
           └─3026 /usr/sbin/smbd -D

Jul 17 19:12:51 xenial-samba-dynamic-include systemd[1]: Starting LSB: start Samba SMB/CIFS daemon (smbd)...
Jul 17 19:12:51 xenial-samba-dynamic-include smbd[3012]:  * Starting SMB/CIFS daemon smbd
Jul 17 19:12:51 xenial-samba-dynamic-include smbd[3012]:    ...done.
Jul 17 19:12:51 xenial-samba-dynamic-include systemd[1]: Started LSB: start Samba SMB/CIFS daemon (smbd).

● nmbd.service - LSB: start Samba NetBIOS nameserver (nmbd)
   Loaded: loaded (/etc/init.d/nmbd; bad; vendor preset: enabled)
   Active: active (running) since Tue 2018-07-17 19:12:51 UTC; 3s ago
     Docs: man:systemd-sysv-generator(8)
  Process: 2990 ExecStop=/etc/init.d/nmbd stop (code=exited, status=0/SUCCESS)
  Process: 2998 ExecStart=/etc/init.d/nmbd start (code=exited, status=0/SUCCESS)
    Tasks: 1
   Memory: 3.7M
      CPU: 127ms
   CGroup: /system.slice/nmbd.service
           └─3011 /usr/sbin/nmbd -D

Jul 17 19:12:51 xenial-samba-dynamic-include systemd[1]: Starting LSB: start Samba NetBIOS nameserver (nmbd)...
Jul 17 19:12:51 xenial-samba-dynamic-include nmbd[2998]:  * Starting NetBIOS name server nmbd
Jul 17 19:12:51 xenial-samba-dynamic-include nmbd[2998]:    ...done.
Jul 17 19:12:51 xenial-samba-dynamic-include systemd[1]: Started LSB: start Samba NetBIOS nameserver (nmbd).

Are you also seeing this behavior now?

** Changed in: samba (Ubuntu)
       Status: New => Incomplete

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to samba in Ubuntu.
https://bugs.launchpad.net/bugs/1583324

Title:
  Samba won't start when an include statement in smb.conf has a variable
  substitution

Status in samba package in Ubuntu:
  Incomplete

Bug description:
  Samba refuses to start when the smb.conf file contains an include line
  with a variable substitution like "include = /etc/samba/smb.conf.%U"

  According to the man page for smb.conf, all but a few specific
  variable substitutions should work.

  include (G)

             This allows you to include one config file inside another.
  The file is included literally, as though typed in place.

             It takes the standard substitutions, except %u, %P and %S.

             The parameter include = registry has a special meaning: It does not include a file named registry from the current working directory, but
             instead reads the global configuration options from the registry. See the section on registry-based configuration for details. Note that
             this option automatically activates registry shares.

             Default: include =

             Example: include = /usr/local/samba/lib/admin_smb.conf

  
  It is probably related to this bug in samba:
  https://bugzilla.samba.org/show_bug.cgi?id=10722

  Description:    Ubuntu 16.04 LTS
  Release:        16.04

  samba:
    Installed: 2:4.3.9+dfsg-0ubuntu0.16.04.1
    Candidate: 2:4.3.9+dfsg-0ubuntu0.16.04.1
    Version table:
   *** 2:4.3.9+dfsg-0ubuntu0.16.04.1 500
          500 http://us.archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages
          500 http://security.ubuntu.com/ubuntu xenial-security/main amd64 Packages
          100 /var/lib/dpkg/status
       2:4.3.8+dfsg-0ubuntu1 500
          500 http://us.archive.ubuntu.com/ubuntu xenial/main amd64 Packages

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/samba/+bug/1583324/+subscriptions



More information about the foundations-bugs mailing list