Loading ...
Sorry, an error occurred while loading the content.

Re: [nslu2-general] Unslung 5.5 symbolic link to smb.conf not working rc.samba?

Expand Messages
  • Robert Hammond
    In message , Robert Hammond writes ... Many apologies, I knew it would line wrap so have re-posted
    Message 1 of 4 , Aug 2, 2005
    • 0 Attachment
      In message <PO1z+tB$e67CFwKv@...>, Robert Hammond
      <rob.hammond@...> writes
      >In message <dclstm+ma4v@...>, paulthego <p.spam@...>
      >writes
      >>Hi
      >>
      >>I have followed the instructions here http://www.nslu2-
      >>linux.org/wiki/HowTo/AttachAFAT32FormattedDrive to attach a FAT32
      >>drive and have nearly got it working the problem I am having is that
      >>my rc.samba which contains
      >>
      >>#!/bin/sh
      >>rm -f /etc/samba/smb.conf
      >>ln -s /opt/etc/smb.conf /etc/samba/smb.conf
      >>return 1
      >>
      >>does not seem to delete the smb.conf out of /etc/samba and I end up
      >>with 2 files named smb.conf in /etc/samba. I cannot get the symbolic
      >>link to work from within the file. If I delete /etc/samba/smb.* and
      >>then manually type the ln command from above and then issue
      >>a /etc/rc.d/rc.samba everything works.
      >>
      >>Has anyone else seen this or can tell me where I've gone wrong?
      >>
      >There is no actual need to use the symbolic link method, my personal
      >opinion is that deleting any system file is bad practice and not needed.
      >You can directly change the smb.conf file using an rc.samba diversion
      >script without deleting any files. The relevant part of my script is
      >below (it may line wrap in this mail message), stored in
      >/unslung/rc.samba:-
      >
      >#! /bin/sh
      ># Diversion script: to modify the Samba smb.conf file
      >#
      ># First, make a backup copy of /etc/samba/smb.conf
      >if [ ! -e /etc/samba/smb.conf.orig ]; then
      >cp -p /etc/samba/smb.conf /etc/samba/smb.conf.orig
      >fi
      >#
      ># Script section for FAT32 Support
      >#
      ># If there is no [FAT32HDD] section then append to end of file
      >if ( !(grep "\[FAT32HDD\]" /etc/samba/smb.conf -q) ) then
      >cat << EOF >> /etc/samba/smb.conf
      >[FAT32HDD]
      >valid users=@"administrators",@"everyone"
      >comment=FAT32 Partition
      >path=/share/hddvfat/
      >public=yes
      >read only=no
      >write list=@"administrators",@"everyone"
      >
      >EOF
      >fi
      >#
      ># End of FAT32 script section
      >#
      ># Continue to start samba
      >#
      >return 1
      ># EOF
      >
      Many apologies, I knew it would line wrap so have re-posted the two
      sections below.

      if [ ! -e /etc/samba/smb.conf.orig ]; then
      cp -p /etc/samba/smb.conf /etc/samba/smb.conf.orig
      fi

      if ( !(grep "\[FAT32HDD\]" /etc/samba/smb.conf -q) ) then
      cat << EOF >> /etc/samba/smb.conf
      [FAT32HDD]
      valid users=@"administrators",@"everyone"
      comment=FAT32 Partition
      path=/share/hddvfat/
      public=yes
      read only=no
      write list=@"administrators",@"everyone"

      EOF
      fi


      --
      Robert Hammond
      PGP:0x154144DA
    • paulthego
      Thanks for the help / tips. I have discovered a bigger problem and that is my rootfs is not on my Hard disk but still in flash so I am going to start again
      Message 2 of 4 , Aug 2, 2005
      • 0 Attachment
        Thanks for the help / tips.

        I have discovered a bigger problem and that is my rootfs is not on my
        Hard disk but still in flash so I am going to start again from scratch.
        Hopefully I will get to the same point.
      Your message has been successfully submitted and would be delivered to recipients shortly.