[Samba] Listing samba 2.2.8a (redhat 8) verables to a text file
Peter Atkin
peter at computer-facilities.com
Tue Jul 1 15:15:08 GMT 2003
Thanks I have it all working now, I have noticed some querks that you may be intersted in.
When I have "root preexec //" in a single line upto and including the "smbclient -U %L -M %m
</tmp/samba-smbinfo;\" it works fine but when I split the line just before this comment I
get a% in the final output reading Win2K instead of WinXP(which is the correct answer) I
have tested this severial times.. strange but true.
Look below for answers/comments to your questions.
-----Original Message-----
From: "Thomas Bork" <tombork at web.de>
To: <peter at computer-facilities.com>
Cc: <samba at lists.samba.org>
Date: Mon, 30 Jun 2003 21:39:16 +0200
Subject: Re: [Samba] Listing samba 2.2.8a (redhat 8) verables to a text file
> Hi Peter Atkin,
>
> you wrote:
>
> > Thanks for the update, I had to do a little modification to your very
> > good one liner.. I had problems getting consistent results, I found
> > out running the "preexec" as "root" seemed to solve that.
>
> you are right.
> In my case the special smb.conf entry only will be created, if the
> loglevel is >= 3 and smb.conf will be completely written via a shell
> script from an config file.
> Only root users can change the config file and create a new smb.conf
> via
> the script. This is only meant for debugging purposes from root users
> and thats why root preexec is not needed in my case.
> www.eisfair.org uses a special configuration concept - if you are able
> to read german, here ist a link to the documentation:
>
> http://www.devone.org/eisfair/doc/
Unfortunely I cannot read German currently, but i am very intersted in this.
>
> > I am very new to Linux and have major difficulty with user and
> > directory rights, so i just did a work around.
>
> I'm also not an expert and working mostly under Windows ;)
>
> > This works very well so far, under both 2000 and XP, the "root
> > preexec" is all on one line. their are still some querks like when
> > this gets run via Terminal Services it does not display. but when a
> > simple e.g.:
> >
> > [source]
> > browseable = yes
> > path = /mnt/nas/source
> > valid users = @admin
> > read only = yes
> > write list = @admin, root
> > force create mode = 0775
> > force group = admin
> > directory mask = 0775
> > preexec = smbclient -U %L -M %m
> > </etc/samba/messages/source.txt
> >
> > Works well even under Terminal Services.
>
> And /etc/samba/messages/source.txt holds the information from smbinfo?
>
Yes this is a text file that I used to check to see if it works. "Just says Hi.."
> [...]
> > echo "$message" >> /etc/samba/scripts/smbinfo
> > cp -f /etc/samba/scripts/smbinfo /mnt/nas/users/peter
> >
> > **** I have one question how can i direct the output of samba-smbinfo
> > to say a home account of a user.
> > e.g "/mnt/nas/users/%U" it seems when i do its i get "%U" as a file
> > name.
>
> You could move or copy the info to /mnt/nas/users/%U simply via
> smb.conf:
>
> root preexec = echo "\"T %T \" [...] \"a %a \"" | xargs -n1
> /usr/local/bin/samba-smbinfo;\
> smbclient -U "eisfair Samba Server" -M %m
> </tmp/samba-smbinfo;\
> cp -f /etc/samba/scripts/smbinfo /mnt/nas/users/%U;\
> rm -f /etc/samba/scripts/smbinfo &
>
Sorry I am a DIV, i was too wrapped up in the "root preexec = echo" sfuff and promtly forgot
all about samba its self.
> > Sorry for the long e-mail, and again thanks.
>
> You are welcome :)
>
> der tom
again thank you, i'm all sorted and a happy samba person.
Kind Regards
Peter
More information about the samba
mailing list