Operating System - HP-UX
1835910 Members
3077 Online
110086 Solutions
New Discussion

script(1) no longer works??

 
SOLVED
Go to solution
abc_18
Regular Advisor

script(1) no longer works??

HP-UX 11.11, and "nothing has changed" but all of a sudden script(1) has stopped working.

Any suggestions?
I already tried "cd /dev; insf -e; insf -d ptym", and several other incantations, but no love. I tried rebooting - still no love.

Here's the details:

xyz 196> cd /tmp
xyz 197>script
Script started, file is typescript
script: Error opening /dev/ptym/clone: Permission denied
could not reset pty ownership and access mode

xyz 198> ll /dev/ptym/clone
/dev/ptym/clone not found

This makes it look like the "clone" driver isn't in the kernel, but it is...

xyz 199> ll /dev/ptym
/dev/ptym/ptyp0 not found
/dev/ptym/ptyp1 not found
/dev/ptym/ptyp2 not found
...

xyz 201>grep clone /stand/system
clone
xyz 202>

Any ideas?
Thanks in advance.
13 REPLIES 13
Denver Osborn
Honored Contributor

Re: script(1) no longer works??

What are the permissions of /dev? Are they 555?

ll -d /dev

-denver
Alex Lavrov.
Honored Contributor

Re: script(1) no longer works??

Did you try to recreate it?

That's ow it looks on one of my machines:
crw-rw-rw- 1 bin bin 16 0xffffff Feb 15 11:49 /dev/ptym/clone

so, just try:
mknod /dev/ptym/clone c 16 0xffffff
I don't give a damn for a man that can only spell a word one way. (M. Twain)
abc_18
Regular Advisor

Re: script(1) no longer works??

Yep, /dev is set to 555.

----
I tried the mknod, but mknod seems to think the file already exists. Yet ll doesn't see it:

# ll /dev/ptym/clone
/dev/ptym/clone not found
# mknod /dev/ptym/clone c 16 0xffffff
mknod: File exists
# ll /dev/ptym/clone
/dev/ptym/clone not found


Any other suggestions? I'm really stumped by this one.
Bharat Katkar
Honored Contributor

Re: script(1) no longer works??

Hi,
Just a thought:

# file /dev/ptym/clone

What does this return??

This is what i see...

# cd /dev/ptym/clone
# file clone
clone: character special (16/16777215)

Regards,
You need to know a lot to actually know how little you know
Bharat Katkar
Honored Contributor

Re: script(1) no longer works??

Also as far as permission are concerned:

/dev 555
/dev/ptym 755
/dev/ptym/clone 666

Hope that helps.
Regards,
You need to know a lot to actually know how little you know
Bharat Katkar
Honored Contributor

Re: script(1) no longer works??

Sorry for multiple responses but another doubt was whether this scirpt uses differnt user other than root and if so see whether that user is allowed to access that file. Anybody changed privileges of that user.( expired/deactivated etc.)

REgards,
You need to know a lot to actually know how little you know
Gordon  Morrison_1
Regular Advisor

Re: script(1) no longer works??

xyz 199> ll /dev/ptym
/dev/ptym/ptyp0 not found
/dev/ptym/ptyp1 not found
/dev/ptym/ptyp2 not found

The above output is very strange, and, I think, very significant: You asked for a directory listing, specifying only a directory, and then it says that specific files don't exist in that directory, so what makes it think those specific files are (not) there?

I suspect filesystem corruption. Have you run fsck?
What does this button do?
Cheryl Griffin
Honored Contributor

Re: script(1) no longer works??

what are the permissions, owner, group on these?
# ll /usr/bin/script /usr/lbin/protect_pty

script should be:
# chown bin:bin /usr/bin/script
# chmod 555 /usr/bin/script

protect_pty should be:
# chown root:bin /usr/lbin/protect_pty
# chmod 4555 /usr/lbin/protect_pty
"Downtime is a Crime."
abc_18
Regular Advisor

Re: script(1) no longer works??

Aha! We're making progress.

All of the above perms were okay except for... for /dev/ptym:

It was (incorrectly):
drw-rw-rw- 2 bin tty 9216 Mar 1 19:01 /dev/ptym/

I've fixed it now:
drwxr-xr-x 2 bin tty 9216 Mar 1 19:01 /dev/ptym/

----
So now it works.... if I do it as 'root'.
But if I invoke script(1) as a mortal,
I get the following error:

xyz 274>script
Script started, file is typescript
script: Could not get slave pty name.could not reset pty ownership and access mode
xyz 275>

Any suggestions?

Thanks in advance.

A. Clay Stephenson
Acclaimed Contributor
Solution

Re: script(1) no longer works??

It sounds now like the permissions on the pty slave device nodes (or directory) are wrong.

The master pseudo terminal are /dev/ptym/pty[a-ce-z]* -- those appear to be okay. The slaves are /dev/pty/tty[a-ce-z]*. Man 7 pty and look under the 'FILES' section for all the device nodes to check. You might have missed some masters as well.
If it ain't broke, I can fix that.
Denver Osborn
Honored Contributor

Re: script(1) no longer works??

still a permissions problem...

mv /dev/ptym /dev/ptym.sv
insf -e -d ptym

now compare the perms of new devices in /dev/ptym/ to the old /dev/ptym.sv/...

-denver
abc_18
Regular Advisor

Re: script(1) no longer works??

Fixed! Thanks!!
The (second) problem was that the directory
/dev/pty was 666 instead of 755.

abc_18
Regular Advisor

Re: script(1) no longer works??

.