startup scripts (rc3.d)


 
Thread Tools Search this Thread
Operating Systems Linux startup scripts (rc3.d)
# 1  
Old 09-12-2008
startup scripts (rc3.d)

I've created the following link in order to startup apache tomcat on startup, however, it does not seem to run. Am I missing something out?

Smilie

/etc/init.d
lrwxrwxrwx 1 root root 16 Sep 5 14:59 K73ypbind -> ../init.d/ypbind
lrwxrwxrwx 1 root root 16 Sep 11 13:09 S100tomcat -> ../init.d/tomcat
drwxr-xr-x 2 root root 4096 Sep 11 13:09 .
[root@mrsdev02 rc3.d]# pwd
/etc/rc.d/rc3.d
[root@mrsdev02 rc3.d]#

/etc/init.d
-rwxr-xr-x 1 root root 276 Sep 12 08:16 tomcat
drwxr-xr-x 2 root root 4096 Sep 12 08:16 .
[root@mrsdev02 init.d]# pwd
/etc/init.d

tomcat startup script //this runs when running it manually
[root@mrsdev02 init.d]# cat tomcat
#!/bin/sh
#export CATALINA_OPTS="-server -Xmx512m"
export CATALINA_HOME=/opt/apache-tomcat-5.5.12
case $1 in
start)
$CATALINA_HOME/bin/startup.sh
;;
stop)
$CATALINA_HOME/bin/shutdown.sh
;;
restart)
$CATALINA_HOME/bin/shutdown.sh
$CATALINA_HOME/bin/startup.sh
;;
esac
exit 0
[root@mrsdev02 init.d]#
# 2  
Old 09-12-2008
You should use S99tomcat rather than S100tomcat; only 2 digits are expected. Not sure this is your problem though....
# 3  
Old 09-12-2008
Quote:
Originally Posted by Annihilannic
You should use S99tomcat rather than S100tomcat; only 2 digits are expected. Not sure this is your problem though....
The problem is that S99 is already in use by another script.
# 4  
Old 09-14-2008
That's not a problem, the numbers aren't exclusive. It just means that those services will be started at the same time... if you need that service to be started before tomcat, you'll need to change it to 98 or earlier.
# 5  
Old 09-15-2008
I've updated the symbolic link, but the process does not boot up either:
lrwxrwxrwx 1 root root 19 Sep 3 14:08 S99firstboot -> ../init.d/firstboot
lrwxrwxrwx 1 root root 11 Sep 3 17:34 S99local -> ../rc.local
lrwxrwxrwx 1 root root 16 Sep 3 14:08 S99smartd -> ../init.d/smartd
lrwxrwxrwx 1 root root 16 Sep 12 14:35 S99tomcat -> ../init.d/tomcat

I think I still have to configure it as a valid service within chkconfig, any idea how to do it please?

tomcat script
-------------
#!/bin/sh
#export CATALINA_OPTS="-server -Xmx512m"

export CATALINA_HOME=/opt/apache-tomcat-5.5.12
case $1 in
start)
cd $CATALINA_HOME/bin/
./startup.sh
;;
stop)
cd $CATALINA_HOME/bin/
./shutdown.sh
;;
restart)
cd $CATALINA_HOME/bin
./shutdown.sh
sleep 10
cd $CATALINA_HOME/bin
./startup.sh
;;
esac
exit 0
# 6  
Old 09-15-2008
chkconfig is a nice-to-have, not a necessity. It's easy to configure by just adding the headers to your /etc/init.d/tomcat script (copy them from another service and modify them) and then chkconfig --add tomcat.

You may find that your server isn't actually booting to runlevel 3, maybe it's going to 5 (with graphical login)? who -r or runlevel should tell you the current runlevel, and grep initdefault /etc/inittab the boot-time default.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Solaris

Solaris 10 startup scripts

Hi all, I have a server in maintenance mode and need to boot it up. Its due to a broken service "RepX". I need to stop the service from trying to start at boot up but i can't find where it is booting up from... it is not in any of the rcX.d directories and the two locations i have found it... (6 Replies)
Discussion started by: Tommyk
6 Replies

2. UNIX for Advanced & Expert Users

xsession startup scripts

Can someone please tell me how to run xsession startup scripts whenever I start or after I restart my X session? I'm not trying to do anything fancy I just want this to run. This makes life a lot easier when I use a dual monitor. xrandr --output VGA1 --mode 1024x768 --rate 60 (7 Replies)
Discussion started by: cokedude
7 Replies

3. UNIX for Dummies Questions & Answers

Startup/Kill Scripts

Hello, I have to perform an audit of a system at work and I am looking at its /etc/rc3.d: K01tog-pegasus K74nscd S08iptables S50openemm K01yum K74ntpd S09isdn S55cups K02NetworkManager K85mdmpd S09pcmcia S55sshd K03rhnsd ... (8 Replies)
Discussion started by: mojoman
8 Replies

4. AIX

Startup rc scripts log

Hi, I am trying to start services on system reboot on AIX. Have put the S* links under rd2.d & K* links under other rc*.d At the moment, all scripts are getting called. However, the services aren't coming up. Where can i find the logs for these to check what failed. (8 Replies)
Discussion started by: vibhor_agarwali
8 Replies

5. HP-UX

Startup scripts

Hi all We have HP UX 11.23 installed on 4 RISC servers (2 oracle databases, 2 Oracle App Servers) , we are in a construction period , so the power failure may happen more than once a day. I need to learn how to create an automatic startup services as in Windows, if we know that the services... (5 Replies)
Discussion started by: kafaween
5 Replies

6. Solaris

how to recreate scripts under /etc/rc3.d folder

Hi All, We have the JMS Queue startup script S52imq and some other scripts in our solaris server 5.8 version. now unknowingly something happend to those scripts and its lost. How can I recreate those scripts again to start the JMQ queue again? We have Solaris 5.10 version which is having... (3 Replies)
Discussion started by: nsurendiran
3 Replies

7. UNIX for Advanced & Expert Users

How to solve screwing startup scripts

Hello! unix os is OSF1 CP1 V4.0 878 alpha.It startup os normally.But when i use a command to run application, it restart within 10 sec.I have no spare harddisk& application to reinstall.When i asked this problem at this forum, it replys that start up scripts are screwed and to mount each... (12 Replies)
Discussion started by: akzin
12 Replies

8. Shell Programming and Scripting

startup scripts, how do they work in UNIX?

I need to make a script to start the postfix service on a server when the machine starts up. I have a script written below, which I think will work, but I am confused on how the rc2.d & rc3.d etc directories actually work. If I enter the script below, and stick it in the rc3.d directory,... (1 Reply)
Discussion started by: BG_JrAdmin
1 Replies

9. AIX

Startup/Shutdown scripts

I understand that by putting in entries into the /etc/inittab file. We can actually call the our scripts during startup. mkitab "start_server:2:once:sh /scripts/startserver.sh" Would the system wait for startserver.sh finish executing before it goes to another entry? and how long would it... (1 Reply)
Discussion started by: vincente
1 Replies

10. Shell Programming and Scripting

ksh in rc3.d startup script

Hi there , Can someone tell me whether ksh is available in rc3.d,ie will it work if i add an korn shell script in rc3.d when the system starts up ? (1 Reply)
Discussion started by: JayNick
1 Replies
Login or Register to Ask a Question