Continuum

Add chkconfig support to the starting script

Details

  • Type: Improvement Improvement
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.0.2
  • Fix Version/s: 1.0.3
  • Component/s: Core system
  • Labels:
    None
  • Environment:
    Fedora Core & any RedHat-based system
  • Complexity:
    Novice
  • Number of attachments :
    2

Description

I'm using Fedora Core 4 and wanted to start Continuum on startup, so I followed the instructions below:

http://maven.apache.org/continuum/guides/mini/guide-linux-boot.html

FC (and any RH-based distro) doesn't have the update-rc.d script; instead, they have chkconfig. So, I created the link on /etc/rc.d and tried to enable continuum on chkconfig, but it failed:

[root@localhost init.d]# chkconfig --add continuum
service continuum does not support chkconfig

Looking at the shell script, it's missing the chkconfig commentaries, so I added them:

#! /bin/sh

  1. chkconfig: 345 20 80
  2. description: Maven Continuum server

Now everything is fine:

[root@localhost init.d]# chkconfig --add continuum

[root@localhost init.d]# chkconfig continuum on
[root@localhost init.d]# service continuum start
Starting continuum...

I could provide a patch, but I don't know how the script is generated. So, long story short, this issue requires 2 changes:

  • add the comment above in the run.sh script (or whatever generates it)
  • update the documentation (URL above)

Activity

Hide
Felipe Leme added a comment -

OBS: the 1. an 2. above are actually comments (#); I don't know why they were converted while generating this Jira. Anyway, let me try again:

  1. chkconfig: 345 20 80
  2. description: Maven Continuum server
Show
Felipe Leme added a comment - OBS: the 1. an 2. above are actually comments (#); I don't know why they were converted while generating this Jira. Anyway, let me try again:
  1. chkconfig: 345 20 80
  2. description: Maven Continuum server
Hide
Felipe Leme added a comment -

How "nice": Jira thinks # is a numbering system! Let me try again...

Line 1:

  1. chkconfig: 345 20 80

Line 2:

  1. description: Maven Continuum server
Show
Felipe Leme added a comment - How "nice": Jira thinks # is a numbering system! Let me try again... Line 1:
  1. chkconfig: 345 20 80
Line 2:
  1. description: Maven Continuum server
Hide
Emmanuel Venisse added a comment -

The shell script is generated by plexus-runtime-builder, but i don't want to modify it now because all generated run.sh will have the same chkconfig/description
But you can provide a patch for the documentation.

Show
Emmanuel Venisse added a comment - The shell script is generated by plexus-runtime-builder, but i don't want to modify it now because all generated run.sh will have the same chkconfig/description But you can provide a patch for the documentation.
Hide
Felipe Leme added a comment -

Actually, it's not so simple; just now I realized it doesn't work

It does call the script, but the wrapper fails:

STATUS | wrapper | 2006/04/12 12:36:25 | --> Wrapper Started as Daemon
STATUS | wrapper | 2006/04/12 12:36:25 | Launching a JVM...
ERROR | wrapper | 2006/04/12 12:36:25 | Unable to start JVM: No such file or directory (2)ERROR | wrapper | 2006/04/12 12:36:25 | Critical error: wait for JVM process failed (No child processes)
ERROR | wrapper | 2006/04/12 12:36:25 | Unable to start a JVM
STATUS | wrapper | 2006/04/12 12:36:25 | <-- Wrapper Stopped

I will investigate why...

Show
Felipe Leme added a comment - Actually, it's not so simple; just now I realized it doesn't work It does call the script, but the wrapper fails: STATUS | wrapper | 2006/04/12 12:36:25 | --> Wrapper Started as Daemon STATUS | wrapper | 2006/04/12 12:36:25 | Launching a JVM... ERROR | wrapper | 2006/04/12 12:36:25 | Unable to start JVM: No such file or directory (2)ERROR | wrapper | 2006/04/12 12:36:25 | Critical error: wait for JVM process failed (No child processes) ERROR | wrapper | 2006/04/12 12:36:25 | Unable to start a JVM STATUS | wrapper | 2006/04/12 12:36:25 | <-- Wrapper Stopped I will investigate why...
Hide
Felipe Leme added a comment -

Got the problem: my system didn't have JAVA_HOME properly set for the service scripts. So, the proposed change should be enough (I will try to fix my system to confirm though...)

Show
Felipe Leme added a comment - Got the problem: my system didn't have JAVA_HOME properly set for the service scripts. So, the proposed change should be enough (I will try to fix my system to confirm though...)
Hide
Emmanuel Venisse added a comment -

you don't have JAVA_HOME in your path when the script start

Show
Emmanuel Venisse added a comment - you don't have JAVA_HOME in your path when the script start
Hide
Felipe Leme added a comment -

Ok, here is a shell script that creates a wrapper (no pun intended) on /etc/init.d to start continuum, add and enable the wrapper on chkconfig.

The wrapper not only calls continuum but also checks if JAVA_HOME is set.

Show
Felipe Leme added a comment - Ok, here is a shell script that creates a wrapper (no pun intended) on /etc/init.d to start continuum, add and enable the wrapper on chkconfig. The wrapper not only calls continuum but also checks if JAVA_HOME is set.
Hide
Emmanuel Venisse added a comment -

Can you provide a patch for documentation about your script?

Show
Emmanuel Venisse added a comment - Can you provide a patch for documentation about your script?
Hide
Felipe Leme added a comment -

Improved script that offers the option to run continuum as a different user than root.

Show
Felipe Leme added a comment - Improved script that offers the option to run continuum as a different user than root.
Hide
Felipe Leme added a comment -

Ok, here is the patch - note though that I didn't test it, as 'mvn site' failed to me...

Show
Felipe Leme added a comment - Ok, here is the patch - note though that I didn't test it, as 'mvn site' failed to me...
Hide
Felipe Leme added a comment -

Improved patch that adds comments on how to run it as a continuum user (and not root).

Show
Felipe Leme added a comment - Improved patch that adds comments on how to run it as a continuum user (and not root).
Hide
Emmanuel Venisse added a comment -

Applied. Thanks

Show
Emmanuel Venisse added a comment - Applied. Thanks

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved:

Time Tracking

Estimated:
15m
Original Estimate - 15 minutes
Remaining:
15m
Remaining Estimate - 15 minutes
Logged:
Not Specified
Time Spent - Not Specified