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

  • Home
  • SEARCH
  • 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

Ask A Question

Stats

  • Questions 491k
  • Answers 491k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer It's pretty dreadful. It makes it impossible to set the… May 16, 2026 at 10:08 am
  • Editorial Team
    Editorial Team added an answer While there is no multiplier you could use in XAML,… May 16, 2026 at 10:08 am
  • Editorial Team
    Editorial Team added an answer Context. Many C APIs provide an extra void * argument… May 16, 2026 at 10:08 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I am accepting an input parameter of xml type so that i can accept
This post asks how to convert from bazaar to svn. I need to do
I need to convert a NSDate to a string using my personal data format...
I have a stringdate 16-MAY-2010 23:04:44 which i need to convert to gmt time
I have a UIDatePicker that shows (ex. April | 13 | 2010). I need
So I need to convert a date to a different format. With a bash
I have a function which receives a string parameter, I need to convert this
I need to be able to convert a string to a hierarchyid in c#.net
Like many people, I have several SVN repositories that contains several projects. I've decided
ux and i need delete a specific file every day. then I need to

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.