In article <361d7f91.607
...@news.ptdprolog.net>,
mattpay
...@hotmail.com (Matt Payton) wrote:
> On 9 Oct 1998 00:09:50 GMT, "Alexander Berry, Jr."
> <aberr
...@worldnet.att.net> wrote:
> >Hello ,
> >I must be missing something because for the life of me I can't figure
> >out how to put something in the system startup.
> >I have installed sybase 11.03 and would like to start the database
> >server on system startup . The startup command is "startserver -f
> >RUN_SYBASE" . The problem I have is where in this rc file maze do I put
> >this command. also I have a new hard drive installed on my machine I
> >have to mount it manually when I start the machine. Where in this rc
> >file maze do I put the "mount" command to mount my hard drive on
> >startup.
> >In summary
> >1).How do I start sybase on startup with the command "startserver -f
> >RUN_SYBASE"?
> Typically anything you want to run at start up can be put into the
> rc.local file. The following is from one the rc.local file from 1 of
> my Linux boxes (redhat 5.1, not that it matters)
> # This script will be executed *after* all the other init scripts.
> # You can put your own initialization stuff in here if you don't
> # want to do the full Sys V style init stuff.
> There are many ways to have programs run at startup, but this is a
> good place for simple commands.
> >2). How do I mount my second hard drive on startup?
> Drives are usually mounted in the fstab file
> >3). It would also be nice to know how to start a daemon?
> I guess it depends on the daemon. Try looking for documentation on
> the daemon you want to start, and there should be some reference to
> how to run/start it.
> >Thank you very much for any assistance.
> >Alexander Berry, jr.
> >aberr...@worldnet.att.net
> Matt
Both questions about starting sybase and a deamon have to do with
/etc/rc.d/rcX.d directories where X is the runlevel ( on redhat anyway, but
is basically the same for other dists I think ). Basically you want to do
something like ln -s ../init.d/sybase S40sybase in your /etc/rc.d/rc3.d
directory where sybase is the startup script. I think this script is provided
with the sybase package. I would be very surprised if it was not. Just put it
in /etc/rc.d/init.d. Actually if you run the sybase rpm it will probably put
it in there for you. You'd do something similar for the daemon you want to
start. Also, you can start, stop processes listed in init.d by running the
script manually with an argument of stop or whatever. You should also have a
similar link in rc6.d to kill the daemon. Does this make sense? Probably not.
Let me explain a little more. The way these rc scripts work is that at each
runlevel all the scripts in the particular runlevel directory ( rc3.d is for
runlevel 3 ) will be executed. Those that begin with a S will be started (
meaning when a runlevel changes, the script ( in init.d thru link ) will be
called with an argument of "start". Similarly the links that begin with K
will be killed ( by calling the script with "stop" ). The two digits in the
link give the script a startup prority ( actually there just executed in the
order in which they apprear, so the number facilitates the order in which
there executed. What is a runlevel you ask. When the system boots it starts
up in runlevel 3, runlevel 5 is X-Windows, runlevel 6 is reboot, runlevel 4
is not used, runlevel 0 is halt, and runlevel 2 is single user mod I think.
So this way you can start and stop stuff for each state. For runlevel 2 you
wouldn't want to have much of anything in /etc/rc.d/rc2.d because it's
supposed to be a rescue kind of mode. Similarly for runlevel 6 you want to
kill everthing that you started in earlier runlevels in prep for reboot. If
you're using RedHat the control panel has a "Runlevel Editor" that will
manipulate these links for you. In X-Windows just type "control-panel". Note:
you really have to use the standard kind of startup script because when then
script is called it will be called with the argument "start" or "stop" so the
script should accept these arguments. I guess you could still do what Matt
was talking about but that sort of defeats the purpose of the rc arrangment.
If you were to have a problem with sybase it would be good to boot up into
single user mode and investigate without starting the db. If you start it
from rc.local it will start anyway. As for you disk problem /etc/fstab
dictates what's mounted on boot.
Later,
Mike
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own