- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- unusual problem with shell scripts
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
Discussions
Discussions
Forums
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
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
тАО07-13-2006 06:18 PM
тАО07-13-2006 06:18 PM
On my solaris I have 2 scripts...one is very simple just init 6
while the other is more complex..
both scripts work just fine but I have some aplication done on my remote windows and I can not execute init 6 script...but other scripts can be executed..any ides??
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-13-2006 08:03 PM
тАО07-13-2006 08:03 PM
Re: unusual problem with shell scripts
can you please confirm/clarify:
1. These scripts are on a Solaris platform
2. If they are on a Solaris platform, why do you mention remote windows.
3. You say both scripts work fine, but then that you can not execute the init 6 script.
For point 3.: Have you checked the execute permissions with 'ls -l'
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-13-2006 08:39 PM
тАО07-13-2006 08:39 PM
Re: unusual problem with shell scripts
there are 2 ways to reach those scripts both from windows machine:
1. from emulator like putty both scripts work perfect i can restart machine..
2. using php and telenet class I can execute one script but script with init 6 can not be executed..
PHP code is OK I know that...and in all ways I am root.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-13-2006 08:58 PM
тАО07-13-2006 08:58 PM
Re: unusual problem with shell scripts
I'm shure you can tell us the error message, wen you try to execute that script.
'init 6' is a call for reboot, so:
- what is the name of the script calling 'init 6'
- what else is found in that script?
mfG Peter
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-13-2006 09:21 PM
тАО07-13-2006 09:21 PM
Re: unusual problem with shell scripts
did I get it right that you want from your remote Windows PC (from a browser?) reboot your Solaris server by an init 6 through some sort of CGI script?
So is there a webserver which is supposed to execute the PHP involved?
For security reasons you wouldn't want the webserver on the Solaris box being run as root.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-13-2006 09:21 PM
тАО07-13-2006 09:21 PM
Re: unusual problem with shell scripts
#!/bin/ksh
responce="US"
if [ $responce == "US" ]; then
# echo "cao"
# ./restart214
init 6
#shutdown -i6 -g0 -y
echo "has not been created">>kFILE
else
echo "$dir has not been created"
fi
if I execute it via putty it restarts machine..and works perfect..
but with PHP I just can not execute this script all others can be executed..
to be more precised:
script
#!/bin/ksh
responce="US"
if [ $responce == "US" ]; then
# echo "cao"
# ./restart214
# init 6
#shutdown -i6 -g0 -y
echo "has not been created">>kFILE
else
echo "$dir has not been created"
fi
can be executed via PHP
so if I put # before init 6 it works even via PHP(telnet from windows) but if I remove # it does not work..
strange...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-13-2006 09:53 PM
тАО07-13-2006 09:53 PM
Re: unusual problem with shell scripts
- try to catch the error
- call init with pathname
#!/bin/ksh
responce="US"
exec 2>/tmp/shutt.err
if [ $responce == "US" ]; then
# echo "cao"
# ./restart214
/usr/sbin/init 6
#shutdown -i6 -g0 -y
echo "has not been created">>kFILE
else
echo "$dir has not been created"
fi
mfG Peter
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-13-2006 10:10 PM
тАО07-13-2006 10:10 PM
Re: unusual problem with shell scripts
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-13-2006 11:28 PM
тАО07-13-2006 11:28 PM
Re: unusual problem with shell scripts
modify script to get traces:
#!/usr/bin/ksh -x
exec 2>/tmp/shutt.err
responce="US"
if [ $responce == "US" ]; then
echo "ciao"
# ./restart214
/usr/sbin/init 6
#shutdown -i6 -g0 -y
echo "has not been created">>kFILE
else
echo "$dir has not been created"
fi
mfG Peter
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-14-2006 12:01 AM
тАО07-14-2006 12:01 AM