<?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: SAS Object Spawner script wait a key in Administration and Deployment</title>
    <link>https://communities.sas.com/t5/Administration-and-Deployment/SAS-Object-Spawner-script-wait-a-key/m-p/712365#M21265</link>
    <description>&lt;P&gt;Yes it would just output everything to a file but it can solve the problem of hitting a key for script to exit or complete.&lt;/P&gt;</description>
    <pubDate>Tue, 19 Jan 2021 09:44:11 GMT</pubDate>
    <dc:creator>AnandVyas</dc:creator>
    <dc:date>2021-01-19T09:44:11Z</dc:date>
    <item>
      <title>SAS Object Spawner script wait a key</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/SAS-Object-Spawner-script-wait-a-key/m-p/711626#M21228</link>
      <description>&lt;P&gt;Hi all;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to make an entry in Rundeck to stop and start SAS Object Spawner&amp;nbsp; by operator if it is NOT UP after a weekly start.&lt;/P&gt;&lt;P&gt;My point is that&amp;nbsp;SAS Object Spawner is asking for a key and that is a mess.&lt;/P&gt;&lt;P&gt;I had tried to comment the wait commands, but it does not work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any idea?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is the current Object Spawner script:&lt;/P&gt;&lt;P&gt;#!/bin/sh -p&lt;BR /&gt;#&lt;BR /&gt;# ObjectSpawner.sh&lt;BR /&gt;#&lt;BR /&gt;# syslog Starts the SAS Object Spawner&lt;BR /&gt;#&lt;/P&gt;&lt;P&gt;# Uncomment the set -x to run in debug mode&lt;BR /&gt;# set -x&lt;/P&gt;&lt;P&gt;# Source level_env&lt;BR /&gt;. `dirname $0`/../level_env.sh&lt;/P&gt;&lt;P&gt;CONFIGDIR=$LEVEL_ROOT/ObjectSpawner&lt;/P&gt;&lt;P&gt;LOGSDIR=/work/sas/Lev4/ObjectSpawner/Logs&lt;BR /&gt;SASENV=$SASROOT/bin/sasenv&lt;BR /&gt;OMRCFG=$LEVEL_ROOT/ObjectSpawner/metadataConfig.xml&lt;BR /&gt;SPWNNAME="Object Spawner - sas94-t"&lt;BR /&gt;SERVERUSER=sasadm&lt;BR /&gt;CMD_OPTIONS=" -dnsmatch sas94-t.internal.epo.org -sspi "&lt;BR /&gt;COMMAND="$SASROOT/utilities/bin/objspawn"&lt;BR /&gt;SCRIPT=`basename $0`&lt;/P&gt;&lt;P&gt;if [ "$SAS_INSTALL_ROOT" = "" ] ; then&lt;BR /&gt;SAS_INSTALL_ROOT=$SASROOT&lt;BR /&gt;export SAS_INSTALL_ROOT&lt;BR /&gt;fi&lt;/P&gt;&lt;P&gt;# Are we super user&lt;BR /&gt;if id | grep "^uid=0(" &amp;gt;/dev/null 2&amp;gt;&amp;amp;1 ; then&lt;BR /&gt;root=1&lt;BR /&gt;else&lt;BR /&gt;root=0&lt;BR /&gt;fi&lt;/P&gt;&lt;P&gt;# If there is a keytab present for the object spawner, export it here&lt;BR /&gt;if [ -f "$CONFIGDIR/objspawn.keytab" ]; then&lt;BR /&gt;KRB5_CLIENT_KTNAME="$CONFIGDIR/objspawn.keytab"&lt;BR /&gt;export KRB5_CLIENT_KTNAME&lt;BR /&gt;fi&lt;/P&gt;&lt;P&gt;# Get argument&lt;BR /&gt;case "$1" in&lt;BR /&gt;start | -start)&lt;BR /&gt;if [ -f $CONFIGDIR/$SERVER_PID_FILE_NAME ]; then&lt;BR /&gt;pid=`cat $CONFIGDIR/$SERVER_PID_FILE_NAME`&lt;BR /&gt;kill -0 $pid &amp;gt; /dev/null 2&amp;gt;&amp;amp;1&lt;BR /&gt;if [ $? -eq 0 ]; then&lt;BR /&gt;echo "Spawner is already running (pid $pid)"&lt;BR /&gt;exit 0&lt;BR /&gt;fi&lt;BR /&gt;rm $CONFIGDIR/$SERVER_PID_FILE_NAME&lt;BR /&gt;fi&lt;BR /&gt;if [ $root -eq 1 ]; then&lt;BR /&gt;su - $SERVERUSER -c "$CONFIGDIR/$SCRIPT start2_tag &amp;amp;"&lt;BR /&gt;else&lt;BR /&gt;$CONFIGDIR/$SCRIPT start2_tag &amp;amp;&lt;BR /&gt;fi&lt;BR /&gt;;;&lt;BR /&gt;start2_tag)&lt;BR /&gt;cd $CONFIGDIR&lt;BR /&gt;. $SASENV&lt;BR /&gt;SASROOT=$SASROOT&lt;BR /&gt;export SASROOT&lt;/P&gt;&lt;P&gt;# Source usermods file&lt;BR /&gt;. $CONFIGDIR/ObjectSpawner_usermods.sh&lt;/P&gt;&lt;P&gt;eval "nohup $COMMAND $CMD_OPTIONS -sasSpawnerCn \"$SPWNNAME\" -xmlconfigfile $OMRCFG -logconfigloc $CONFIGDIR/logconfig.xml ${USERMODS}&amp;gt; $LOGSDIR/ObjectSpawner_console_sas94-t.log 2&amp;gt;&amp;amp;1 &amp;amp;"&lt;BR /&gt;pid=$!&lt;BR /&gt;echo $pid &amp;gt; $CONFIGDIR/$SERVER_PID_FILE_NAME&lt;BR /&gt;echo "Spawner is started (pid $pid)..."&lt;BR /&gt;# Trap signals 9 and 15 and pass on to child process&lt;BR /&gt;trap 'kill $pid' 2 3 15&lt;BR /&gt;wait $!&lt;BR /&gt;rm "$CONFIGDIR/$SERVER_PID_FILE_NAME"&lt;BR /&gt;echo "Spawner is stopped"&lt;BR /&gt;echo "Log files are located at: $LOGSDIR"&lt;BR /&gt;;;&lt;BR /&gt;stop | -stop)&lt;BR /&gt;if [ -f $CONFIGDIR/$SERVER_PID_FILE_NAME ]; then&lt;BR /&gt;pid=`cat $CONFIGDIR/$SERVER_PID_FILE_NAME`&lt;BR /&gt;kill $pid&lt;BR /&gt;if [ $? -ne 0 ]; then&lt;BR /&gt;echo "pid: $pid"&lt;BR /&gt;fi&lt;BR /&gt;else&lt;BR /&gt;echo "Spawner is stopped"&lt;BR /&gt;fi&lt;BR /&gt;;;&lt;BR /&gt;status | -status)&lt;BR /&gt;if [ -f $CONFIGDIR/$SERVER_PID_FILE_NAME ]; then&lt;BR /&gt;pid=`cat $CONFIGDIR/$SERVER_PID_FILE_NAME`&lt;BR /&gt;kill -0 $pid &amp;gt; /dev/null 2&amp;gt;&amp;amp;1&lt;BR /&gt;if [ $? -eq 0 ]; then&lt;BR /&gt;echo "Spawner is started (pid $pid)"&lt;BR /&gt;else&lt;BR /&gt;echo "Spawner is stopped"&lt;BR /&gt;fi&lt;BR /&gt;else&lt;BR /&gt;echo "Spawner is stopped"&lt;BR /&gt;fi&lt;BR /&gt;;;&lt;BR /&gt;restart | -restart)&lt;BR /&gt;$0 stop&lt;BR /&gt;if [ $? -eq 0 ]; then&lt;BR /&gt;sleep 5&lt;BR /&gt;$0 start&lt;BR /&gt;fi&lt;BR /&gt;;;&lt;BR /&gt;*)&lt;BR /&gt;echo "Usage: $SCRIPT {-}{start|stop|status|restart}"&lt;BR /&gt;exit 1&lt;BR /&gt;esac&lt;/P&gt;&lt;P&gt;exit 0&lt;/P&gt;</description>
      <pubDate>Fri, 15 Jan 2021 09:37:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/SAS-Object-Spawner-script-wait-a-key/m-p/711626#M21228</guid>
      <dc:creator>herborfer</dc:creator>
      <dc:date>2021-01-15T09:37:05Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Object Spawner script wait a key</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/SAS-Object-Spawner-script-wait-a-key/m-p/711663#M21232</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/313770"&gt;@herborfer&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What do you mean by asking for a key? parameter? sorry I did not get it. Could you share how are you trying to call the spawner command via RunDeck?&lt;/P&gt;</description>
      <pubDate>Fri, 15 Jan 2021 12:56:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/SAS-Object-Spawner-script-wait-a-key/m-p/711663#M21232</guid>
      <dc:creator>AnandVyas</dc:creator>
      <dc:date>2021-01-15T12:56:21Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Object Spawner script wait a key</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/SAS-Object-Spawner-script-wait-a-key/m-p/712357#M21262</link>
      <description>Before Rundeck, when we run the script on the console ( by "sh ObjectSpawner.sh" or ./ObjectSpawner.sh on the proper path ) it waits for key to end. When I press INTRO then it goes to the end.&lt;BR /&gt;That's a problem to be included in Rundeck.</description>
      <pubDate>Tue, 19 Jan 2021 09:14:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/SAS-Object-Spawner-script-wait-a-key/m-p/712357#M21262</guid>
      <dc:creator>herborfer</dc:creator>
      <dc:date>2021-01-19T09:14:52Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Object Spawner script wait a key</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/SAS-Object-Spawner-script-wait-a-key/m-p/712362#M21263</link>
      <description>&lt;P&gt;Ok, I get what you are referring to. How about using nohup before the start/stop command whichever way you are using it?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;nohup ./ObjectSpawner.sh stop

nohup ./ObjectSpawner.sh start&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 19 Jan 2021 09:23:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/SAS-Object-Spawner-script-wait-a-key/m-p/712362#M21263</guid>
      <dc:creator>AnandVyas</dc:creator>
      <dc:date>2021-01-19T09:23:28Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Object Spawner script wait a key</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/SAS-Object-Spawner-script-wait-a-key/m-p/712364#M21264</link>
      <description>it create a nohup.out file.&lt;BR /&gt;</description>
      <pubDate>Tue, 19 Jan 2021 09:42:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/SAS-Object-Spawner-script-wait-a-key/m-p/712364#M21264</guid>
      <dc:creator>herborfer</dc:creator>
      <dc:date>2021-01-19T09:42:13Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Object Spawner script wait a key</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/SAS-Object-Spawner-script-wait-a-key/m-p/712365#M21265</link>
      <description>&lt;P&gt;Yes it would just output everything to a file but it can solve the problem of hitting a key for script to exit or complete.&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jan 2021 09:44:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/SAS-Object-Spawner-script-wait-a-key/m-p/712365#M21265</guid>
      <dc:creator>AnandVyas</dc:creator>
      <dc:date>2021-01-19T09:44:11Z</dc:date>
    </item>
    <item>
      <title>Re: SAS Object Spawner script wait a key</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/SAS-Object-Spawner-script-wait-a-key/m-p/712383#M21266</link>
      <description>&lt;P&gt;Redirect the outputs to the bit bucket:&lt;/P&gt;
&lt;PRE&gt;nohup ./ObjectSpawner.sh stop &amp;gt;/dev/null 2&amp;gt;&amp;amp;1

nohup ./ObjectSpawner.sh start &amp;gt;/dev/null 2&amp;gt;&amp;amp;1&lt;/PRE&gt;</description>
      <pubDate>Tue, 19 Jan 2021 11:40:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/SAS-Object-Spawner-script-wait-a-key/m-p/712383#M21266</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-01-19T11:40:10Z</dc:date>
    </item>
  </channel>
</rss>

