<?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: rm : permission denied ? in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/rm-permission-denied/m-p/2868205#M97744</link>
    <description>Hi Steve,&lt;BR /&gt;&lt;BR /&gt;Can you post the code where the lock file gets created?&lt;BR /&gt;&lt;BR /&gt;JP&lt;BR /&gt;</description>
    <pubDate>Thu, 19 Dec 2002 21:30:13 GMT</pubDate>
    <dc:creator>John Poff</dc:creator>
    <dc:date>2002-12-19T21:30:13Z</dc:date>
    <item>
      <title>rm : permission denied ?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/rm-permission-denied/m-p/2868201#M97740</link>
      <description>Hi all&lt;BR /&gt;&lt;BR /&gt;I've been asked to look at a script to see why a lock file every now and then can't be removed. &lt;BR /&gt;&lt;BR /&gt;The line of code from the script is pretty straight forward. A user xxadmin creates the lock and then , when the ftp process is finished removes the file he created&lt;BR /&gt;&lt;BR /&gt;############################################&lt;BR /&gt;# Remove pincab_transfer locking mechanism #&lt;BR /&gt;############################################&lt;BR /&gt;remove_pincab_lock()&lt;BR /&gt;{&lt;BR /&gt;  if [ -f ${PINLOCK} ]; then&lt;BR /&gt;      rm -f ${PINLOCK} &amp;gt;&amp;gt; ${ERM} 2&amp;gt;&amp;amp;1&lt;BR /&gt;      res=$?&lt;BR /&gt;      if [ ${res} -ne 0 ]; then&lt;BR /&gt;          echo "  Failed to remove lock file ${PINLOCK} " &amp;gt;&amp;gt; ${ERM}&lt;BR /&gt;          app_mesg="Failed to remove lock file ${PINLOCK}"&lt;BR /&gt;          app_alert&lt;BR /&gt;      else&lt;BR /&gt;          echo "  Removed lock file ${PINLOCK}" &amp;gt;&amp;gt; ${ERM}&lt;BR /&gt;      fi&lt;BR /&gt;  fi&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;The problem isn't just on one server. The lock file is in /tmp&lt;BR /&gt;&lt;BR /&gt;drwxrwxrwx  136 root       sys          55296 Dec 19 22:10 /tmp&lt;BR /&gt;&lt;BR /&gt;The permissions on the file are&lt;BR /&gt;&lt;BR /&gt;-rw-rw-rw-   1 xxadmin    support          0 Dec 19 22:14 /tmp/pincab_lock&lt;BR /&gt;&lt;BR /&gt;The output from the log is&lt;BR /&gt;&lt;BR /&gt;Starting pincab_transfer (PID=3518) at 13:22:04&lt;BR /&gt;&lt;BR /&gt;  Created lock file /tmp/pincab.lock&lt;BR /&gt;  Config file has been read O.K.&lt;BR /&gt;  PING connection to 164.39.253.60 is available at 13:22:04&lt;BR /&gt;  Found 2 new file(s) for transmission&lt;BR /&gt;  Found 0 file(s) for re-transmission&lt;BR /&gt;  Attempting to send 2 file(s) in total&lt;BR /&gt;  Problems moving data from /tmp to /tmp/incab_hold&lt;BR /&gt;rm: /tmp/pincab.lock not removed.  Permission denied&lt;BR /&gt;  Failed to remove lock file /tmp/pincab.lock&lt;BR /&gt;&lt;BR /&gt;Any ideas ?&lt;BR /&gt;&lt;BR /&gt;Thanks in advance for any input&lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;&lt;BR /&gt;Steve&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 19 Dec 2002 21:21:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/rm-permission-denied/m-p/2868201#M97740</guid>
      <dc:creator>steven Burgess_2</dc:creator>
      <dc:date>2002-12-19T21:21:35Z</dc:date>
    </item>
    <item>
      <title>Re: rm : permission denied ?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/rm-permission-denied/m-p/2868202#M97741</link>
      <description>Since you are using FTP maybe the file hasn't completed transferring therefor it cannot be removed. If you notice during the ftp there are no file permissions until the file is completely transferred. Just a thought</description>
      <pubDate>Thu, 19 Dec 2002 21:27:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/rm-permission-denied/m-p/2868202#M97741</guid>
      <dc:creator>Ken Hubnik_2</dc:creator>
      <dc:date>2002-12-19T21:27:31Z</dc:date>
    </item>
    <item>
      <title>Re: rm : permission denied ?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/rm-permission-denied/m-p/2868203#M97742</link>
      <description>Hi Steven,&lt;BR /&gt;&lt;BR /&gt;A couple thoughts:&lt;BR /&gt;&lt;BR /&gt;1)  Does the "Problems moving data from /tmp to /tmp/incab_hold" possibly enter into this, or do you see that at other times.&lt;BR /&gt;&lt;BR /&gt;2)  Can you insert a ll of the file in question into the script right after the creation and right before the move?  &lt;BR /&gt;&lt;BR /&gt;It's a strange one all right.&lt;BR /&gt;&lt;BR /&gt;Pete&lt;BR /&gt;</description>
      <pubDate>Thu, 19 Dec 2002 21:28:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/rm-permission-denied/m-p/2868203#M97742</guid>
      <dc:creator>Pete Randall</dc:creator>
      <dc:date>2002-12-19T21:28:33Z</dc:date>
    </item>
    <item>
      <title>Re: rm : permission denied ?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/rm-permission-denied/m-p/2868204#M97743</link>
      <description>Hi&lt;BR /&gt;&lt;BR /&gt;The file is created before the process then removed after checks have been made that the ftp is completed, therefore isn't actually part of the ftp &lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;&lt;BR /&gt;Steve</description>
      <pubDate>Thu, 19 Dec 2002 21:29:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/rm-permission-denied/m-p/2868204#M97743</guid>
      <dc:creator>steven Burgess_2</dc:creator>
      <dc:date>2002-12-19T21:29:56Z</dc:date>
    </item>
    <item>
      <title>Re: rm : permission denied ?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/rm-permission-denied/m-p/2868205#M97744</link>
      <description>Hi Steve,&lt;BR /&gt;&lt;BR /&gt;Can you post the code where the lock file gets created?&lt;BR /&gt;&lt;BR /&gt;JP&lt;BR /&gt;</description>
      <pubDate>Thu, 19 Dec 2002 21:30:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/rm-permission-denied/m-p/2868205#M97744</guid>
      <dc:creator>John Poff</dc:creator>
      <dc:date>2002-12-19T21:30:13Z</dc:date>
    </item>
    <item>
      <title>Re: rm : permission denied ?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/rm-permission-denied/m-p/2868206#M97745</link>
      <description>Hi Pete&lt;BR /&gt;&lt;BR /&gt;Thats what I was looking at also. I fetched all the logs from all the servers from today but only found one instance of the failure, so couldn't see if there was a pattern. Something to think about though&lt;BR /&gt;&lt;BR /&gt;I'll put an ll in the script also&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;&lt;BR /&gt;Steve</description>
      <pubDate>Thu, 19 Dec 2002 21:32:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/rm-permission-denied/m-p/2868206#M97745</guid>
      <dc:creator>steven Burgess_2</dc:creator>
      <dc:date>2002-12-19T21:32:49Z</dc:date>
    </item>
    <item>
      <title>Re: rm : permission denied ?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/rm-permission-denied/m-p/2868207#M97746</link>
      <description>Here it is&lt;BR /&gt;&lt;BR /&gt;check_pincab_running()&lt;BR /&gt;{&lt;BR /&gt;  REMOVE_PINLOCK='N'&lt;BR /&gt;&lt;BR /&gt;  if [ -f /lock.pro ]; then&lt;BR /&gt;      echo "  Detected housekeeping is running" &amp;gt;&amp;gt; ${ERM}&lt;BR /&gt;      exit_program&lt;BR /&gt;  fi&lt;BR /&gt;&lt;BR /&gt;  if [ -f /lock.out ]; then&lt;BR /&gt;      echo "  Detected the machine is about to reboot" &amp;gt;&amp;gt; ${ERM}&lt;BR /&gt;      exit_program&lt;BR /&gt;  fi&lt;BR /&gt;&lt;BR /&gt;  if [ -f /lock.bkup ]; then&lt;BR /&gt;      echo "  Detected backup is running" &amp;gt;&amp;gt; ${ERM}&lt;BR /&gt;      exit_program&lt;BR /&gt;  fi&lt;BR /&gt;&lt;BR /&gt;  if [ -f ${PINLOCK} ]; then&lt;BR /&gt;      echo "  Detected ${PINLOCK} - assuming ${PROGRAM} already running" &amp;gt;&amp;gt; ${ER&lt;BR /&gt;M}      &lt;BR /&gt;exit_program&lt;BR /&gt;  else&lt;BR /&gt;      (touch ${PINLOCK} 2&amp;gt;&amp;amp;1) &amp;gt; /dev/null&lt;BR /&gt;      res=$?&lt;BR /&gt;      if [ ${res} -ne 0 ]; then&lt;BR /&gt;          echo "  Failed to create pincab lock file - ${PINLOCK}" &amp;gt;&amp;gt; ${ERM}&lt;BR /&gt;          exit_program&lt;BR /&gt;      fi&lt;BR /&gt;&lt;BR /&gt;      echo "  Created lock file ${PINLOCK}" &amp;gt;&amp;gt; ${ERM}&lt;BR /&gt;  fi&lt;BR /&gt;&lt;BR /&gt;The things is , it works 99% of the time , then every now and again fails&lt;BR /&gt;&lt;BR /&gt;bizarre&lt;BR /&gt;&lt;BR /&gt;Steve</description>
      <pubDate>Thu, 19 Dec 2002 21:39:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/rm-permission-denied/m-p/2868207#M97746</guid>
      <dc:creator>steven Burgess_2</dc:creator>
      <dc:date>2002-12-19T21:39:55Z</dc:date>
    </item>
    <item>
      <title>Re: rm : permission denied ?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/rm-permission-denied/m-p/2868208#M97747</link>
      <description>Steve,&lt;BR /&gt;&lt;BR /&gt;Admittedly, my scripting skills aren't the strongest but it looks good to me.  I'm hoping the before and after "ll's" will give us a hint (though I think it's something a little more obtuse).  You're right, it's bizarre.&lt;BR /&gt;&lt;BR /&gt;Pete</description>
      <pubDate>Thu, 19 Dec 2002 21:47:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/rm-permission-denied/m-p/2868208#M97747</guid>
      <dc:creator>Pete Randall</dc:creator>
      <dc:date>2002-12-19T21:47:38Z</dc:date>
    </item>
    <item>
      <title>Re: rm : permission denied ?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/rm-permission-denied/m-p/2868209#M97748</link>
      <description>Hmm,&lt;BR /&gt;&lt;BR /&gt;You could perhaps add&lt;BR /&gt;&lt;BR /&gt;fuser -u $PINLOCK&lt;BR /&gt;&lt;BR /&gt;to your script to check if another process has locked the file.&lt;BR /&gt;&lt;BR /&gt;Perhaps even&lt;BR /&gt;&lt;BR /&gt;rm -f ${PINLOCK} &amp;gt;&amp;gt; ${ERM} 2&amp;gt;&amp;amp;1 &lt;BR /&gt;while (( $? != 0 ))&lt;BR /&gt;do&lt;BR /&gt;  echo "Can't remove file"&lt;BR /&gt;  fuser -u $PINLOCK&lt;BR /&gt;  sleep 10&lt;BR /&gt;  rm -f ${PINLOCK} &amp;gt;&amp;gt; ${ERM} 2&amp;gt;&amp;amp;1&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;But this will hang the script until it's able to delete the file :-) Not sure if you would want to do that...&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;Vincent&lt;BR /&gt;</description>
      <pubDate>Thu, 19 Dec 2002 22:11:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/rm-permission-denied/m-p/2868209#M97748</guid>
      <dc:creator>Vincent Stedema</dc:creator>
      <dc:date>2002-12-19T22:11:40Z</dc:date>
    </item>
    <item>
      <title>Re: rm : permission denied ?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/rm-permission-denied/m-p/2868210#M97749</link>
      <description>Hi Steve,&lt;BR /&gt;&lt;BR /&gt;Just curious, keep the line&lt;BR /&gt;&lt;BR /&gt;ll ${PINLOCK}&lt;BR /&gt;&lt;BR /&gt;before rm -f statement in your script.&lt;BR /&gt;&lt;BR /&gt;See what you would know everytime they complaied about it.&lt;BR /&gt;&lt;BR /&gt;-Sri</description>
      <pubDate>Thu, 19 Dec 2002 23:02:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/rm-permission-denied/m-p/2868210#M97749</guid>
      <dc:creator>Sridhar Bhaskarla</dc:creator>
      <dc:date>2002-12-19T23:02:30Z</dc:date>
    </item>
    <item>
      <title>Re: rm : permission denied ?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/rm-permission-denied/m-p/2868211#M97750</link>
      <description>Hi&lt;BR /&gt;&lt;BR /&gt;This is what I have come up with to check    &lt;BR /&gt;&lt;BR /&gt;exit_program&lt;BR /&gt;else&lt;BR /&gt;    (touch ${PINLOCK} 2&amp;gt;&amp;amp;1) &amp;gt; /dev/null&lt;BR /&gt;    ll ${PINLOCK} &amp;gt;&amp;gt; ${ERM}&lt;BR /&gt;&lt;BR /&gt;And&lt;BR /&gt;&lt;BR /&gt;remove_pincab_lock()&lt;BR /&gt;{&lt;BR /&gt;  if [ -f ${PINLOCK} ]; then&lt;BR /&gt;      rm -f ${PINLOCK} &amp;gt;&amp;gt; ${ERM} 2&amp;gt;&amp;amp;1&lt;BR /&gt;      res=$?&lt;BR /&gt;      if [ ${res} -ne 0 ]; then&lt;BR /&gt;      ll ${PINLOCK} &amp;gt;&amp;gt; ${ERM} 2&amp;gt;&amp;amp;1&lt;BR /&gt;      sudo fuser -u ${PINLOCK} 2&amp;gt;&amp;amp;1| tr [")"] ["\n"] | grep \( |cut -d\( -f1 | t&lt;BR /&gt;r [":"] ["\n"] | egrep '[0-9][0-9][0-9]?' | tr ["o"] [" "] &amp;gt; /tmp/pinlock.pid&lt;BR /&gt;      for i in $(      do&lt;BR /&gt;      dpd $i &amp;gt;&amp;gt; ${ERM} 2&amp;gt;&amp;amp;1&lt;BR /&gt;      done&lt;BR /&gt;          echo "  Failed to remove lock file ${PINLOCK} " &amp;gt;&amp;gt; ${ERM}&lt;BR /&gt;&lt;BR /&gt;The dpd is a small c prog to give full details of the pid and parents&lt;BR /&gt;&lt;BR /&gt;I'll wait and see&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;&lt;BR /&gt;Steve&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 20 Dec 2002 08:24:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/rm-permission-denied/m-p/2868211#M97750</guid>
      <dc:creator>steven Burgess_2</dc:creator>
      <dc:date>2002-12-20T08:24:01Z</dc:date>
    </item>
    <item>
      <title>Re: rm : permission denied ?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/rm-permission-denied/m-p/2868212#M97751</link>
      <description>Few day ago i was amazed when as root i do a rm file and get permision denied. &lt;BR /&gt;&lt;BR /&gt;The cuestion is the path i used was a symbolic link to a NFS mounted filesystem. I had to cd to original NFS mount point to remove the file.&lt;BR /&gt;&lt;BR /&gt;HTH.</description>
      <pubDate>Fri, 20 Dec 2002 11:20:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/rm-permission-denied/m-p/2868212#M97751</guid>
      <dc:creator>Carlos Fernandez Riera</dc:creator>
      <dc:date>2002-12-20T11:20:11Z</dc:date>
    </item>
    <item>
      <title>Re: rm : permission denied ?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/rm-permission-denied/m-p/2868213#M97752</link>
      <description>hi,&lt;BR /&gt;&lt;BR /&gt;Perhaps your problem is related to /tmp mode. I've seen some system with S_ISVTX set on /tmp (ie drwxrwxrwt). In this case, anyone can create a file, but only the owner or root can delete it. From man 2 chmod :&lt;BR /&gt;&lt;BR /&gt;If the mode bit S_ISVTX (sticky bit) is set on a directory, files inside the directory may be renamed or removed only by the owner of the file, the owner of the directory, or the superuser (even if the modes of the directory would otherwise allow such an operation).&lt;BR /&gt;&lt;BR /&gt;Regards.</description>
      <pubDate>Fri, 20 Dec 2002 14:40:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/rm-permission-denied/m-p/2868213#M97752</guid>
      <dc:creator>Jean-Louis Phelix</dc:creator>
      <dc:date>2002-12-20T14:40:01Z</dc:date>
    </item>
  </channel>
</rss>

