Issue Details (XML | Word | Printable)

Key: CONTINUUM-655
Type: Improvement Improvement
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Emmanuel Venisse
Reporter: Felipe Leme
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Continuum

Add chkconfig support to the starting script

Created: 12/Apr/06 08:35 AM   Updated: 24/Apr/06 04:24 AM   Resolved: 24/Apr/06 04:24 AM
Return to search
Component/s: Core system
Affects Version/s: 1.0.2
Fix Version/s: 1.0.3

Time Tracking:
Original Estimate: 15 minutes
Original Estimate - 15 minutes
Remaining Estimate: 15 minutes
Remaining Estimate - 15 minutes
Time Spent: Not Specified
Time Spent - Not Specified

File Attachments: 1. File chkconfig_install.sh (1 kB)
2. Text File CONTINUUM-655.patch (1 kB)

Environment: Fedora Core & any RedHat-based system

Complexity: Novice


 Description  « Hide

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)


Felipe Leme added a comment - 12/Apr/06 08:38 AM

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

Felipe Leme added a comment - 12/Apr/06 08:40 AM

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

Emmanuel Venisse added a comment - 12/Apr/06 08:50 AM

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.


Felipe Leme added a comment - 12/Apr/06 09:37 AM

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...


Felipe Leme added a comment - 12/Apr/06 09:49 AM

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...)


Emmanuel Venisse added a comment - 12/Apr/06 09:52 AM

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


Felipe Leme added a comment - 12/Apr/06 12:45 PM

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.


Felipe Leme made changes - 12/Apr/06 12:45 PM
Field Original Value New Value
Attachment chkconfig_install.sh [ 20074 ]
Emmanuel Venisse added a comment - 12/Apr/06 02:31 PM

Can you provide a patch for documentation about your script?


Felipe Leme made changes - 12/Apr/06 03:12 PM
Attachment chkconfig_install.sh [ 20074 ]
Felipe Leme added a comment - 12/Apr/06 03:13 PM

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


Felipe Leme made changes - 12/Apr/06 03:13 PM
Attachment chkconfig_install.sh [ 20077 ]
Felipe Leme added a comment - 12/Apr/06 03:15 PM

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


Felipe Leme made changes - 12/Apr/06 03:15 PM
Attachment CONTINUUM-655.patch [ 20078 ]
Felipe Leme made changes - 12/Apr/06 03:22 PM
Attachment chkconfig_install.sh [ 20077 ]
Felipe Leme added a comment - 12/Apr/06 03:31 PM

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


Felipe Leme made changes - 12/Apr/06 03:31 PM
Attachment chkconfig_install.sh [ 20079 ]
Emmanuel Venisse added a comment - 24/Apr/06 04:24 AM

Applied. Thanks


Emmanuel Venisse made changes - 24/Apr/06 04:24 AM
Fix Version/s 1.0.3 [ 12330 ]
Status Open [ 1 ] Closed [ 6 ]
Resolution Fixed [ 1 ]
Assignee Emmanuel Venisse [ evenisse ]