Recent

Author Topic: Getting into the nuts and bolts... need technical assistance  (Read 4653 times)

Ozz_Nixon

  • Full Member
  • ***
  • Posts: 128
  • ~ email: nixon.ozz@aol.com or ozznixon@gmail.com
    • http://www.modernpascal.com/
Getting into the nuts and bolts... need technical assistance
« on: January 11, 2008, 08:56:48 pm »
My company is in the process of porting all of our business application servers and data mining products from Windows to Linux. I elected FPC for the chore, and Lazarus to have a debugger/IDE environment. Our products all 100% console/daemon.

Some of the problems I am running in to, I am sure others have too... and maybe someone could shed some light on resources to reduce my learning curve.

An embarrassing example: developed a daemon using my DXSock suite, and decided to implement it as a true Linux shell app (not a Daemon yet). When I found that I could not do a ForceDirectories('/var/log/myproject/') because I was not root. Instead of su and making the directory, I spent time researching setuid(0) and EPERM, to figure out after a while I either have to run the app as root, or make the directory manually and grant access to my user account. -- yeah, the obvious is understood... but are their any Linux developer books that (1) explains that you use setuid(0) to gain privileged access, so I know the function instead of hacking through apache source, (2) any FPC and/or LAZ examples that are truly LINUX oriented? ... as I had the same problem with my conf file in /etc... I now compile as my user, and run everything from a root based account. But wasted about 3 hours hacking around until I found setuid() in apache, then instantly figured out why it was not working.

Another question along this level of wanting to learn. Is there a way that I can find out if I am developing against the FPC's units compiled FPC_USE_LIBC or not? (referring to system unit specifically) - can I do it during design time, and during run-time?

And lastly, are there any Getting started quick with FPC/LAZ. Covering topics like reporting a bug (where and how), you installed everything but you want to do weekly svn checkouts (how to), when you have made core changes and want to contribute (how, who, etc).

Thank you kindly,
Ozz
---
Want to kick the tires to a Free Pascal like script engine? http://www.ModernPascal.com/

Phil

  • Hero Member
  • *****
  • Posts: 2737
Re: Getting into the nuts and bolts... need technical assist
« Reply #1 on: January 11, 2008, 11:09:44 pm »
Quote from: "ozznixon"
And lastly, are there any Getting started quick with FPC/LAZ. Covering topics like reporting a bug (where and how), you installed everything but you want to do weekly svn checkouts (how to), when you have made core changes and want to contribute (how, who, etc).


You've probably already discovered the wiki but there's a huge amount of information there:

http://wiki.lazarus.freepascal.org/index.php/Main_Page

Some of it may be incomplete or a bit out of date, but I would browse through that once or twice. Also, don't miss the ported libraries:

http://wiki.lazarus.freepascal.org/Components_and_Code_examples

There's a developer's mailing list too. You can browse it here:

http://www.mail-archive.com/lazarus@miraclec.com/

I can't remember exactly how to sign up for this. Maybe somebody else can supply that information.

For some of your technical questions, you might want to go right to the FPC source and do some grepping. Or maybe those are questions best directed to the FPC developers.

Thanks.

-Phil

Almindor

  • Sr. Member
  • ****
  • Posts: 412
    • http://www.astarot.tk
RE: Re: Getting into the nuts and bolts... need technical as
« Reply #2 on: January 13, 2008, 12:48:13 pm »
Rooting -- since your stuff is going to be a daemon (put somewhere by root I guess), you just need to use the setuid trick. All the unix functions are in units "unix" and "baseunix". They start with prefix "fp" but are 100% compatible to their C counterparts. So if you eg: do "man setuid" you will get a description of "fpsetuid" too.

You can find out if FPC uses libc by {$IFDEF FPC_USE_LIBC}. That's just compile time tho.

See the wikis for getting started stuff.

 

TinyPortal © 2005-2018