comp.lang.ada
 help / color / mirror / Atom feed
From: James Rogers <jimmaureenrogers@worldnet.att.net>
Subject: Re: Unix-daemons in Ada
Date: Sun, 01 Jul 2001 17:20:24 GMT
Date: 2001-07-01T17:20:24+00:00	[thread overview]
Message-ID: <3B3F5C68.AA1C0924@worldnet.att.net> (raw)
In-Reply-To: 87ofr43efd.fsf@520075220525-0001.dialin.t-online.de

Ok, now I more clearly understand your request.

What you are asking is an operating system issue and not strictly a
language issue. 

It really invloves the manner used to start the Ada program.
Many Unix daemons are started by simply placing the executable name
in the /etc/inittab file, then rebooting the system. If you only want
a background process that can keep executing after its parent
process had died, you can run the program in the background and
set nohup for the resulting process. The main Ada task will still
exist as long as its tasks live. Remember, tasks run in a single
process. The entire Ada program must be run as a daemon, not just
some side effect of the program.

Of course, you could start the Ada program from C using a fork
and execute set of calls. For that matter, you can call the
same libraries directly from Ada if you wish. 

Jim Rogers
Colorado Springs, Colorado USA

Stefan Nobis wrote:
> 
> James Rogers <jimmaureenrogers@worldnet.att.net> writes:
> 
> > This is much easier using tasks in Ada. In the Ada task there will be
> > no forking. Instead, a task will be created to handle the work.
> 
> Yes, but i want the started daemon to become unassociated to the terminal from
> which it is started. But in Ada the main task waits until all other tasks have
> terminated so the daemon is always associated with the controlling terminal
> from which the daemon was started. I want a daemon with no controlling
> terminal. How do i do this in Ada?
> 
> > Using the dynamic task approach you would do the following:
> 
> That i did understand. The problem is not how to distribute the duties to
> tasks but to become undependent from the controlling terminal.
> 
> --
> Until the next mail...,
> Stefan.



  reply	other threads:[~2001-07-01 17:20 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-07-01 12:41 Unix-daemons in Ada Stefan Nobis
2001-07-01 14:07 ` James Rogers
2001-07-01 14:35   ` Stefan Nobis
2001-07-01 17:20     ` James Rogers [this message]
2001-07-03 20:48       ` Stefan Skoglund
2001-07-03 22:39         ` Larry Kilgallen
2001-07-06 14:15           ` Tarjei T. Jensen
2001-07-06 17:05             ` Larry Kilgallen
2001-07-06 22:33               ` Tarjei Tj�stheim Jensen
2001-07-13  7:51                 ` Maxim Reznik
2001-07-01 19:51 ` Florian Weimer
2001-07-01 21:47 ` David C. Hoos, Sr.
2001-07-02 19:18   ` Stefan Nobis
2001-07-02 20:16     ` David C. Hoos
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox