<?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 two processes is accessing the same file and i lose infos in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/two-processes-is-accessing-the-same-file-and-i-lose-infos/m-p/2494124#M19908</link>
    <description>&lt;BR /&gt;hi to all,&lt;BR /&gt;i'm tryim=ng to send the stdout of a process to a file that periodically is accessed by another process ( command date to have a reference in the log file) that starts from cron. What is happening is that the date is lost because, for sure, there is not synchronization between two processes that is accessing the file.&lt;BR /&gt;How can i do to fixe the problem ?&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;Federico</description>
    <pubDate>Thu, 15 Feb 2001 11:22:14 GMT</pubDate>
    <dc:creator>federico_3</dc:creator>
    <dc:date>2001-02-15T11:22:14Z</dc:date>
    <item>
      <title>two processes is accessing the same file and i lose infos</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/two-processes-is-accessing-the-same-file-and-i-lose-infos/m-p/2494124#M19908</link>
      <description>&lt;BR /&gt;hi to all,&lt;BR /&gt;i'm tryim=ng to send the stdout of a process to a file that periodically is accessed by another process ( command date to have a reference in the log file) that starts from cron. What is happening is that the date is lost because, for sure, there is not synchronization between two processes that is accessing the file.&lt;BR /&gt;How can i do to fixe the problem ?&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;Federico</description>
      <pubDate>Thu, 15 Feb 2001 11:22:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/two-processes-is-accessing-the-same-file-and-i-lose-infos/m-p/2494124#M19908</guid>
      <dc:creator>federico_3</dc:creator>
      <dc:date>2001-02-15T11:22:14Z</dc:date>
    </item>
    <item>
      <title>Re: two processes is accessing the same file and i lose infos</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/two-processes-is-accessing-the-same-file-and-i-lose-infos/m-p/2494125#M19909</link>
      <description>Hi ,&lt;BR /&gt;&lt;BR /&gt;Since these are two different processes , one way of doing them is using a file ( could be just a 0 byte ) as a lock file .&lt;BR /&gt;&lt;BR /&gt;Each time before they access the file they check for the existence of this lock file and if it exist then they sleep for &lt;N&gt; secs and try again. &lt;BR /&gt;&lt;BR /&gt;Once the process is done accessing the file it removes the lock file .&lt;/N&gt;</description>
      <pubDate>Thu, 15 Feb 2001 12:11:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/two-processes-is-accessing-the-same-file-and-i-lose-infos/m-p/2494125#M19909</guid>
      <dc:creator>Vikas Khator</dc:creator>
      <dc:date>2001-02-15T12:11:31Z</dc:date>
    </item>
    <item>
      <title>Re: two processes is accessing the same file and i lose infos</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/two-processes-is-accessing-the-same-file-and-i-lose-infos/m-p/2494126#M19910</link>
      <description>Hi Frederico,&lt;BR /&gt;&lt;BR /&gt;Another solution would be to have your first process talk to the second via a pipe.&lt;BR /&gt;&lt;BR /&gt;The second process should simply read the pipe and, if there is any data waiting, add a timestamp and write to a log file. &lt;BR /&gt;Depending of the amount and type of data logged by the first process, the second one could even be a shell script.&lt;BR /&gt;&lt;BR /&gt;Best regards,&lt;BR /&gt;&lt;BR /&gt;Dan</description>
      <pubDate>Thu, 15 Feb 2001 12:26:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/two-processes-is-accessing-the-same-file-and-i-lose-infos/m-p/2494126#M19910</guid>
      <dc:creator>Dan Hetzel</dc:creator>
      <dc:date>2001-02-15T12:26:15Z</dc:date>
    </item>
    <item>
      <title>Re: two processes is accessing the same file and i lose infos</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/two-processes-is-accessing-the-same-file-and-i-lose-infos/m-p/2494127#M19911</link>
      <description>&lt;BR /&gt;OK,&lt;BR /&gt;but what is the procedure?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Federico</description>
      <pubDate>Thu, 15 Feb 2001 12:45:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/two-processes-is-accessing-the-same-file-and-i-lose-infos/m-p/2494127#M19911</guid>
      <dc:creator>federico_3</dc:creator>
      <dc:date>2001-02-15T12:45:18Z</dc:date>
    </item>
    <item>
      <title>Re: two processes is accessing the same file and i lose infos</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/two-processes-is-accessing-the-same-file-and-i-lose-infos/m-p/2494128#M19912</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Why don't you use logger and syslog.conf to create your own logfiles and write to them using the syslogd.&lt;BR /&gt;&lt;BR /&gt;See the logger manpage for more info. A number of user definable syslog 'facilities' are available.&lt;BR /&gt;&lt;BR /&gt;Bye,&lt;BR /&gt;Rik.</description>
      <pubDate>Thu, 15 Feb 2001 12:58:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/two-processes-is-accessing-the-same-file-and-i-lose-infos/m-p/2494128#M19912</guid>
      <dc:creator>RikTytgat</dc:creator>
      <dc:date>2001-02-15T12:58:45Z</dc:date>
    </item>
    <item>
      <title>Re: two processes is accessing the same file and i lose infos</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/two-processes-is-accessing-the-same-file-and-i-lose-infos/m-p/2494129#M19913</link>
      <description>Hi Frederico,&lt;BR /&gt;&lt;BR /&gt;Here is a 'quick and dirty example to put you on the traks:&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;while true&lt;BR /&gt;do&lt;BR /&gt;read DATA&lt;BR /&gt;date &amp;gt;&amp;gt; logfile$$&lt;BR /&gt;print $DATA &amp;gt;&amp;gt; logfile$$&lt;BR /&gt;sleep 5&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;Adjust the sleep time to whatever value you find adequate. &lt;BR /&gt;&lt;BR /&gt;Save this code into a script, make it executable and run it as:&lt;BR /&gt;your_prog | this_script &amp;amp;&lt;BR /&gt;</description>
      <pubDate>Thu, 15 Feb 2001 13:00:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/two-processes-is-accessing-the-same-file-and-i-lose-infos/m-p/2494129#M19913</guid>
      <dc:creator>Dan Hetzel</dc:creator>
      <dc:date>2001-02-15T13:00:07Z</dc:date>
    </item>
    <item>
      <title>Re: two processes is accessing the same file and i lose infos</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/two-processes-is-accessing-the-same-file-and-i-lose-infos/m-p/2494130#M19914</link>
      <description>Hi again,&lt;BR /&gt;&lt;BR /&gt;I've hit the return key too quickly...&lt;BR /&gt;&lt;BR /&gt;I like Rik's suggestion ;-)&lt;BR /&gt;&lt;BR /&gt;Best regards,&lt;BR /&gt;&lt;BR /&gt;Dan&lt;BR /&gt;</description>
      <pubDate>Thu, 15 Feb 2001 13:02:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/two-processes-is-accessing-the-same-file-and-i-lose-infos/m-p/2494130#M19914</guid>
      <dc:creator>Dan Hetzel</dc:creator>
      <dc:date>2001-02-15T13:02:20Z</dc:date>
    </item>
  </channel>
</rss>

