Hi Ash,
you started the HBNETIO server as root, so files created by it have only write access for root himself, all others ( group/ world ) only can read ..
[ r-ead w-rite e-x-ecute, in the order: owner group world ]
-rw-rw-rw or -rw-rw--- should be fine for data files, == 666 == umask 111 ?
IMHO not recommended as root, better to start HBNETIO as an user -- but that only won't solve the problem.
So you have to search for CentOS how to:
# auto-login an default user and let him start automatic at least one task: the HBNETIO server
# how to modify the 'default umask' for this user
here a first hint:
http://daddy-linux.blogspot.de/2012/02/how-to-setup-default-umask-under-linux.html
where this /etc/bashrc is guilty for ALL users, so better try the other file
best regards
Rolf
--
--
You received this message because you are subscribed to the Google
Groups "Harbour Users" group.
Unsubscribe: harbour-user...@googlegroups.com
Web: http://groups.google.com/group/harbour-users
---
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to harbour-user...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
su -s /bin/sh -c "start_leto.sh my_args" harbourplease note that start_leto.sh must be able to detach, I mean, it must exit and the leto server must be running as daemon (I didn't see the script).IF !PVDC_File( filePath + "\ar.cdx" )
CASE currSrvrType = 'N'
RETURN dbExists( AtRepl( "\", cFilename, "/" ) )
content of filepath for netio ?
is there a "net:" at start ?, else search will be local ..
RELATIVE path to HBNETIO server root directory, e.g.:
hb_dbexists( "net:ar.cdx")
and astonishing a: hb_dbexists( "net:/ar.cdx") seem also work ..
regards
Rolf
Changed to mainPath and every thing works. And, hbnetio is no longer started by root.
mainPath := "net:\" // -rootdir
filePath := ".\"
su -s /bin/sh -c "/data/accounts/comp/hbnetio -iface=nnn.nnn.nnn.nnn -rootdir=/data/accounts/comp/ -rpc &" nobody
addendum, checked for own interest:
an '/' will be internally added, if the given root directory for HBNETIO server end *not* with a path seperator, e.g. "/" for Linux -- so your first version was totally correct.
Can you please check if it correctly handles locks when using share and letodb on the same DB?
Maybe this help:
Share_Tables = 0 - if 0 (default, this mode server was the only from the
start of a letodb project), the letodb opens all
tables in an exclusive mode, what allows to increase
the speed. If 1 (new mode, added since June 11, 2009),
tables are opened in the same mode as client
applications opens them, exclusive or shared, what
allows the letodb to work in coexistence with other
types of applications.
--
Share_Tables = 0 - if 0 (default, this mode server was the only from the
--
My application is a multiuser one and record locking part works as expected for Samba, NetIO and LetoDB.
I have no such cases, but I can try if you want. In fact, I prefer that LetoDB have exclusive access to database.
Regards, NB
From: harbou...@googlegroups.com [mailto:harbou...@googlegroups.com] On Behalf Of elch
Sent: Monday, February 10, 2014 8:51 PM
To: harbou...@googlegroups.com
Subject: Re: [harbour-users] Re: Conversion of an application from Clipper to Harbour + NetIO
Hi Nenad,
--
I just tried locks it and it works quite normally. I tried two "leto" applications, and a combination of Leto + DBFNTX App. Apps open table as:
USE Test NEW SHARED
And then:
FLock()
Everything is functioning normally.
Regards, NB
From: harbou...@googlegroups.com [mailto:harbou...@googlegroups.com] On Behalf Of Ash
Sent: Wednesday, February 12, 2014 3:12 PM
To: harbou...@googlegroups.com
Subject: Re: [harbour-users] Re: Conversion of an application from Clipper to Harbour + NetIO
I have just found that LetoDB does not respect file locks even between two instances of letodb based application. My testing is based on USE ... EXCLUSIVE commands.
--
Yes, I've tried. Other programs can not open the table (USE command reports an error).
Function Main()
REQUEST LETO
RDDSETDEFAULT( "LETO" )USE ("//192.168.0.200:2812/compk/ar") EXCLUSIVE
please, where is the check for NETERR() ??, as USE or DBUSEAREA() ever can fail, as it just did ...
browse()
Hi,
something real scary:
# Share_Tables = 1
( but this doesn't matter, happens also with '= 0' )
# DBFNTX default for LetoDB
# using multiple index keys per DBF
--
The first instance of my app runs fine, all as expected.
When i start a second instance of application on <same client machine>:
DBF[s] are loaded error free, and also [more than one] index files for some DBF are opened without error.
*BUT* all index keys are pointing to the _first_ index.
e.g.: INDEXKEY(1) == INDEXKEY(2) == INDEXKEY(3) ..
That i like to call: <scary>, as it looks like we can't use a DBF with multiple index keys by two different applications on same client.
someone else can confirm ?
regards
Rolf
Which LetoDB version are you using?
When I have lt.exe running, my main application that I have just converted to Harbour gives the same error. Two or more instance of my application handle record locking very well when lt.exe is not running. I think it is the file locking or SET EXCLUSIVE mode that is broken in LetoDB.
--
I confirm this - when the table is open exclusively USE command breaks with error. I do not know why, but I agree it's not good. Actually, an error occurs in some unexpected cases. For example, if you write simple program:
RddSetDefault("LETO")
? OrdBagExt()
An error occurs.
Very serious error. Can you please send piece of code that opens the index?
Regards, NB
From: harbou...@googlegroups.com [mailto:harbou...@googlegroups.com] On Behalf Of elch
Sent: Thursday, February 13, 2014 12:56 PM
To: harbou...@googlegroups.com
Subject: Re: [harbour-users] Re: Conversion of an application from Clipper to Harbour + NetIO
Hi,
--
Very serious error. Can you please send piece of code that opens the index?
I suppose it would be good to send this example in the LetoDB forum:
http://sourceforge.net/apps/phpbb/letodb/
Regards, NB
From: harbou...@googlegroups.com [mailto:harbou...@googlegroups.com] On Behalf Of Ash
Sent: Thursday, February 13, 2014 1:22 AM
Hi,
that looks like NO bug ! -- it is just a missing capability:
FunnyDB is not capable of handling multiple NTX for a single DBF, only possible to open such a DBF one single time on the 'server'.
--
I tried without leto_Connect() at application start, with absolute paths, with and without DataPath in letodb.ini,
with and without this: "//cServerIp:nPort" prefix, ....
I am somehow a bit annoyed after all this senseless wasted lifetime.
Before someone suggests:
NJET, i definitely will not change to use CDX -- a check if there is a similar problem for cdx, i leave for others to prove.
I will not even try that ..
A work around seem to be to put all index keys in one file, like it is common for CDX - and great Harbour is declared to be able to do so.
But then i loose compatibility with 3rd-party, which i want to have in the backhand.
( And i do not mean a 'handful' index files, there are *MANY* for my main project )
BTW.: some Index fundamentals explained best, as ever a pleasure to read, by Przemek:
https://groups.google.com/d/msg/harbour-devel/9nT9lZmtztk/Q3X-s81UpYYJ
BEST regards
Rolf
Hi,
i pushed an error description to the place shown by Nenad.
Meanwhile i looked a bit deeper into the source code: it could be 'only' a bug.
The basic structures for maintaining multiple index files seem to be there.
I just guess, it will also happen when someone tries to open multiple CDX index files.
But with this USE EXCLUSE sigsegv crash, plus my described error -- so at least two very basic and heavy problems just during first testing times:
i have no so good feeling ...
I will focus first on HBNETIO - and all work to exchange the 'server' is already done.
best regards
Rolf
I share your concerns. Of course, I'd prefer to use rock-solid product like NetIO, but unfortunately it does not solve my main problem.
As I see on clipper.borda.ru, Kresin and Pavel still working on LetoDB, just completed the php client and corrected some bugs, so I think with a little patients LetoDB can be quite usable product.
Regards, NB
From: harbou...@googlegroups.com [mailto:harbou...@googlegroups.com] On Behalf Of Ash
Sent: Saturday, February 15, 2014 4:47 PM
To: harbou...@googlegroups.com
Subject: Re: [harbour-users] Re: Conversion of an application from Clipper to Harbour + NetIO
Hello Rolf,
--
I share your concerns. Of course, I'd prefer to use rock-solid product like NetIO, but unfortunately it does not solve my main problem.
I have a very a large program with many standard REPLACE/ SKIP/SEEK/TBrowse command. I need a way to speed up all such operations without code change (because it has about million lines). I was not able to accomplish this with NetIO, but LetoDB and ADS give much better results.
Regards, NB
From: harbou...@googlegroups.com [mailto:harbou...@googlegroups.com] On Behalf Of Massimo Belgrano
Sent: Saturday, February 15, 2014 6:20 PM
To: harbou...@googlegroups.com
Subject: Re: [harbour-users] Re: Conversion of an application from Clipper to Harbour + NetIO
2014-02-15 18:01 GMT+01:00 Nenad Batocanin <nbato...@wings.rs>:
--
You can, but you need tochange filters to run on the server... it all depends on now your code is organized...
Problem is that ALL Records are sent over the lan while in letodb only the ones filtered...
The best approximation is the test program I sent earlier. For instance:
WHILE !Eof()
x := some_field
SKIP
END DO
SET FILTER TO some_cond
Browse()
LetoDB doing this about 10 times faster without any code change.
.
>
> When building indexes via RPC in NetIO, the network traffic is reduced by half, however - a fair advantage.
You should have no network traffic if really using rpc
Agree. But I must admit: I still do not know how to do the optimization in some cases. For example, I have a table with a field ABC (numeric), and the table has an index on that field. How to speed up the following:
SET FILTER TO AScan ({123, 456, 789, ...}, ABC) <> 0
Browse()
This is equivalent to:
SET FILTER TO ABC = 123 .OR. ABC = 456 .OR. ABC = 789...
Browse()
I know for bit-map filters, but I could not use them in Harbour.
Create a RPC function on the server: pass the array as parameter and return the name of a temporary file created by the server. Browse that file.
BEWARE: this is a read-only Solution....
When building indexes via RPC in NetIO, the network traffic is reduced by half, however - a fair advantage.
---
With 'Share_Tables=1' LetoDB looses only ~ xx%The problem is: no time to process. For example, the user may select ALL the records (50.000). In fact, I need exactly SET FILTER functionality, but much faster. With LetoDB/ADS simply SET FILTER works fine.
Regards, NB
I'm not sure that this test shows the true situation. In my case, the improvement is clearly evident in the real application. For example, I have a report that runs 4 minutes 15 seconds over the LAN. When switch to LetoDB, time is 13 sec! Without _any_ code change!
But: I do not even cross my mind to use letoDB or any other product before being 100% sure that it will work properly!
NB
From: harbou...@googlegroups.com [mailto:harbou...@googlegroups.com] On Behalf Of elch
Sent: Saturday, February 15, 2014 9:09 PM
To: harbou...@googlegroups.com
Subject: Re: [harbour-users] Re: Conversion of an application from Clipper to Harbour + NetIO
DBGOTOP()
SET FILTER TO AScan ({123, 456, 789, ...}, ABC) <> 0
Browse()
I'm not sure that this test shows the true situation. In my case, the improvement is clearly evident in the real application. For example, I have a report that runs 4 minutes 15 seconds over the LAN. When switch to LetoDB, time is 13 sec! Without _any_ code change!
// Network activity
In fact, this system is already in use :)
If the user selects lower part of the table, then I create a temporary table that contains only a few field from the main table and RecNo() in main table. Then I browse temporary table, using the RecNo() find the appropriate record and receive data as MainTable-> Field. It is a solid system, but I'm not completely satisfied, because the filter condition contains a function that is very slow (I did not mention it because of the simplicity) and execution may take a while, even on the server.
Regards, NB
From: harbou...@googlegroups.com [mailto:harbou...@googlegroups.com] On Behalf Of Francesco Perillo
Sent: Sunday, February 16, 2014 12:01 AM
To: harbou...@googlegroups.com
Subject: Re: [harbour-users] Re: Conversion of an application from Clipper to Harbour + NetIO
Please try if you want... I think that the new file may be created in no more than 2 seconds... 50000 records... unless they are very very very long records...
--
You're probably right. But that means I have to change all the reports and everything, and it's not possible.
Regards, NB
From: harbou...@googlegroups.com [mailto:harbou...@googlegroups.com] On Behalf Of Francesco Perillo
Sent: Sunday, February 16, 2014 12:51 AM
To: harbou...@googlegroups.com
Subject: Re: [harbour-users] Re: Conversion of an application from Clipper to Harbour + NetIO
On Sat, Feb 15, 2014 at 10:49 PM, Nenad Batocanin <nbato...@wings.rs> wrote:
--
It is a solid system, but I'm not completely satisfied, because the filter condition contains a function that is very slow (I did not mention it because of the simplicity) and execution may take a while, even on the server.
You're probably right. But that means I have to change all the reports and everything, and it's not possible.
Ok, I'll explain in more detail. This table is a list of items, and filtered by items type. To display I use TBrowse class and filter is executed in one procedure. Somwhere in code exist this piece:
CASE Ch == K_ALT_F
SetFilter()
This happens in exactly 56 very different procedures, but table of items is the same. Some procedures are changing data, some are read-only, in some user define columns... In this procedures there is thousands of different functions and no way to create a one procedure that does everything. Here's view on one of them:

In some tables, the user can edit the information and more importantly, some information may change by other users (for example, the price and quantity of an item)! Number of records is difficult to estimate. We have more than 7.000 users and each of them has its own items and types of items. These tables may be from 20 to 200,000+ items. In the selection is even worse: the user can choose one and 49.999 records from 50.000.
It would be the perfect solution to stay within SetFilter function, because changing all the procedures is _very_ big task. This is the reason ((+few thousand reports)) why I'm looking for a solution without code change. "Universal" data server is certainly not an ideal solution, but it gives me the most with no change of source code.
I'm sorry to bother you, I hope this discussion will be helpful to someone else :)
Regards, NB
From: harbou...@googlegroups.com [mailto:harbou...@googlegroups.com] On Behalf Of Francesco Perillo
Sent: Sunday, February 16, 2014 12:39 AM
To: harbou...@googlegroups.com
Subject: Re: [harbour-users] Re: Conversion of an application from Clipper to Harbour + NetIO
Hi Nenad,
--
> On my test report I went from 7 seconds to 0,1 running on server as RPC.
No doubt - this is the difference between "local" and "LAN in the test that I did. However, I hope you now understand why I still can not use NetIO.
I still hope that Przemek at some point decide to add on NetIO some features of "dumb" data server :))
Regards, NB
Nenad,
according my personal checks:
LetoDB application have memory leaks :-((
checked with sir Valgrind in Linux.
I counter-checked with the same source and hbnetio.hbc,
only without LetoDB functions and not linking '-lrddleto':
Crystal clear with Hbnetio: not a single byte going wild.
You may ask why this check with Valgrind was made ?
Because i saw in an old Windows version multiple this message:
'application had problems .....'
[ no 'exclusive use' known problem, seem to happen unpredictable ... ]
best regards
Rolf
Is not possible to apply the SCOPE, because records are not consecutive. For instance (index on Type):
Rec Type
---------------
1 11
2 11
3 15
4 20
5 20
6 21
7 21
8 22
9 23
I need records with type = 11 and 21. As I recall, the old Six RDD is read data directly from the index, and he "knew" how to optimize this query.
regards, NB
Sorry, English is definitely not my strongest side :)
Our users is 2.232 companies with a total of 7,292 workstations. Each company has its own database and its table of items that typically is 1-2000 records, but sometimes it can be 50.000, 200,000 or more records.
The concept you fully understand. But filter can not be "X letter in the name" - let's say you can only filter by group of type of items.
I've done some experiments with the filter in letodb. For example, this command is executed very efficiently on server side:
SET FILTER TO At (I2Bin(Artikli->a_vrs), "AF 0F AA ..." ) <> 0
I first convert array of type ID's in the string "AF 0F AA...", then form the query and finaly send all to Leto. I do not expect a total optimization, it is sufficient to me to execute the query on the server side.
I'll send some piece of code when I came across a particular problem - there's no point now, it's too complicated.
Very thanks for your efforts and valuable information. I'll keep in mind your offer.
Regards, NB
From: harbou...@googlegroups.com [mailto:harbou...@googlegroups.com] On Behalf Of Francesco Perillo
Sent: Sunday, February 16, 2014 10:39 PM
To: harbou...@googlegroups.com
Subject: Re: [harbour-users] Re: Conversion of an application from Clipper to Harbour + NetIO
Hi Nenad,
--
Very bad news :((
NB
From: harbou...@googlegroups.com [mailto:harbou...@googlegroups.com] On Behalf Of elch
Sent: Sunday, February 16, 2014 11:35 PM
To: harbou...@googlegroups.com
Subject: Re: [harbour-users] Re: Conversion of an application from Clipper to Harbour + NetIO
Nenad,
--
Hi Przemek,
can we avoid that 'doubled' network traffic with a tricky setup, and get Samba AND HBnetio together ?
Different IP-address ?
Extra NIC for server with other subnet ?
Because i need to access many 'extra' files ( text, pictures ) and would need Samba for that,
as these are accessed with commands like FILE(), MemoRead() ..
And they are not in data-path of HBnetio: some here, some there ..
best regards
Rolf
btw Ash,
i believe you mis-use this loadable hrb file: it is at different places called RPC*filter*.
As far as i have understood that, it is intended to exclude some RPC functions because of security reason.
Maybe no topic for a 'trusted' local network, but you mentioned internet access to the server.
I think in this regard of functions like Directory(), MemoRead(), MemoWrit(), Ferase() ...
I am unsure, how to exclude such functions: per overlay with a new dummy ?
best regards
Rolf
In the spirit of Harbour, a simple example is indicated to show that building indexes at the server with NetIO does require network resources - about 50% of what it would take in samba. I did make a change at line 182 of hbnetio.prg as shown below:// netiosrv[ _NETIOSRV_hRPCFHRB ] := hb_hrbLoad( HB_HRB_BIND_FORCELOCAL, cFile )
netiosrv[ _NETIOSRV_hRPCFHRB ] := hb_hrbLoad( HB_HRB_BIND_DEFAULT, cFile )
...
// rpcdemo.prg// RPC Demo moduleSTATIC FUNCTION HBNETIOSRV_RPCMAIN( sFunc, ... )
OutStd( "DO", sFunc:name, "WITH", ..., hb_eol() )
RETURN sFunc:exec( ... )
FUNCTION My_UDF( )
? 'Start...'
USE ('frsgjour')
INDEX ON field->accountno TO ('frstest')
USE
? 'End.', hb_eol()
RETURN .T.
okay !, Ash
respect you for your experience, and more for about a million source rows of Nenad:
WoW: i choosed a different way: as my main application is for all potential users the same ..
# because more than the half of my ~ 170K apps' lines is my own library, ever will be needed for all
# pushing the needs of i.e. 50 workstations onto one single server, i would need a 'full-grown mainframe' bastard ;-)
So all workstations are planned to use HBNETIO for DBF access, as it seem faster than Samba.
And all stations will have the option of RPC remote execution in the backhand for 'special forces' ;-),
where such is very rarely needed ..
---
Further i have some own additional tools around that, like my own database management:
this utility will run on the server itself without HBNETIO or else, but with local impressive Harbour fast access to the data.
This tool is [since long] responsible to maintain (i.e. PACK / update DBF structures / RARE! reindex if needed )
[ and all needed data is stored in 3 DBFs ]
I've create decades ago this tool, as we actually talking of about 80 DBF and 200+ NTX ...
( sure !! not to boast you or any else, only FYI, to better imagine about my worries .. )
very best regards
Rolf
Of course, as soon as I have some free time. Currently I need 48 hours in a day :))
NB
From: harbou...@googlegroups.com [mailto:harbou...@googlegroups.com] On Behalf Of elch
Sent: Tuesday, February 18, 2014 5:02 PM
To: harbou...@googlegroups.com
Subject: Re: [harbour-users] Re: Conversion of an application from Clipper to Harbour + NetIO
Nenad,
--
I still have to understand which LetoDb repository is the correct one: sourceforge or github...
--
--
You received this message because you are subscribed to the Google
Groups "Harbour Users" group.
Unsubscribe: harbour-user...@googlegroups.com
Web: http://groups.google.com/group/harbour-users
---
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to harbour-user...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.