LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 08-07-2013, 12:43 AM   #1
thomas2004ch
Member
 
Registered: Aug 2009
Posts: 539

Rep: Reputation: 33
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?
 
Old 08-07-2013, 12:54 AM   #2
Firerat
Senior Member
 
Registered: Oct 2008
Distribution: Debian sid
Posts: 2,683

Rep: Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783
did you make it executable? ( chmod 755 )
does it start with a shebang? ( #!/bin/sh )
do you have appropriate symlinks in /etc/rc*.d?
 
Old 08-07-2013, 01:23 AM   #3
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,362

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
Does it have the correct ownerships? (& everything Firerat asked)
Run
Code:
chkconfig --list jboss5
to check its turned on for the correct runlevel(s)
 
Old 08-07-2013, 02:32 AM   #4
thomas2004ch
Member
 
Registered: Aug 2009
Posts: 539

Original Poster
Rep: Reputation: 33
Quote:
Originally Posted by Firerat View Post
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
 
Old 08-07-2013, 02:34 AM   #5
thomas2004ch
Member
 
Registered: Aug 2009
Posts: 539

Original Poster
Rep: Reputation: 33
Quote:
Originally Posted by chrism01 View Post
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.
 
Old 08-07-2013, 02:47 AM   #6
Firerat
Senior Member
 
Registered: Oct 2008
Distribution: Debian sid
Posts: 2,683

Rep: Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783
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)
 
Old 08-07-2013, 02:53 AM   #7
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
@thomas2004ch: Are you aware of this page: StartJBossOnBootWithLinux
 
Old 08-07-2013, 03:15 AM   #8
thomas2004ch
Member
 
Registered: Aug 2009
Posts: 539

Original Poster
Rep: Reputation: 33
Quote:
Originally Posted by Firerat View Post
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?
 
Old 08-07-2013, 03:18 AM   #9
thomas2004ch
Member
 
Registered: Aug 2009
Posts: 539

Original Poster
Rep: Reputation: 33
Quote:
Originally Posted by druuna View Post
@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.

Last edited by thomas2004ch; 08-07-2013 at 03:40 AM.
 
Old 08-07-2013, 03:23 AM   #10
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Quote:
Originally Posted by thomas2004ch View Post
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.
 
Old 08-07-2013, 03:44 AM   #11
thomas2004ch
Member
 
Registered: Aug 2009
Posts: 539

Original Poster
Rep: Reputation: 33
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.
 
Old 08-07-2013, 04:45 AM   #12
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

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

Question: Is the above done on Linux or Solaris?
 
Old 08-07-2013, 04:45 AM   #13
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

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

Last edited by druuna; 08-07-2013 at 04:47 AM.
 
Old 08-07-2013, 04:58 AM   #14
thomas2004ch
Member
 
Registered: Aug 2009
Posts: 539

Original Poster
Rep: Reputation: 33
Quote:
Originally Posted by druuna View Post
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.
 
Old 08-07-2013, 05:04 AM   #15
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
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*
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Init.d script not executing at shutdown and reboot roberbizimhatemo Linux - General 19 07-02-2019 04:35 AM
Unable to shutdown, reboot, halt, init 6, init 0 procfs Linux - Newbie 6 07-23-2012 02:58 AM
Can not run reboot script when program started thru rc.local rmfinsmt Linux - Newbie 5 03-26-2012 02:13 PM
script under /etc/init.d can not be started by reboot thomas2004ch Linux - Software 4 11-15-2011 05:22 AM
Reboot init script doesn't work casey0999 Linux - Software 6 02-25-2004 05:15 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 07:30 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration