LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   The init-script is not started during reboot (https://www.linuxquestions.org/questions/linux-software-2/the-init-script-is-not-started-during-reboot-4175472422/)

thomas2004ch 08-07-2013 12:43 AM

The init-script is not started during reboot
 
Hi,

I have an init-script under /ect/init.d called jboss5. I've added this to the chkconfig. This means, if I reboot the machine, this init-script will be started. But it doesn't. I have to start it manually.

What could be the reason?

Firerat 08-07-2013 12:54 AM

did you make it executable? ( chmod 755 )
does it start with a shebang? ( #!/bin/sh )
do you have appropriate symlinks in /etc/rc*.d?

chrism01 08-07-2013 01:23 AM

Does it have the correct ownerships? (& everything Firerat asked)
Run
Code:

chkconfig --list jboss5
to check its turned on for the correct runlevel(s)

thomas2004ch 08-07-2013 02:32 AM

Quote:

Originally Posted by Firerat (Post 5004564)
did you make it executable? ( chmod 755 )
does it start with a shebang? ( #!/bin/sh )
do you have appropriate symlinks in /etc/rc*.d?

It's executable, otherwise I can't start it manually.

Yes, it beginns with #!/bin/sh

It has appropriate symlinks in /etc/rc3.d

thomas2004ch 08-07-2013 02:34 AM

Quote:

Originally Posted by chrism01 (Post 5004575)
Does it have the correct ownerships? (& everything Firerat asked)
Run
Code:

chkconfig --list jboss5
to check its turned on for the correct runlevel(s)

It has the correct ownerships. It's owned by root.

chkconfig --list jboss5 shows:
Code:

# chkconfig --list jboss5
jboss5        0:off  1:off  2:on    3:on    4:on    5:on    6:off

I have other init-scripts and have the same configurations and they work fine.

Firerat 08-07-2013 02:47 AM

Is it dependent on other service(s)?
for instance, does it need a working network connection and if so it is 'ordered' to start _after_ required service(s)

druuna 08-07-2013 02:53 AM

@thomas2004ch: Are you aware of this page: StartJBossOnBootWithLinux

thomas2004ch 08-07-2013 03:15 AM

Quote:

Originally Posted by Firerat (Post 5004608)
Is it dependent on other service(s)?
for instance, does it need a working network connection and if so it is 'ordered' to start _after_ required service(s)

It's independent. Otherwise I can't start it manually, right?

thomas2004ch 08-07-2013 03:18 AM

Quote:

Originally Posted by druuna (Post 5004615)
@thomas2004ch: Are you aware of this page: StartJBossOnBootWithLinux


I know this page. In the fact there is Jboss5 and Jboss7 on this machine. The init-script starting Jboss7 works fine. I wonder why the init-script for Jboss5 not. But as I said, when I start it manually there is no problem.

druuna 08-07-2013 03:23 AM

Quote:

Originally Posted by thomas2004ch (Post 5004628)
It's independent. Otherwise I can't start it manually, right?

Nope, that's the wrong assumption. If your start it manually, your box is already fully booted and all services are available.

If jboss is started during the boot process it could be that some services that jboss relies on aren't yet started. Have a look at the link I posted, it shows that the jbos init-script has a high number, this to make sure other services are up and running before jboss is started.

thomas2004ch 08-07-2013 03:44 AM

The init-script for Jboss5 has following code at the beginning:

Code:

#!/bin/sh
#
# JBoss Control Script for Jboss5
#
# chkconfig: 3 81 02
...

And the init-script for Jboss7 has following code at the beginning:
Code:

#!/bin/sh
#
# JBoss Control Script for Jboss5
#
# chkconfig: 3 80 20
...

One can see the Jboss5 has a higher number than that of Jboss7. But the Jboss7 could be started during reboot. This wonders me.

druuna 08-07-2013 04:45 AM

I just noticed this thread you posted: init-script for Solaris

Question: Is the above done on Linux or Solaris?

druuna 08-07-2013 04:45 AM

Sorry for the double post (slow or hanging LQ connections, been this way for over a week now).

thomas2004ch 08-07-2013 04:58 AM

Quote:

Originally Posted by druuna (Post 5004685)
I just noticed this thread you posted: init-script for Solaris

Question: Is the above done on Linux or Solaris?

That's another question abou tinit-script for Solaris. It's solved. By Solaris I use the SMF.

My init-script here is for RedHat LINNUX. It's quite different with that of Solaris.

druuna 08-07-2013 05:04 AM

The header in the init script doesn't necessarily reflect the correct init-script name. Can you post the output of:
Code:

ls -l /etc/rc*d/*jboss*


All times are GMT -5. The time now is 03:18 AM.