5.1 and Pervasive SQL in Linux Emu (7) -> tty stopped output

From: Karl M. Joch (k.joch_at_kmjeuro.com)
Date: 07/26/03

  • Next message: Mark Blackman: "Re: device driver memory leak in 5.1-20030726?"
    Date: Sat, 26 Jul 2003 22:21:01 +0200
    To: freebsd-current@freebsd.org
    
    

    the following script starts psql without problems on 4.8 with linux base
    6. with 5.1 and linux base 7 it looks like su hangs. scripts doenst
    complete and ends with tty output stopped.

    there is also something very strange: when starting pervasive in
    forground mode i get a listener and it works. when starting into
    background (manually without the following script) i dont get a listener
    opened. persavice thinks it is open, at least there is no entry in any
    log but netstat -rn doesnt show a listener.

    #!/compat/linux/bin/sh
    #
    # description: Starts and stops the Pervasive mkded and sqlmgr daemons

    # chkconfig: 2345 92 92

    start_psql(){
            echo "Starting Pervasive services: "
            SQLID=`/bin/ps ax | grep -v grep | grep sqlmgr | awk '{print $1}'`
            BTRID=`/bin/ps ax | grep -v grep | grep mkded | awk '{print $1}'`
            if [ "X$BTRID" != "X" -o "X$SQLID" != "X" ] ; then
                    echo Warning: the following service is running
                    if [ "X$BTRID" != "X" ] ; then
                            echo mkded
                    fi
                    if [ "X$SQLID" != "X" ] ; then
                            echo sqlmgr
                    fi
                    echo
            fi
            echo mkded
            echo "cd $PVSW_ROOT/bin; . $PVSW_ROOT/bin/.bash_profile ; ./mkded
    -start" | /usr/bin/su - psql || exit 1
            echo sqlmgr
            echo "cd $PVSW_ROOT/bin; . $PVSW_ROOT/bin/.bash_profile ; ./sqlmgr
    -start" | /usr/bin/su - psql || exit 1
            touch /var/lock/subsys/psql
            echo ""
    }

    stop_psql(){
            echo "Shutting down Pervasive services: "
            SQLID=`/bin/ps ax | grep -v grep | grep sqlmgr | awk '{print $1}'`
            if [ "X$SQLID" != "X" ] ; then
                    echo sqlmgr
                    if [ -x /usr/local/psql/bin/sqlmgr ] ; then
                            echo "cd $PVSW_ROOT/bin; . $PVSW_ROOT/bin/.bash_profile ; ./sqlmgr
    -stop" | /usr/bin/su - psql
                    else
                            kill -9 $SQLID
                    fi
            fi
            BTRID=`/bin/ps ax | grep -v grep | grep mkded | awk '{print $1}'`
            if [ "X$BTRID" != "X" ] ; then
                    echo mkded
                    if [ -x /usr/local/psql/bin/mkded ] ; then
                            echo "cd $PVSW_ROOT/bin; . $PVSW_ROOT/bin/.bash_profile ; ./mkded
    -stop" | /usr/bin/su - psql
                    else
                            kill -9 $BTRID
                    fi
            fi
            echo ""
            rm -f /var/lock/subsys/psql
    }

    force_psql(){
            if [ -x $PVSW_ROOT/bin/mkded ] ; then
                    echo "Clearing Pervasive shared memory: "
                    echo "cd $PVSW_ROOT/bin; . $PVSW_ROOT/bin/.bash_profile ; ./mkded
    -force" | /bin/su - psql
            fi

            # jme 27791
            MEMORY=`ipcs -m | grep psql | awk '{print $2}' | tr -d "psql "`
            if [ "X$MEMORY" != "X" ] ; then
                    for i in $MEMORY ; do
                            ipcrm shm $i
                    done
            fi

            echo "Clearing semaphores: "
            SEMAFORES=`ipcs -s | grep psql | awk '{print $2}' | tr -d "psql "`
            if [ "X$SEMAFORES" != "X" ] ; then
                    for i in $SEMAFORES ; do
                            ipcrm sem $i
                    done
            fi

            # ayahin: defect 33091
            SQLID=`/bin/ps ax | grep -v grep | grep sqlmgr | awk '{print $1}'`
            BTRID=`/bin/ps ax | grep -v grep | grep mkded | awk '{print $1}'`
            if [ "X$SQLID" != "X" ] ; then
                    echo sqlmgr
                    kill -9 $SQLID
            fi
            if [ "X$BTRID" != "X" ] ; then
                    echo mkded
                    kill -9 $BTRID
            fi

            echo ""
    }

    # Setting up environment
    PVSW_ROOT=/usr/local/psql
    PATH=$PVSW_ROOT/bin:$PATH
    LD_LIBRARY_PATH=$PVSW_ROOT/lib
    cd $PVSW_ROOT/bin

    case "$1" in
       start)
            start_psql
            ;;
       stop)
            stop_psql
            ;;
       force)
            stop_psql
            force_psql
            ;;
       restart)
            echo "Restarting Pervasive services: "
            stop_psql
            start_psql
            echo "done."
            ;;
       *)
            echo "Usage: psql {start|stop|force|restart}"
            exit 1
    esac

    _______________________________________________
    freebsd-current@freebsd.org mailing list
    http://lists.freebsd.org/mailman/listinfo/freebsd-current
    To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org"


  • Next message: Mark Blackman: "Re: device driver memory leak in 5.1-20030726?"

    Relevant Pages

    • background process/command in a script
      ... otherwise the listener just hangs. ... My issue is that I have to put this in as the startup script for a VCS ... echo "Starting MQ Listener for $on port ...
      (SunManagers)
    • Re: Win32::Process - Limiting the number of processes launched from within a script
      ... > on the script server. ... I might try writing a listener that I could put ... on every end point that listened on say port 9010 (or some other ... some other port) to handle replies to requests sent to the listener port ...
      (comp.lang.perl.misc)
    • Re: Problem with automatic startup
      ... I have a problem with database automatic startup. ... exactly database but listener. ... I've created dbora script that looks like this: ...
      (comp.databases.oracle.server)
    • Re: vwait
      ... listener running as the rest of my script is running. ... run scripts that will send messages to socket listener from multiple ...
      (comp.lang.tcl)
    • Re: Solaris 10 System Boot and Database Startup
      ... On a Solaris 10 system I am unable to get my Oracle 10 ... listener to start using a technique that I commonly use on Solaris 8 ... Can anyone please share your Sun UNIX script that starts your Oracle ...
      (comp.databases.oracle.server)