<?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: the dreaded tty in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/the-dreaded-tty/m-p/2890351#M102748</link>
    <description>cron jobs don't run with a terminal or stty settings.&lt;BR /&gt;&lt;BR /&gt;If you want to make those messages go away, your script needs a TERM setting such as &lt;BR /&gt;&lt;BR /&gt;TERM=vt100&lt;BR /&gt;export TERM&lt;BR /&gt;&lt;BR /&gt;and a few of your stty settings as well.&lt;BR /&gt;&lt;BR /&gt;You don't have to do anything about such messages though.&lt;BR /&gt;&lt;BR /&gt;I am not able to understand your objective from your post. &lt;BR /&gt;&lt;BR /&gt;P</description>
    <pubDate>Fri, 24 Jan 2003 14:18:15 GMT</pubDate>
    <dc:creator>Steven E. Protter</dc:creator>
    <dc:date>2003-01-24T14:18:15Z</dc:date>
    <item>
      <title>the dreaded tty</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/the-dreaded-tty/m-p/2890349#M102746</link>
      <description>hi, &lt;BR /&gt;i'm running a script on HPUX 11 (not 11i) from the root crontab which has to switch users at one point to call a database script... i can redirect the output to /dev/null or what have you, but i'm still getting a mail telling me:&lt;BR /&gt;ttytype: could not open /dev/tty for reading&lt;BR /&gt;stty: not a typewriter&lt;BR /&gt;&lt;BR /&gt;i've tried entering in the root and other user's profile &lt;BR /&gt;&lt;BR /&gt;if [[ -t 0 ]];&lt;BR /&gt;then mesg -n&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;but this doesn't have any effect... i also tested using &lt;BR /&gt;&lt;BR /&gt;if [[ -t 0 ]];&lt;BR /&gt;then echo "hello\n"&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;but this doesn't show up in the output mail... but if i run the script from the command line with &lt;BR /&gt;&lt;BR /&gt;if [[ -t 1 ]];&lt;BR /&gt;then echo "hi\n"&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;i see this in standard output...&lt;BR /&gt;&lt;BR /&gt;can anyone give me some advise?&lt;BR /&gt;&lt;BR /&gt;thanks in advance&lt;BR /&gt;&lt;BR /&gt;jerome&lt;BR /&gt;&lt;BR /&gt;i did run a te</description>
      <pubDate>Fri, 24 Jan 2003 14:07:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/the-dreaded-tty/m-p/2890349#M102746</guid>
      <dc:creator>Jerome Salyers</dc:creator>
      <dc:date>2003-01-24T14:07:43Z</dc:date>
    </item>
    <item>
      <title>Re: the dreaded tty</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/the-dreaded-tty/m-p/2890350#M102747</link>
      <description>You could check these.&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://bizforums.itrc.hp.com/cm/QuestionAnswer/1,,0xd7983a1c04ffd61190050090279cd0f9,00.html" target="_blank"&gt;http://bizforums.itrc.hp.com/cm/QuestionAnswer/1,,0xd7983a1c04ffd61190050090279cd0f9,00.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Kind regards,&lt;BR /&gt;&lt;BR /&gt;Robert-Jan.</description>
      <pubDate>Fri, 24 Jan 2003 14:10:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/the-dreaded-tty/m-p/2890350#M102747</guid>
      <dc:creator>Robert-Jan Goossens</dc:creator>
      <dc:date>2003-01-24T14:10:14Z</dc:date>
    </item>
    <item>
      <title>Re: the dreaded tty</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/the-dreaded-tty/m-p/2890351#M102748</link>
      <description>cron jobs don't run with a terminal or stty settings.&lt;BR /&gt;&lt;BR /&gt;If you want to make those messages go away, your script needs a TERM setting such as &lt;BR /&gt;&lt;BR /&gt;TERM=vt100&lt;BR /&gt;export TERM&lt;BR /&gt;&lt;BR /&gt;and a few of your stty settings as well.&lt;BR /&gt;&lt;BR /&gt;You don't have to do anything about such messages though.&lt;BR /&gt;&lt;BR /&gt;I am not able to understand your objective from your post. &lt;BR /&gt;&lt;BR /&gt;P</description>
      <pubDate>Fri, 24 Jan 2003 14:18:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/the-dreaded-tty/m-p/2890351#M102748</guid>
      <dc:creator>Steven E. Protter</dc:creator>
      <dc:date>2003-01-24T14:18:15Z</dc:date>
    </item>
    <item>
      <title>Re: the dreaded tty</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/the-dreaded-tty/m-p/2890352#M102749</link>
      <description>hi, steve...&lt;BR /&gt;&lt;BR /&gt;the objective is stop mails that have only the message&lt;BR /&gt;&lt;BR /&gt;ttytype: could not...&lt;BR /&gt;stty: Not a type...&lt;BR /&gt;&lt;BR /&gt;in them... i have a mail server that receives mails from over 100 different servers who are all running similar cron jobs and if i'm getting 7 or 8 mails per server per day, all filled with this message, it's tedious... &lt;BR /&gt;&lt;BR /&gt;besides, i feel that getting rid of the reason for the mails is much cleaner than just filtering them out...&lt;BR /&gt;&lt;BR /&gt;thanks for your reply...&lt;BR /&gt;&lt;BR /&gt;jerome</description>
      <pubDate>Fri, 24 Jan 2003 14:26:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/the-dreaded-tty/m-p/2890352#M102749</guid>
      <dc:creator>Jerome Salyers</dc:creator>
      <dc:date>2003-01-24T14:26:53Z</dc:date>
    </item>
    <item>
      <title>Re: the dreaded tty</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/the-dreaded-tty/m-p/2890353#M102750</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Your idea is correct, but stty errors go to error descriptor.&lt;BR /&gt;&lt;BR /&gt;This one generates a mail :&lt;BR /&gt;&lt;BR /&gt;at now &amp;lt;&amp;lt;+++&lt;BR /&gt;su - user -c date &amp;gt; /tmp/out&lt;BR /&gt;+++&lt;BR /&gt;&lt;BR /&gt;While this one (with error descriptor closed) doesn't :&lt;BR /&gt;&lt;BR /&gt;at now &amp;lt;&amp;lt;+++&lt;BR /&gt;su - user -c date &amp;gt; /tmp/out 2&amp;gt;&amp;amp;-&lt;BR /&gt;+++&lt;BR /&gt;&lt;BR /&gt;Regards</description>
      <pubDate>Fri, 24 Jan 2003 14:54:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/the-dreaded-tty/m-p/2890353#M102750</guid>
      <dc:creator>Jean-Louis Phelix</dc:creator>
      <dc:date>2003-01-24T14:54:45Z</dc:date>
    </item>
    <item>
      <title>Re: the dreaded tty</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/the-dreaded-tty/m-p/2890354#M102751</link>
      <description>I've said it before, and I'll say it again... I'm not a fan of using 'su - user -c cmd' in scripts when you can just do an 'su user -c cmd'&lt;BR /&gt;&lt;BR /&gt;There's a couple of good reasons for this:&lt;BR /&gt;&lt;BR /&gt;1. You don't get any irritating tty messages!&lt;BR /&gt;&lt;BR /&gt;2. Your script doesn't stop working when the user adds something stupid to his .profile (like a menu!) or changes something in it.&lt;BR /&gt;&lt;BR /&gt;'But I need the users environment variables' is the usual response to this suggestion... well just set em and export em before you call su.&lt;BR /&gt;&lt;BR /&gt;So typically:&lt;BR /&gt;&lt;BR /&gt;su - oracle -c "startdb.sh"&lt;BR /&gt;&lt;BR /&gt;becomes:&lt;BR /&gt;&lt;BR /&gt;export ORACLE_HOME=/oracle&lt;BR /&gt;export ORACLE_SID=PRD&lt;BR /&gt;su oracle -c "startdb.sh"&lt;BR /&gt;&lt;BR /&gt;or something like that anyway...&lt;BR /&gt;&lt;BR /&gt;I know your not on 11i but just be aware of this gotcha with 11i su command:&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;On HP-UX 11i there is an enhancement to the security mechanism of the su command which means that the environment variables LD_LIBRARY_PATH, SHLIB_PATH and LD_PRELOAD are not exported to the child process. There are two ways to get around this without resorting to using ???su ??? user ???c cmd???:&lt;BR /&gt;1. Just reset the environment variable, e.g:&lt;BR /&gt;su oracle ???c ???startora.sh???&lt;BR /&gt;becomes:&lt;BR /&gt;su oracle ???c ???export SHLIB_PATH=${SHLIB_PATH};startora.sh&lt;BR /&gt;2. or install patch PHCO_27781. This introduces a parameter SU_KEEP_ENV_VARS in the file /etc/default/security. Adding the following line to /etc/default/security would make su behave like it did in 11.00 and 10.20:&lt;BR /&gt;SU_KEEP_ENV_VARS=LD_LIBRARY_PATH,SHLIB_PATH,LD_PRELOAD&lt;BR /&gt;&lt;BR /&gt;HTH&lt;BR /&gt;&lt;BR /&gt;Duncan</description>
      <pubDate>Fri, 24 Jan 2003 15:17:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/the-dreaded-tty/m-p/2890354#M102751</guid>
      <dc:creator>Duncan Edmonstone</dc:creator>
      <dc:date>2003-01-24T15:17:12Z</dc:date>
    </item>
  </channel>
</rss>

