Subject: keep forked children when father dies
To: None <>
From: Joel CARNAT <>
List: tech-pkg
Date: 03/24/2004 19:42:25

I'm doing portage for suxpanel (this is ~ a launching bar).
It compiles and run OK but...

When it launches an apps (say XTerm), it forks.
But If I Ctrl-C suxpanel, then all the forked apps die too...

The code is :
static void spawn_app(GtkWidget *widget, gpointer data)
        gchar *app, *path;
        pid_t child;

        path = (gchar*) g_object_get_data(G_OBJECT(widget), "path");

        app = g_strdup_printf("%s/%s/AppRun", path ? path : app_path,

        child = fork();
        if (child == -1) {
                GtkWidget *dialog;

                dialog = gtk_message_dialog_new(NULL, GTK_DIALOG_MODAL,
                        GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE,
                        "Cannot fork. Yay.");
        } else if (child == 0) {
                char *argv[2];

                argv[0] = app;
                argv[1] = 0;

                execv(app, argv);


I thought I could use another exec* function or send a SIG* to the
child, but can't find a clue in the man...
Can anyone enlighten me ?