Recent

Author Topic: Linux daemon for a Ubuntu server  (Read 5710 times)

BPascal

  • New Member
  • *
  • Posts: 14
Linux daemon for a Ubuntu server
« on: October 27, 2016, 10:11:40 am »
Hi.

I want to create a daemon for a Ubuntu server. (No graphical)

I need to compile it using ONLY free pascal compiler 3.0

If I use a TCustomDaemon (like tutorial http://wiki.freepascal.org/Daemons_and_Services ) then free pascal tells that units are not found... a TCustomDaemon can only be compiled through lazarus?
Is it possible to compile it without lazarus, only pure free pascal compiler?

Thanks

Thaddy

  • Hero Member
  • *****
  • Posts: 14373
  • Sensorship about opinions does not belong here.
Re: Linux daemon for a Ubuntu server
« Reply #1 on: October 27, 2016, 10:20:58 am »
There is an example in the ./packages/rtl-extra/examples directory that is absolutely cross-platform.
Object Pascal programmers should get rid of their "component fetish" especially with the non-visuals.

BPascal

  • New Member
  • *
  • Posts: 14
Re: Linux daemon for a Ubuntu server
« Reply #2 on: October 27, 2016, 11:24:48 am »
Thanks!

mig-31

  • Sr. Member
  • ****
  • Posts: 305
Re: Linux daemon for a Ubuntu server
« Reply #3 on: October 27, 2016, 11:58:14 am »
You can use lazbuild utility to compile Lazarus project without Lazarus.
Lazarus 2.2.6 - OpenSuse Leap 15.4, Mageia 8, CentOS 7

dogriz

  • Full Member
  • ***
  • Posts: 127
Re: Linux daemon for a Ubuntu server
« Reply #4 on: October 27, 2016, 12:22:45 pm »
You can use lazbuild utility to compile Lazarus project without Lazarus.
I think the man is talking about ONLY Freepascal - so without Lazarus.
FPC 3.2.2
Lazarus 2.2.4
Debian x86_64, arm

Thaddy

  • Hero Member
  • *****
  • Posts: 14373
  • Sensorship about opinions does not belong here.
Re: Linux daemon for a Ubuntu server
« Reply #5 on: October 27, 2016, 12:24:40 pm »
Correct. And also has the pointer to a Laz-free example. Daemons don't need Lazarus at all.
Object Pascal programmers should get rid of their "component fetish" especially with the non-visuals.

BPascal

  • New Member
  • *
  • Posts: 14
Re: Linux daemon for a Ubuntu server
« Reply #6 on: October 28, 2016, 03:05:03 pm »
app is working good... but.

How to install it as a service on Linux?  (now, when I close ssh connection app stops)

option -i does not do anything on Linux (explained at http://www.freepascal.org/~michael/articles/daemons/daemons.pdf ) so my question is how to install a fpc app made as a service in Linux to start/stop unatended like Windows does?

Thanks

Leledumbo

  • Hero Member
  • *****
  • Posts: 8757
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Linux daemon for a Ubuntu server
« Reply #7 on: October 29, 2016, 10:40:53 pm »
How to install it as a service on Linux?  (now, when I close ssh connection app stops)
Daemon installation depends on init system. upstart, systemd, openrc, etc. all use different ways. What's yours?

 

TinyPortal © 2005-2018