- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Cannot run command from CGI
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-18-2006 07:35 PM
05-18-2006 07:35 PM
In a cgi-script I am trying to run
system ("/bin/top -d1 > /tmp/top.out");
this doesn't write anything to the file. Why?
Greetings!
Kalin
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-18-2006 07:37 PM
05-18-2006 07:37 PM
Re: Cannot run command from CGI
try "top -d 1 -f /tmp/top.out"
GOOD LUCK!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-18-2006 07:43 PM
05-18-2006 07:43 PM
Re: Cannot run command from CGI
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-18-2006 08:04 PM
05-18-2006 08:04 PM
Re: Cannot run command from CGI
To eliminate any problem with file creation:
system("echo test > /tmp/top.out");
if that works at least you have narrowed the problem to the top command.
Please Update
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-18-2006 08:10 PM
05-18-2006 08:10 PM
Re: Cannot run command from CGI
That worked!
What could be wrong with the top command, this is a bit difficult for me..:(
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-18-2006 08:16 PM
05-18-2006 08:16 PM
SolutionYou have not writted how your CGI system command is executed. Is it from perl? from awk? from ruby? from python? from php?
the top command is definitely
"/bin/top -d 1 -f /tmp/top.out"
but if another user has already created that file, length zero, then your www user will not be able to overwrite it.
Check the output file permissions.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-18-2006 08:19 PM
05-18-2006 08:19 PM
Re: Cannot run command from CGI
Thank you for the advice!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-18-2006 08:22 PM
05-18-2006 08:22 PM
Re: Cannot run command from CGI
so the re-direct works.
No try and capture any error messages:
system("/usr/bin/top -d1 > /tmp/top.out 2>&1");
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-18-2006 08:24 PM
05-18-2006 08:24 PM
Re: Cannot run command from CGI
Steve's suggestion worked for me, I had to delete the top.out file once, so that it is could be created again from the webserver-user.
Greetings!
Kalin