<?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: Peculiar Custom LP Spooler Script Problem in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/peculiar-custom-lp-spooler-script-problem/m-p/3257829#M176502</link>
    <description>The newgrp command was a good idea but id did not work. Interestingly, I ran newgrp just before the end of the if-then tree followed by an "echo $? &amp;gt; /../errors" and the lp script ran up only to the newgrp command and bombed out not showing the error but the print job was deleted anyway. Below is a test script which works as explained previously except for chgrp groupX. This was added as a printer using 'lpshut; lpadmin -p nowork -i/tmp/nowork.sh -v/dev/null;lpsched'&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;&lt;BR /&gt;JOBID=$1&lt;BR /&gt;USER=$2&lt;BR /&gt;TITLE=$3&lt;BR /&gt;COPIES=$4&lt;BR /&gt;OPTIONS=$5&lt;BR /&gt;OPT=$6&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;SOME_AREA=/tmp&lt;BR /&gt;&lt;BR /&gt;if [ ! -d ${SOME_AREA}/${USER} ]&lt;BR /&gt;&lt;BR /&gt;then&lt;BR /&gt;&lt;BR /&gt;   mkdir ${SOME_AREA}/${USER}&lt;BR /&gt;        echo "Err $? #1" &amp;gt;&amp;gt; ${SOME_AREA}/${USER}/errors&lt;BR /&gt;   mkdir ${SOME_AREA}/${USER}/backup&lt;BR /&gt;        echo "Err $? #2" &amp;gt;&amp;gt; ${SOME_AREA}/${USER}/errors&lt;BR /&gt;   chgrp -R ematrix ${SOME_AREA}/${USER}&lt;BR /&gt;        echo "Err $? #3" &amp;gt;&amp;gt; ${SOME_AREA}/${USER}/errors&lt;BR /&gt;   chmod 775 ${SOME_AREA}/${USER}&lt;BR /&gt;        echo "Err $? #4" &amp;gt;&amp;gt; ${SOME_AREA}/${USER}/errors&lt;BR /&gt;        whoami &amp;gt;&amp;gt; ${SOME_AREA}/${USER}/errors&lt;BR /&gt;        # next 2 lines were rec. test&lt;BR /&gt;        newgrp groupX&lt;BR /&gt;        echo "Err $? #5" &amp;gt;&amp;gt; ${SOME_AREA}/${USER}/errors # never makes it to file&lt;BR /&gt;&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;exit 0</description>
    <pubDate>Fri, 23 Apr 2004 15:57:55 GMT</pubDate>
    <dc:creator>Clay Jordan</dc:creator>
    <dc:date>2004-04-23T15:57:55Z</dc:date>
    <item>
      <title>Peculiar Custom LP Spooler Script Problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/peculiar-custom-lp-spooler-script-problem/m-p/3257827#M176500</link>
      <description>A custom lp script performs the following functions:&lt;BR /&gt;&lt;BR /&gt;if [ ! -d ${SOME_AREA}/${USER} ]&lt;BR /&gt;then&lt;BR /&gt;   mkdir ${SOME_AREA}/${USER}&lt;BR /&gt;   mkdir ${SOME_AREA}/${USER}/backup&lt;BR /&gt;   chgrp -R groupX ${SOME_AREA}/${USER}&lt;BR /&gt;   chmod 775 ${SOME_AREA}/${USER}&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;Running as a spooled job (i.e the lp user), the script can create the dirs and chmod them but not change the group. If I run this script as lp from the shell, it can. I added some entries to log what was happening notably&lt;BR /&gt;&lt;BR /&gt;echo "$?" &amp;gt;&amp;gt; ${SOME_AREA}/${USER}/errors&lt;BR /&gt;and&lt;BR /&gt;whoami &amp;gt;&amp;gt; ${SOME_AREA}/${USER}/errors&lt;BR /&gt;&lt;BR /&gt;These show that it is execing as the "lp" user and that there and it returns 1 for the error. Of course, lp is a member of groupX but it is not its primary group. Any ideas ?</description>
      <pubDate>Fri, 23 Apr 2004 11:02:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/peculiar-custom-lp-spooler-script-problem/m-p/3257827#M176500</guid>
      <dc:creator>Clay Jordan</dc:creator>
      <dc:date>2004-04-23T11:02:58Z</dc:date>
    </item>
    <item>
      <title>Re: Peculiar Custom LP Spooler Script Problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/peculiar-custom-lp-spooler-script-problem/m-p/3257828#M176501</link>
      <description>After mkdir ${SOME_AREA}/${USER}/backup&lt;BR /&gt;&lt;BR /&gt;do &lt;BR /&gt;&lt;BR /&gt;newgrp "groupX" -- This make lp's primary group - groupx&lt;BR /&gt;chmod statement&lt;BR /&gt;newgrp "xx" (lp's original primary group)&lt;BR /&gt;&lt;BR /&gt;Anil&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 23 Apr 2004 11:16:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/peculiar-custom-lp-spooler-script-problem/m-p/3257828#M176501</guid>
      <dc:creator>RAC_1</dc:creator>
      <dc:date>2004-04-23T11:16:30Z</dc:date>
    </item>
    <item>
      <title>Re: Peculiar Custom LP Spooler Script Problem</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/peculiar-custom-lp-spooler-script-problem/m-p/3257829#M176502</link>
      <description>The newgrp command was a good idea but id did not work. Interestingly, I ran newgrp just before the end of the if-then tree followed by an "echo $? &amp;gt; /../errors" and the lp script ran up only to the newgrp command and bombed out not showing the error but the print job was deleted anyway. Below is a test script which works as explained previously except for chgrp groupX. This was added as a printer using 'lpshut; lpadmin -p nowork -i/tmp/nowork.sh -v/dev/null;lpsched'&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;&lt;BR /&gt;JOBID=$1&lt;BR /&gt;USER=$2&lt;BR /&gt;TITLE=$3&lt;BR /&gt;COPIES=$4&lt;BR /&gt;OPTIONS=$5&lt;BR /&gt;OPT=$6&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;SOME_AREA=/tmp&lt;BR /&gt;&lt;BR /&gt;if [ ! -d ${SOME_AREA}/${USER} ]&lt;BR /&gt;&lt;BR /&gt;then&lt;BR /&gt;&lt;BR /&gt;   mkdir ${SOME_AREA}/${USER}&lt;BR /&gt;        echo "Err $? #1" &amp;gt;&amp;gt; ${SOME_AREA}/${USER}/errors&lt;BR /&gt;   mkdir ${SOME_AREA}/${USER}/backup&lt;BR /&gt;        echo "Err $? #2" &amp;gt;&amp;gt; ${SOME_AREA}/${USER}/errors&lt;BR /&gt;   chgrp -R ematrix ${SOME_AREA}/${USER}&lt;BR /&gt;        echo "Err $? #3" &amp;gt;&amp;gt; ${SOME_AREA}/${USER}/errors&lt;BR /&gt;   chmod 775 ${SOME_AREA}/${USER}&lt;BR /&gt;        echo "Err $? #4" &amp;gt;&amp;gt; ${SOME_AREA}/${USER}/errors&lt;BR /&gt;        whoami &amp;gt;&amp;gt; ${SOME_AREA}/${USER}/errors&lt;BR /&gt;        # next 2 lines were rec. test&lt;BR /&gt;        newgrp groupX&lt;BR /&gt;        echo "Err $? #5" &amp;gt;&amp;gt; ${SOME_AREA}/${USER}/errors # never makes it to file&lt;BR /&gt;&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;exit 0</description>
      <pubDate>Fri, 23 Apr 2004 15:57:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/peculiar-custom-lp-spooler-script-problem/m-p/3257829#M176502</guid>
      <dc:creator>Clay Jordan</dc:creator>
      <dc:date>2004-04-23T15:57:55Z</dc:date>
    </item>
  </channel>
</rss>

