<?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 How to create Daemon? in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-create-daemon/m-p/2447463#M9830</link>
    <description>Is it possible to create Daemon? if yes, How?&lt;BR /&gt;For Eg. If I want to create the Daemon to check the Idle terminal more than 15min. and to kill the same, is it possible Please help.&lt;BR /&gt;&lt;BR /&gt;thankx</description>
    <pubDate>Sat, 23 Sep 2000 05:33:56 GMT</pubDate>
    <dc:creator>NUTANKUMAR</dc:creator>
    <dc:date>2000-09-23T05:33:56Z</dc:date>
    <item>
      <title>How to create Daemon?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-create-daemon/m-p/2447463#M9830</link>
      <description>Is it possible to create Daemon? if yes, How?&lt;BR /&gt;For Eg. If I want to create the Daemon to check the Idle terminal more than 15min. and to kill the same, is it possible Please help.&lt;BR /&gt;&lt;BR /&gt;thankx</description>
      <pubDate>Sat, 23 Sep 2000 05:33:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-create-daemon/m-p/2447463#M9830</guid>
      <dc:creator>NUTANKUMAR</dc:creator>
      <dc:date>2000-09-23T05:33:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to create Daemon?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-create-daemon/m-p/2447464#M9831</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Creating a daemon is not very difficult. In attachment you find a C function that does just that.&lt;BR /&gt;&lt;BR /&gt;Hope this helps,&lt;BR /&gt;Rik</description>
      <pubDate>Sat, 23 Sep 2000 06:14:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-create-daemon/m-p/2447464#M9831</guid>
      <dc:creator>RikTytgat</dc:creator>
      <dc:date>2000-09-23T06:14:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to create Daemon?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-create-daemon/m-p/2447465#M9832</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;In the simplest sense, a daemon is simply a program that performs a task.  It sleeps, waiting for an event or a timer to expire, wakes up, does some work, and goes back to sleep.&lt;BR /&gt;&lt;BR /&gt;Typically daemons are named with a "d" suffix, e.g. ftpd for the ftp daemon.  This is very useful since many daemons run "forever" but over their elapsed time consume very litte CPU.  Suffixing them with a "d" denotes this expectation.&lt;BR /&gt;&lt;BR /&gt;By definition a shell script can be written to execute, for instance, a "while true do" loop; sleep; and wake up every 10 seconds or so to look for work to do.  You would launch the script with the form:&lt;BR /&gt;&lt;BR /&gt;# nohup impd 2&amp;gt;&amp;amp;1 /tmp/impd.log &amp;amp; &lt;BR /&gt;&lt;BR /&gt;Depending on the nature of the the daemon you the initiation could be done in the /sbin/rc&lt;N&gt;.d startup directory.&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;/N&gt;</description>
      <pubDate>Sat, 23 Sep 2000 18:12:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-create-daemon/m-p/2447465#M9832</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2000-09-23T18:12:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to create Daemon?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-create-daemon/m-p/2447466#M9833</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;A more specific suggestion:&lt;BR /&gt;&lt;BR /&gt;Create a shell scritp daemon as suggested in the abstract above.  Since I am not near a server my syntax is from my head, but here's the idea.  The output from 'who -u' gives the idle time (which is what you want) and the pid of the shell you want to kill).&lt;BR /&gt;Check the positions of the fields from 'who'.  You may also have to fixup awk's match for the idle time, but you can get the general idea from this:&lt;BR /&gt;&lt;BR /&gt;while true &lt;BR /&gt;do&lt;BR /&gt;  who -u|awk '{if (split($4,A[1,:]) &amp;gt;= 15} {system(kill $5)}'&lt;BR /&gt;  sleep 60&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Sat, 23 Sep 2000 20:48:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-create-daemon/m-p/2447466#M9833</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2000-09-23T20:48:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to create Daemon?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-create-daemon/m-p/2447467#M9834</link>
      <description>A few words of warning here.  In general, it is far better to kill off 'inactive' terminal processes at the application level.  Is the process actually doing nothing at a command line, or is it in the middle of a opened transaction?  Unix can't tell the difference easily.  For example, you could be in the middle of installing patches with the analysis complete waiting for you to start the actual install; the daemon comes along after 15 minutes of inactivity and kills it off.  This is a relatively easy thing to recover from, but something like an end of month process waiting for an approval step is not.</description>
      <pubDate>Sun, 24 Sep 2000 18:32:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-create-daemon/m-p/2447467#M9834</guid>
      <dc:creator>Tim Malnati</dc:creator>
      <dc:date>2000-09-24T18:32:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to create Daemon?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-to-create-daemon/m-p/2447468#M9835</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;Here is a syntatically correct offering of my earlier post.  As written this will look for sessions idle for 15-minutes or more.&lt;BR /&gt;&lt;BR /&gt;I would note too, that Tim's comments, above, are well taken.  In any event, try:&lt;BR /&gt;&lt;BR /&gt;# who -u|awk 'substr($6,3,2) &amp;gt;= 15 {system("kill -s 9 " $7)}'&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Mon, 25 Sep 2000 13:06:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-to-create-daemon/m-p/2447468#M9835</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2000-09-25T13:06:59Z</dc:date>
    </item>
  </channel>
</rss>

