Operating System - Linux
1832785 Members
3512 Online
110045 Solutions
New Discussion

Re: command working fine after machine reboot, but it (the command) is hang couple days later.

 
Anh-Thu Tran
Frequent Advisor

command working fine after machine reboot, but it (the command) is hang couple days later.

I am able to use ps2pdf command after the machine (redhat ES3) is rebooted. After several days working fine, the ps2pdf command is hang and need the machine to reboot to use the command again. Does anybody have any ideas?
12 REPLIES 12
A. Clay Stephenson
Acclaimed Contributor

Re: command working fine after machine reboot, but it (the command) is hang couple days later.

Note that ps2pdf is simply a front-end script for ghostscript (gs). My best guess is that a somewhat corrupt input file can leave gs waiting for more input (on stdin) that it never sees. Rather than rebooting, I suspect you simply need to kill gs. It would probably also be wise to look for any gs patches.
If it ain't broke, I can fix that.
Anh-Thu Tran
Frequent Advisor

Re: command working fine after machine reboot, but it (the command) is hang couple days later.

We have the second box (Older redhat version)with same gs version and it does not have any problem, so I am not sure if the patch can fix the problem.
A. Clay Stephenson
Acclaimed Contributor

Re: command working fine after machine reboot, but it (the command) is hang couple days later.

The patch could be to one of the many shared libraries that gs uses.
If it ain't broke, I can fix that.
melvyn burnard
Honored Contributor

Re: command working fine after machine reboot, but it (the command) is hang couple days later.

Posted in wrong forum, moved to correct forum
My house is the bank's, my money the wife's, But my opinions belong to me, not HP!
Vitaly Karasik_1
Honored Contributor

Re: command working fine after machine reboot, but it (the command) is hang couple days later.

what about free disk space?
dirk dierickx
Honored Contributor

Re: command working fine after machine reboot, but it (the command) is hang couple days later.

what about just killing the process, rebooting the whole machine is a bit overkill.
Anh-Thu Tran
Frequent Advisor

Re: command working fine after machine reboot, but it (the command) is hang couple days later.

Yes, I can kill the gs process to get out or control C. However, my question is why the ps2pdf command is working fine after the reboot and stop later (just hang). To use the command, we have to reboot the box, and of course it will hang sometime later. How can I fix it?
dirk dierickx
Honored Contributor

Re: command working fine after machine reboot, but it (the command) is hang couple days later.

run strace when executing the command, you'll get a lot of stuff on your screen, and it should after a while show you what it is trying to do and is not working.
Anh-Thu Tran
Frequent Advisor

Re: command working fine after machine reboot, but it (the command) is hang couple days later.

The strace anh.ps anh.pdf stopped at:
open("anh.pdf", O_RDWR|O_CREAT|O_TRUNC, 0666) = 8
open("/dev/random", O_RDONLY) = 9
fstat64(9, {st_mode=S_IFCHR|0644, st_rdev=makedev(1, 8), ...}) = 0
ioctl(9, SNDCTL_TMR_TIMEBASE or TCGETS, 0xbfff8098) = -1 EINVAL (Invalid argument)
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb75e5000
read(9,


Any ideas?
Marek Podmaka
Frequent Advisor

Re: command working fine after machine reboot, but it (the command) is hang couple days later.

Please do the strace again and when it stops at the read() syscall, from another console do:
ls -l /proc/PID/fd
This will find out which file/socket is open under this file descriptor. So if this time it hangs on "read(9,", you should find fd 9. If it is file, the symlink will point to the file's original location.
Anh-Thu Tran
Frequent Advisor

Re: command working fine after machine reboot, but it (the command) is hang couple days later.

The command hang again this moring, but I could not anything /proc/PID/fd. Actually, there is no PID under /proc directory. Our machine is Redhat ES3.
Stuart Browne
Honored Contributor

Re: command working fine after machine reboot, but it (the command) is hang couple days later.

Err he meant the PID of the running process, i.e. /proc/3872/fd (but replace 3872 with the pid of the process you're stracing)
One long-haired git at your service...