6th December 2007, 07:21 pm
quest /tmp# cat test.c
#include <sys/types.h>
#include <stdlib.h>
#include <unistd.h>
int
main (int argc,
char *argv[])
{
pid_t pid;
pid = fork ();
if (pid > 0)
exit (0);
pid = fork ();
if (pid > 0)
exit (0);
pause ();
exit (0);
}
quest /tmp# gcc -Wall -g -O0 -o test test.c
quest /tmp# cat /etc/event.d/test
wait for daemon
exec /tmp/test
quest /tmp# start test
test (#0) goal changed from stop to start
test (#0) state changed from waiting to starting
event_new: Pending starting event
Handling starting event
event_finished: Finished starting event
test (#0) state changed from starting to pre-start
test (#0) state changed from pre-start to spawned
process_spawn: Spawned main process 6380 for test (#0)
Active test (#0) main process (6380)
test (#0) main process (6380) forked new child 6381
test (#0) main process (6381) forked new child 6382
test (#0) state changed from spawned to post-start
test (#0) state changed from post-start to running
event_new: Pending started event
Handling started event
event_finished: Finished started event
Mike:
This looks intriguing, but there’s not context. What command/package is this about? Where is this ’start’ command from?
6 December 2007, 7:51 pmJoe Shaw:
Ok, the obvious question: how does this work?
6 December 2007, 8:26 pmMalcolm Parsons:
For those who can’t guess, this is an upstart feature.
6 December 2007, 10:03 pmBT:
Can U give us (poor stick in the mud) a clue ?
6 December 2007, 10:53 pmWhat the heck does it do ? How?
Scott James Remnant » Blog Archive » How to (and why) supervise forking processes:
[...] Home « Supervising forking processes [...]
7 December 2007, 10:57 amDiego Calleja:
Go upstart!
7 December 2007, 10:58 amMarius Gedminas:
This is incredibly cool!
Can upstart distinguish forks used to daemonize from forks used to execute external helpers? What would ’start postfix’ look like?
7 December 2007, 1:44 pmRudd-O:
This is A-WE-SO-ME, Scott!
7 December 2007, 6:21 pmUbuntu Index » Blog Archive » Scott James Remnant: How to (and why) supervise forking processes:
[...] celebratory blog post demonstrated that Upstart is now able to supervise processes that fork into the background, as most [...]
7 December 2007, 9:44 pmScott James Remnant » Blog Archive » Upstart 0.5: Job Lifecycle:
[...] forking as before. As I’ve talked about before, Upstart can supervise process that fork, and it will wait for that to happen before [...]
12 April 2008, 5:13 pm