- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: usage errors on startup 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
Forums
Discussions
Discussions
Forums
Discussions
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
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
10-23-2006 08:20 AM
10-23-2006 08:20 AM
I have a situation that i hope you can help with.
I have several boxes all having issues with the same startup scripts not running at boot time. The permissions and ownership look fine to me, but i have a few questions.
In my /etc/rc.log i get usage errors for these scripts.
===========================================
# grep Usage /etc/rc.log
Usage: /sbin/rc3.d/S95xvfb { start | stop }
Usage: /sbin/rc3.d/S97ofx { start | stop }
===========================================
1) does the naming convention matter? the links in /sbin/rc3.d dont match the original file name.
2) does the SXXX part matter if it is only 2 digits? as in my examples below.
3) I was told the linked file permissions dont matter only the orignial file permissions so far as being executable, which they are, but read access isnt there.
=============================================
root:/sbin/rc3.d
lrwxr-xr-x 1 root sys 21 Oct 23 12:51 S95xvfb -> /sbin/init.
d/xvfbinit
lrwxr-xr-x 1 root sys 20 Oct 23 12:51 S97ofx -> /sbin/init.d
/ofxinit
=============================================
-rwxr-xr-x 1 root sys 828 Dec 22 2005 ofxinit
-rwxr-xr-x 1 root sys 507 Dec 22 2005 xvfbinit
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-23-2006 08:28 AM
10-23-2006 08:28 AM
Re: usage errors on startup scripts
Jeff Traigle
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-23-2006 08:41 AM
10-23-2006 08:41 AM
Re: usage errors on startup scripts
1. Makes no difference.
2. Makes no difference. The numbers are just a mechanism to order the execution of the scripts. As long as they start with S, they will be executed at the start of that init state. The link could have no number... it would just be executed in ASCII order along with the ones that contain numbers.
3. Symlink permissions are irrelevant (although it appears all permissions in fact match in your case). Permissions don't appear to be your problem though since you're getting the usage message instead of some kind of permission denied error.
Jeff Traigle
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-23-2006 08:49 AM
10-23-2006 08:49 AM
Re: usage errors on startup scripts
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-23-2006 08:52 AM
10-23-2006 08:52 AM
Re: usage errors on startup scripts
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-23-2006 09:01 AM
10-23-2006 09:01 AM
Re: usage errors on startup scripts
It does "echo: the startup statement in the first case argument, so it appears to try and start the scripts, but then It falls thru the case statement to the final exit case argument at the bottom.
Almost as if it runs 2 parts of the case and not only 1 part.
# vi /etc/rc.log
Usage: /sbin/rc3.d/S95xvfb { start | stop }
Output from "/sbin/rc3.d/S95xvfb start":
----------------------------
***Starting up the Virtual Frame Buffer on Screen 1***
Usage: /sbin/rc3.d/S97ofx { start | stop }
Output from "/sbin/rc3.d/S97ofx start":
----------------------------
***Starting up the Spatial FX Server 3.3 using Virtual Framebuffer (xvfb)***
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-23-2006 09:03 AM
10-23-2006 09:03 AM
Re: usage errors on startup scripts
When the system starts, it takes the /sbin/rc?.d/S* scripts and does, for example,:
S97ofx start
Now, if the case statement is not recognizing 'start' then it will fail. Perhaps start is spelled Start, or START or something. It must be an all lower case 'start' for the script to function correctly.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-23-2006 09:07 AM
10-23-2006 09:07 AM
Re: usage errors on startup scripts
============================================# cat ofxinit
#!/usr/bin/ksh
#
case "$1" in
'start')
if [ -x /app1/ofx/SpatialFX33Server/server/startServer.sh ] ; then
echo "***Starting up the Spatial FX Server 3.3 using Virtual Fra
mebuffer (xvfb)***"
DISPLAY=:1.0
export DISPLAY
#sleep 15
cd /app1/ofx/SpatialFX33Server/server
/app1/ofx/SpatialFX33Server/server/startServer.sh > /app1/ofx/lo
gs/ofx.log 2>&1 &
fi
;;
'stop')
# /usr/bin/pkill -9 -x -u 0 '(startServer)'
for I in `ps -ef | grep [S]erver/j2 | awk '{print $2}'`
do
ps -ef | grep [S]erver/j2
echo $I
/usr/bin/kill -9 $I >> /app1/ofx/logs/ofx.out
done
for I in `ps -ef | grep [o]fx | awk '{print $2}'`
do
ps -ef | grep [o]fx
echo $I
/usr/bin/kill -9 $I >> /app1/ofx/logs/ofx.out
done
;;
*)
echo "Usage: $0 { start | stop }"
exit 1
;;
esac
exit 0
============================================
# cat xvfbinit
#!/sbin/sh
#
case "$1" in
'start')
# start the X Virtual Framebuffer (Xvfb) *dek* 02/17/00
if [ -f /usr/bin/X11/Xvfb ]; then
echo "***Starting up the Virtual Frame Buffer on Screen 1***"
/usr/bin/X11/Xvfb :1 -screen 0 1152x900x8 > /app1/ofx/logs/Xvfb.
log 2>&1 &
fi
;;
'stop')
# /usr/bin/pkill -9 -x -u 0 '(Xvfb)'
for I in `ps -ef | grep [X]vfb | awk '{print $2}'`
do
kill -9 $I
done
;;
*)
echo "Usage: $0 { start | stop }"
exit 1
;;
esac
exit 0
============================================
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-23-2006 09:09 AM
10-23-2006 09:09 AM
Re: usage errors on startup scripts
Look at the mixture of single and double quotes...
doubles on the actual case statement then singles on the values...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-23-2006 09:12 AM
10-23-2006 09:12 AM
SolutionIt appears that you have violated the convention required for the startup scripts.
One of four possible arguments will be received by any startup/shutdown script: "start_msg", "start", "stop_msg" or "stop".
This is clearly seen in '/sbin/init.d/template". The manpages for 'rc(1M)' documents this further. The strings of "*_msg" are used to formulate the console checklist. The arguments without "_msg" trigger the script to actually perform startup or shutdown work.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-23-2006 09:17 AM
10-23-2006 09:17 AM
Re: usage errors on startup scripts
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-23-2006 11:16 AM
10-23-2006 11:16 AM
Re: usage errors on startup scripts
S001abc
S01abc
S055abc
S195abc
S1abc
S55abc
S5abc
This is the ls (or start/stop script) order of execution. You see that S01abc is run BEFORE S055 and S1abc is run AFTER S195abc. That's because the number is simply text and the sort is left to right.
So while S95vxfb is probably correct as it will be run with all the S9------ scripts but it will AFTER S959abc because S95vxfb sorts after S959abc (numbers come before letters in ASCII -- see man ascii)
Bill Hassell, sysadmin