Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 880829
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T12:09:44+00:00 2026-05-15T12:09:44+00:00

I need to convert a init.d script that uses ruby to not use ruby.

  • 0

I need to convert a init.d script that uses ruby to not use ruby. I can use perl or python or something else, but I can’t use ruby. My main problem is figuring out how to dynamically get the list of *.jar files in a directory and separate them with ‘:’. The rest I could easily do with a bash script.

Here is the Ruby code I’m working with:

#!/usr/local/bin/ruby

require 'fileutils'

HOME = '/usr/local/myproject'
JAVA_HOME = '/usr/java/jdk'
JARS = Dir.glob(File.join(HOME, 'lib', '*.jar')).join(':')
PID_FILE = '/var/run/myproject.pid'
OUT_FILE = File.join(HOME, "stdout")
ERR_FILE = File.join(HOME, "stderr")

case ARGV.first
when 'start'
  exec "/usr/local/bin/jsvc -home #{JAVA_HOME} -cp #{JARS} -pidfile #{PID_FILE} -DHOME=#{HOME} -user me -outfile #{OUT_FILE} -errfile #{ERR_FILE} mypackage.MyProject"
when 'stop'
  exec "/usr/local/bin/jsvc -home #{JAVA_HOME} -cp #{JARS} -pidfile #{PID_FILE} -stop mypackage.MyProject"
end
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T12:09:44+00:00Added an answer on May 15, 2026 at 12:09 pm

    This should do the job:

    JARS=`ls $HOME/lib/*.jar | tr '\n' ':'`
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've probably overlooked something simple, but I can't figure out how to convert a
I need to convert a string vector in a simple string. I do not
I have a string and need convert it to a date, but it doesn't
I need to convert this java code in force.com apex. i tried to use
I need to convert my NSString in the end to an NSDate but I
In Python, how do I convert a list to *args ? I need to
I need to use NSStringFromRange but I only have a start and end UITextPositions.
I need to convert a String to enum. I followed the idea in String
I need to convert full state name to its official state address code. For
I need to convert a time difference (diff) between two actions into a human

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.