[Lazarus] Which program type to select for cron usage?

Mark Morgan Lloyd markMLl.lazarus at telemetry.co.uk
Mon Oct 19 11:42:55 CEST 2015


Bo Berglund wrote:
> I am finally ready to start creating my FPC/Lazarus control
> application based on a number of Delphi support units. The application
> is meant to be started on a Raspberry Pi2 by cron every minute or so
> and basically check if there is something to do and if not just exit.
> But if there is stuff to do it will create the needed control objects
> and start communicating with a data collection instrument to manage
> its measuring sequence.
> As far as I am concerned the program will have no user interface
> whatever but it will need to be running on command from cron and it
> must also detect if it has already started (some hints on this has
> been given in earlier threads).
> Anyway, Lazarus gives a number of non-GUI selections for the new
> project:
> 
> 1) Simple Program (A most simple FP command line program)
> 2) Program (A FP cmd line program with some useful settings added)
> 3) Console App (A FP cmd line program using TCustomApplication..)
> 
> I will probably need to use threads inside the program so I guess that
> 2 or 3 would be the appropriate selection.
> Is there something else that may affect the decision?
> And what is the best selection between Program and Console
> Application?

I'd be inclined to start with (2) in the general case, but I suggest 
that it would be worth experimenting, since the behaviour might vary 
depending on distro.

Be warned that you might find that your program might have a minimal 
PATH setting unless you run it from Dash or Bash (e.g. by putting it in 
a shell script), and you might need to redirect stdout and stderr since 
otherwise any output will probably be emailed to root.

-- 
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]




More information about the Lazarus mailing list