<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Creating a daemon process in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/creating-a-daemon-process/m-p/2802850#M82322</link>
    <description>I'm betting that you haven't fork()'ed.&lt;BR /&gt;&lt;BR /&gt;e.g.&lt;BR /&gt;&lt;BR /&gt;if ((pid = fork()) &amp;lt; 0)&lt;BR /&gt;  {&lt;BR /&gt;    (void) fprintf(stderr,"Can't fork %d\n",errno);&lt;BR /&gt;    (void) fflush(stderr);&lt;BR /&gt;    exit(errno);&lt;BR /&gt;  }&lt;BR /&gt;if (pid != 0) /* parent process */ exit(0);&lt;BR /&gt;/* you are now the child */&lt;BR /&gt;setsid();&lt;BR /&gt;</description>
    <pubDate>Mon, 09 Sep 2002 22:26:15 GMT</pubDate>
    <dc:creator>A. Clay Stephenson</dc:creator>
    <dc:date>2002-09-09T22:26:15Z</dc:date>
    <item>
      <title>Creating a daemon process</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/creating-a-daemon-process/m-p/2802849#M82321</link>
      <description>I am trying to create a daemon process using the setsid() system call.  However, the call to setsid() is failing, giving me an error of "Not Owner" (via perror()).&lt;BR /&gt;&lt;BR /&gt;Can anyone point me to the steps for creating a daemon process, using setsid(), invoked from C?&lt;BR /&gt;&lt;BR /&gt;Thanks!&lt;BR /&gt;&lt;BR /&gt;- Scott&lt;BR /&gt;</description>
      <pubDate>Mon, 09 Sep 2002 21:58:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/creating-a-daemon-process/m-p/2802849#M82321</guid>
      <dc:creator>Stack</dc:creator>
      <dc:date>2002-09-09T21:58:37Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a daemon process</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/creating-a-daemon-process/m-p/2802850#M82322</link>
      <description>I'm betting that you haven't fork()'ed.&lt;BR /&gt;&lt;BR /&gt;e.g.&lt;BR /&gt;&lt;BR /&gt;if ((pid = fork()) &amp;lt; 0)&lt;BR /&gt;  {&lt;BR /&gt;    (void) fprintf(stderr,"Can't fork %d\n",errno);&lt;BR /&gt;    (void) fflush(stderr);&lt;BR /&gt;    exit(errno);&lt;BR /&gt;  }&lt;BR /&gt;if (pid != 0) /* parent process */ exit(0);&lt;BR /&gt;/* you are now the child */&lt;BR /&gt;setsid();&lt;BR /&gt;</description>
      <pubDate>Mon, 09 Sep 2002 22:26:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/creating-a-daemon-process/m-p/2802850#M82322</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2002-09-09T22:26:15Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a daemon process</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/creating-a-daemon-process/m-p/2802851#M82323</link>
      <description>Right you are!  Actually, I was forking, but got the parent &amp;amp; child reversed.  Thanks for your help!</description>
      <pubDate>Tue, 10 Sep 2002 01:35:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/creating-a-daemon-process/m-p/2802851#M82323</guid>
      <dc:creator>Stack</dc:creator>
      <dc:date>2002-09-10T01:35:24Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a daemon process</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/creating-a-daemon-process/m-p/2802852#M82324</link>
      <description>Let me give you one other option to consider: You might want to write your daemon in Perl. The code is very similar to what you would do in C includin fork() and setsid(). The development is much faster and the code execites almost as fast as C; it's also much more portable. Unless you are doing some extremely specialized tasks, I think you will find that Perl is an extremely good alternative - I've not had to write a daemon in C in over two years but I've probably written 20 or so in Perl.&lt;BR /&gt;&lt;BR /&gt;I've attached an example; don't worry about what this does (it's the server piece of a daemon that handles event synchronization across hosts via socket connections) just look for the fork() and setsid() calls and note that it is very similar to what you do in C.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 10 Sep 2002 13:22:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/creating-a-daemon-process/m-p/2802852#M82324</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2002-09-10T13:22:46Z</dc:date>
    </item>
  </channel>
</rss>

