discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: What is needed to run a tool like a daemon?


From: Saso Kiselkov
Subject: Re: What is needed to run a tool like a daemon?
Date: Thu, 03 Dec 2009 08:34:22 +0100
User-agent: Thunderbird 2.0.0.23 (X11/20090817)

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

And what's stopping you from simply forking into the background? Like
with the following:

if (daemon (0, 0) == -1)
  {
    NSLog (@"Error daemonizing: %s", strerror (errno));
    exit (EXIT_FAILURE);
  }

BR,
- --
Saso

Germán Arias wrote:
> As you know I'm working on GSTaskBar. Until now I run GSTB from a
> terminal. But when I try start this tool in my .profile file (where I
> start gbps and gdnc) I can not start my session. The error occurs
> because GSTB can't register with the name GSTaskBar. I need to delete
> the file /tmp/.X0-lock and type: startx. This start my session. After
> this, the process GSTB is running and work fine. Then, why I get this
> error? Basically I have something like
> 
>   NSAutoreleasePool *pool;
>   GSTaskBar *gsbar;
>   NSConnection *conn;
> 
>   pool = [NSAutoreleasePool new];
>   gsbar = [GSTaskBar new];
>   conn = [NSConnection defaultConnection];
>   [conn setRootObject: gsbar];
> 
>   if (![conn registerName: @"GSTaskBar"]) 
>     {
>       NSLog (@"Could not register us as GSTaskBar");
>       exit (1);
>     }
>   
>   NSLog (@"Server registered - waiting for connections...");
>   [[NSRunLoop currentRunLoop] run];
> 
> if I start this tool at the beginning of my session (with the tool of
> gnome to do this) this work fine. But... I would like start this
> together gpbs and gdnc. Greetings.
> 
> 
> 
> _______________________________________________
> Discuss-gnustep mailing list
> Discuss-gnustep@gnu.org
> http://lists.gnu.org/mailman/listinfo/discuss-gnustep

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAksXaf0ACgkQRO8UcfzpOHBSkQCdHNExYRyabwlvRPhB7T0nw+iJ
woIAn0dEokvR/zcnuQknulnhMp9eouyJ
=PkZP
-----END PGP SIGNATURE-----




reply via email to

[Prev in Thread] Current Thread [Next in Thread]