stty: : No such device or address

stty: : No such device or address

Post by yls1 » Wed, 22 Jan 2003 16:06:38



i schedule the script, stopapp.sh in crontab on sunday.

stopapp.sh script
#!/sbin/sh
#shutdown processes before backup

su - myapps

cd $HOME/System/bin

----------------------------------------
when i came to work on monday, i got a mail from the system which is
as belows

stty: : No such device or address
stty: : No such device or address
logout
/sysadmin/bkup/bin/stopappprocess.sh: //System/bin: does not exist

----------------------------------------

echo $HOME will give /export/myapps
myapps user home directory is /export/myapps..
myapps default shell is sh

so the command in stopapp.sh "cd $HOME/System/bin" should bring me to
/export/myapps/System/bin.

And i dont see what is the error that the mail i got is complaining
about.

please help.

 
 
 

stty: : No such device or address

Post by Umberto Quai » Wed, 22 Jan 2003 17:58:36



> i schedule the script, stopapp.sh in crontab on sunday.

> stopapp.sh script
> #!/sbin/sh
> #shutdown processes before backup

> su - myapps

> cd $HOME/System/bin

> ----------------------------------------
> when i came to work on monday, i got a mail from the system which is
> as belows

> stty: : No such device or address
> stty: : No such device or address
> logout
> /sysadmin/bkup/bin/stopappprocess.sh: //System/bin: does not exist

> ----------------------------------------

> echo $HOME will give /export/myapps
> myapps user home directory is /export/myapps..
> myapps default shell is sh

> so the command in stopapp.sh "cd $HOME/System/bin" should bring me to
> /export/myapps/System/bin.

No, because $HOME is set to "/"... :-)

So, you get //System/bin.
/System/bin does not exist and it complains.

Probably that stopapp.sh is run as root user instead of myapps user.
Which crontab is that?

About stty, if that script is designed to be run interactively,
it may complain because when run from crontab no tty is available.
What's the stty command in the script?

logout... Does that script logs somewhere else?
In that case it may be the profile of the remote user
the cause for stty messages.

Umberto

 
 
 

stty: : No such device or address

Post by yls1 » Sat, 25 Jan 2003 12:26:43




> > i schedule the script, stopapp.sh in crontab on sunday.

> > stopapp.sh script
> > #!/sbin/sh
> > #shutdown processes before backup

> > su - myapps

> > cd $HOME/System/bin

> > ----------------------------------------
> > when i came to work on monday, i got a mail from the system which is
> > as belows

> > stty: : No such device or address
> > stty: : No such device or address
> > logout
> > /sysadmin/bkup/bin/stopappprocess.sh: //System/bin: does not exist

> > ----------------------------------------

> > echo $HOME will give /export/myapps
> > myapps user home directory is /export/myapps..
> > myapps default shell is sh

> > so the command in stopapp.sh "cd $HOME/System/bin" should bring me to
> > /export/myapps/System/bin.

> No, because $HOME is set to "/"... :-)

> So, you get //System/bin.
> /System/bin does not exist and it complains.

> Probably that stopapp.sh is run as root user instead of myapps user.
> Which crontab is that?

> About stty, if that script is designed to be run interactively,
> it may complain because when run from crontab no tty is available.
> What's the stty command in the script?

> logout... Does that script logs somewhere else?
> In that case it may be the profile of the remote user
> the cause for stty messages.

> Umberto

script to be run interactively? does it mean that a su - otheruser
will cause the script to be run interactively?
 
 
 

stty: : No such device or address

Post by Jeremiah DeWitt Weine » Sun, 26 Jan 2003 04:20:44


        I find your post kind of confusing, but I'll give it a shot...


>> > stopapp.sh script
>> > #!/sbin/sh
>> > #shutdown processes before backup

>> > su - myapps

>> > cd $HOME/System/bin

        I think this is part of your problem.  You want to cd to
(myapps' home directory)/System/bin?  The above script will not do that.
"su" spawns a separate shell as the new user; it does _not_ change the UID
for the current shell.  So $HOME will be interpreted as $HOME for the user
who originally ran the script.  (I also have no idea what this script is
supposed to accomplish, since it looks like it does an su and then a cd
and nothing else, but you didn't ask me, so...)

Quote:>> > when i came to work on monday, i got a mail from the system which is
>> > as belows

>> > stty: : No such device or address
>> > stty: : No such device or address
>> > logout

        My guess is that stty gets run in the shell initialization scripts
for the user "myapps", but whatever the script is using as a terminal is
not really a terminal, so stty gets confused.  You can reproduce this
message with
stty </dev/null

Quote:>> > /sysadmin/bkup/bin/stopappprocess.sh: //System/bin: does not exist

        I thought you said it was called stopapp.sh?  Or is
stopappprocess.sh a separate script on the system?  I don't care if you
use made-up names for things, but if you do, at least keep them consistent.

        Anyway, Umberto pretty much had things right.  To help you any
further, we'd need to know who the script originally gets run as, and
what's in the shell startup scripts for the user "myapps".

--
If mail to me bounces, try removing the "+STRING" part of the address.

 
 
 

stty: : No such device or address

Post by Bill Marcu » Sun, 26 Jan 2003 11:27:21


On 23 Jan 2003 19:26:43 -0800, yls177


> script to be run interactively? does it mean that a su - otheruser
> will cause the script to be run interactively?

Without seeing the script, others can only guess based on the error messages.
If you use "su - otheruser", you must be sure that otheruser's .profile
does not execute "stty".  If the stty commands are in the script, you
may have to modify the script or run it with expect.
 
 
 

stty: : No such device or address

Post by N. Curt Bea » Wed, 29 Jan 2003 23:52:25


Generally, when running a command from crontab tha needs to run as a new
user, it is common to perform the followin systax:

su user -c "cd directory; execute command here"

Hope this can help

Curt


Quote:> i schedule the script, stopapp.sh in crontab on sunday.

> stopapp.sh script
> #!/sbin/sh
> #shutdown processes before backup

> su - myapps

> cd $HOME/System/bin

> ----------------------------------------
> when i came to work on monday, i got a mail from the system which is
> as belows

> stty: : No such device or address
> stty: : No such device or address
> logout
> /sysadmin/bkup/bin/stopappprocess.sh: //System/bin: does not exist

> ----------------------------------------

> echo $HOME will give /export/myapps
> myapps user home directory is /export/myapps..
> myapps default shell is sh

> so the command in stopapp.sh "cd $HOME/System/bin" should bring me to
> /export/myapps/System/bin.

> And i dont see what is the error that the mail i got is complaining
> about.

> please help.

 
 
 

stty: : No such device or address

Post by N. Curt Bea » Wed, 29 Jan 2003 23:54:42


Correction....

The line:
    su user -c "cd directory; execute command here"
Should be:
su user -c (cd directory; execute command here)

Curt


> Generally, when running a command from crontab tha needs to run as a new
> user, it is common to perform the followin systax:

> su user -c "cd directory; execute command here"

> Hope this can help

> Curt



> > i schedule the script, stopapp.sh in crontab on sunday.

> > stopapp.sh script
> > #!/sbin/sh
> > #shutdown processes before backup

> > su - myapps

> > cd $HOME/System/bin

> > ----------------------------------------
> > when i came to work on monday, i got a mail from the system which is
> > as belows

> > stty: : No such device or address
> > stty: : No such device or address
> > logout
> > /sysadmin/bkup/bin/stopappprocess.sh: //System/bin: does not exist

> > ----------------------------------------

> > echo $HOME will give /export/myapps
> > myapps user home directory is /export/myapps..
> > myapps default shell is sh

> > so the command in stopapp.sh "cd $HOME/System/bin" should bring me to
> > /export/myapps/System/bin.

> > And i dont see what is the error that the mail i got is complaining
> > about.

> > please help.

 
 
 

1. stty: : No such device or address

I get the above error in VI when I try to substitute lines
with the output of a UNIX command. e.g !!ls in command mode.

Any idea as to what could be wrong?

stty -a
speed 9600 baud;
rows = 44; columns = 109; ypixels = 670; xpixels = 991;
eucw 1:0:0:0, scrw 1:0:0:0
intr = ^c; quit = ^|; erase = ^h; kill = ^?;
eof = ^d; eol = ^m; eol2 = <undef>; swtch = <undef>;
start = ^q; stop = ^s; susp = ^z; dsusp = ^y;
rprnt = ^r; flush = ^o; werase = ^w; lnext = ^v;
parenb -parodd cs7 -cstopb -hupcl cread -clocal -loblk -crtscts
-crtsxoff -parext
-ignbrk brkint ignpar -parmrk -inpck istrip -inlcr -igncr icrnl -iuclc
ixon -ixany -ixoff imaxbel
isig icanon -xcase echo echoe echok -echonl -noflsh
-tostop echoctl -echoprt echoke -defecho -flusho -pendin iexten
opost -olcuc onlcr -ocrnl -onocr -onlret -ofill -ofdel

uname -a
SunOS MachineName 5.5.1 Generic_103640-17 sun4m sparc
SUNW,SPARCstation-10

I use ksh, xterm and TERM is set to xterm.

TIA,
James

2. Delegate Proxy

3. Win95 sees Linux as a ROM?

4. stty -g output mapping to stty -a output

5. How to setup a POP3 server ? HLP. pls.

6. 'stty -opost' or 'stty -onlcr' don't work ?!

7. Do I need any of these on my solaris Internet Server

8. Change "stty erase ^?" for "stty erase ^H"

9. stty < /dev/modem - Device busy

10. stty: : Inappropriate ioctl for device

11. stty: tcgetattr failed: No such device (error 19)