[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference smurf::ase

Title:ase
Moderator:SMURF::GROSSO
Created:Thu Jul 29 1993
Last Modified:Fri Jun 06 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:2114
Total number of notes:7347

1909.0. "how to read user input in start script" by HGOSPS::MICKWIDLAM () Sun Mar 02 1997 23:36

    Hi,
    
    A customer created a database service on his DECsafe environment which
    required a password to login to the database's adminstrator's account.
    He would like to prompt for interactive password input from an
    operator. How can he do this? He tried normal script with read but the
    script didn't prompt for input:
    
    typeset -l Confirm
    trap 'stty echo' INT QUIT TERM
    /usr/bin/stty -echo
    echo "Please enter sybase \"sa\" password: \c"
    read saPassword
    /usr/bin/stty echo
    trap - INT QUIT TERM
    echo ""
    echo "Confirm [y|n]: \c"
    read Confirm
    [[ "$Confirm" != "y" ]] && exit
    
    Is there any problem with this?
T.RTitleUserPersonal
Name
DateLines
1909.1There is no user interaction with start scriptsNETRIX::"[email protected]"Gregory P. MyrdalMon Mar 03 1997 11:2513
There is no tty associated with the start action script of an
ASE service.  These scripts may run at any moment and should
not require admin intervention to allow them to continue.

I am a little confused with your example.  The script you
have asks for a password, but does not do anything with it.
Is part of the start script missing? Ie. the part which
hands the password off to the start of the sybase program(s)?
Does sybase require a password to start?

-- Greg
[Posted by WWW Notes gateway]
1909.2any unsupported way?HGOSPS::MICKWIDLAMTue Mar 04 1997 00:0017
    re .1
    
    >There is no tty associated with the start action script of an
    >ASE service.  These scripts may run at any moment and should
    >not require admin intervention to allow them to continue.
    In normal concept, I think so. But is there any other shortcut or
    unsupported way to achieve this?
    
    >I am a little confused with your example.  The script you
    >have asks for a password, but does not do anything with it.
    >Is part of the start script missing? Ie. the part which
    >hands the password off to the start of the sybase program(s)?
    It just a portion of the script. They required administrator password
    in Sybase to start the database.
    
    Thanks and regars,
    Mickwid.
1909.3Not sureNETRIX::"[email protected]"Gregory P. MyrdalTue Mar 04 1997 10:0724
    In normal concept, I think so. But is there any other shortcut or
    unsupported way to achieve this?

I am not sure.  Since the start script may run a system in which the admin
is not even logged into were do you send the output?  It could go to the
console, but then you need to get the input from the user after logging in.
I am not the right person to answer this.  I do not that we can not pop
the question back to the asemgr if the start was due to someone running
the asemgr.  This would be nice, but not within the design of ASE.

    It just a portion of the script. They required administrator password
    in Sybase to start the database.

I wonder, can you embed the password in the sart script (encrypted if you
need security) and pump the password into the start of the sybase program?
Since you have the information, it would be nice if it started everytime,
whether an admin was there or not.

Unfortunately I do not have a good answer for you, someone else might.

-- Greg

[Posted by WWW Notes gateway]
1909.4Use "su - sybase command"BACHUS::DEVOSManu Devos DEC/SI Brussels 856-7539Tue Mar 04 1997 16:3816
    Hi,
    
    As the start/stop script is used by root, you can always run your
    sybase account by using the su command as
    
    su - the_needed_sybase_account 'the requested_sybase_command'
    
    As root has all the privileges, the password is NOT needed. I have no
    experience with Sybase, but we use the same technique for Oracle.
    
    By the way, I confirm that you cannot have an interactive terminal by
    default with DECsafe, except if you redirect the standard input from
    a terminal reserved for that and being not open by any getty !!!
    
    Regards, Manu