Description of problem: I try to add a share and it says: Cannot write to /etc/samba/smb.conf Program will now exit Version-Release number of selected component (if applicable): From 'About box': Samba Server Configuration Tool 1.2.20 How reproducible: Every time I have tried over the last couple of days. Steps to Reproduce: 1. Gnome->System Settings->Server Settings->Samba 2. insert root password when asked 3. Add a share - browse to a directory 4. Allow access to everyone (..) 5. Click on OK 6. Read dismal Warning box 'Cannot write to /etc/samba/smb.conf.. Actual results: see above Expected results: I should see the appropriate changes written into smb.conf Additional info: [root@hoho2 samba]# pwd /etc/samba [root@hoho2 samba]# ls -l total 24 -rw-r--r-- 1 root root 20 Oct 13 16:30 lmhosts -rw-r--r-- 1 root root 10836 Oct 14 21:46 smb.conf -rw-r--r-- 1 root root 97 Oct 13 16:30 smbusers [root@hoho2 samba]#
Can you please run system-config-samba from the command line? It should spit ot a python traceback, please copy it here.
[user1@hoho2 ~]$ su Password: [root@hoho2 user1]# system-config-samba Traceback (most recent call last): File "/usr/share/system-config-samba/system-config-samba.py", line 41, in ? mainWindow.MainWindow(debug_flag) File "/usr/share/system-config-samba/mainWindow.py", line 75, in __init__ self.samba_data = sambaParser.SambaParser(self) File "/usr/share/system-config-samba/sambaParser.py", line 40, in __init__ self.parseFile() File "/usr/share/system-config-samba/sambaParser.py", line 74, in parseFile token = self.createToken(line) File "/usr/share/system-config-samba/sambaParser.py", line 146, in createToken token = sambaToken.SambaToken(sambaToken.SambaToken.SAMBA_TOKEN_KEYVAL, (name, value), self.parent) File "/usr/share/system-config-samba/sambaToken.py", line 36, in __init__ raise AttributeError, value AttributeError: ('readonly', 'yes') [root@hoho2 user1]#
This indicates a wrong option in your /etc/smb.conf. According the the smb.conf(5) man page it is "read only", not "readonly" -- could you check your /etc/smb.conf please?
# From http://www.poulpetersen.dk/linux/uklinshr.htm # cdrom setup [cdrom] comment = Samba Server CDROM browseable = yes writeable = no readonly = yes printable = no public = yes only guest = no path = /mnt/cdrom Changing the readonly to 'read only' gives much better results. Before it was a blank dialog box. Now there are a few lines showing shares, etc. (Including the cdrom drive..) Thanks much for the pointer. (maybe smb.conf parse errors should show in the dialog box?)
Works for me
Reopening this under a slightly different title ;-).
Hmm, I am still getting the dialog box Cannot write to /etc/samba/smb.conf Program will now exit. I open a 'preferences' dialog and get the above message when I exit, no matter whether I change anything or not. Running from the command line, this is what I get: [root@hoho2 samba]# system-config-samba /usr/share/system-config-samba/mainWindow.py:113: DeprecationWarning: use gtk.UIManager item_fac = gtk.ItemFactory(gtk.MenuBar, "<main>", accel_group) /usr/share/system-config-samba/mainWindow.py:138: DeprecationWarning: button = self.toolbar.insert_stock('gtk-add', _("Add a samba share"), None, self.onNewButtonClicked, None, 0) /usr/share/system-config-samba/mainWindow.py:143: DeprecationWarning: self.properties_button = self.toolbar.insert_stock('gtk-properties', _("Edit the properties of the selected directory"), None, self.onPropertiesButtonClicked, None, 1) /usr/share/system-config-samba/mainWindow.py:148: DeprecationWarning: self.delete_button = self.toolbar.insert_stock('gtk-delete', _("Delete the selected directory"), None, self.onDeleteButtonClicked, None, 2) /usr/share/system-config-samba/mainWindow.py:153: DeprecationWarning: self.toolbar.insert_stock('gtk-help', _("View help"), None, self.onHelpClicked, None, 3) Traceback (most recent call last): File "/usr/share/system-config-samba/shareWindow.py", line 537, in onOkEditButtonClicked self.samba_data.writeFile() File "/usr/share/system-config-samba/sambaParser.py", line 173, in writeFile raise RuntimeError, (_("Cannot write to %s. Program will now exit." % path)) RuntimeError: Cannot write to /etc/samba/smb.conf. Program will now exit. [root@hoho2 samba]#
Ahh I got the culprit now, changed title back.
Should be fixed in 1.2.21-1. Grab them from http://people.redhat.com/nphilipp/BETA/system-config-samba/ until they hit the mirrors.
Seems to work I did rpm -i system..src.rpm rpm -i system..noarch.rpm cd /usr/src/redhat/SPECS rpmbuild -bi system..src.rpm 2>&1 system-config.out And then added a 'share' and then deleted it. Seemed to work OK. Thanks much Works for me
You shouldn't have needed to rebuild the source RPM ;-), but anyway good to hear that it works.