Solved

Ruby - Rails - iSeries

Posted on 2014-11-12
3
264 Views
Last Modified: 2014-11-12
Is anyone using Ruby on Rails on the iSeries? I am attempting to start this up from a command line, instead of within QSH.   From within QSH, I run the following:

CD /tmp/sfdc_rc_trunk_nojruby              
thin start -e development -p 9292

This starts up a session but holds onto that session so you are stuck in QSH. If you end it and get out - Ruby is ended.

I was attempting to start this from a command line - but haven't had any luck. I created a shell script that said the following:

#!/usr/bin/sh                              
CD /tmp/sfdc_rc_trunk_nojruby              
thin start -e development -p 9292  

I put that in the same directory as above - and tried to start it up using one of the following 2 commands:

SBMJOB CMD(CALL PGM(QP2SHELL) PARM('/tmp/sfdc_rc_trunk_nojruby/startruby')) JOB(POWER_RUBY) JOBQ(*LIBL/QRUBY) USER(QSYSOPR)

SBMJOB CMD(QSH CMD('/tmp/sfdc_rc_trunk_nojruby/thin start -e development -p 9292')) JOB(POWER_RUBY) JOBQ(*LIBL/QRUBY) USER(QSYSOPR)

Both jobs "complete" right away and don't stay running and Ruby is not "started".

I also made sure that the authority was set to excute, so that shouldn't be a problem.

Any assistance would be appreciated.
0
Comment
Question by:Matthew Roessner
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 35

Accepted Solution

by:
Gary Patterson earned 500 total points
ID: 40437392
"thin start" starts a server - so what is happening when you start it interactively in QSH is correct and normal.  It really isn't something that you'd normally start interactively.

You can't run shell scripts reliably from QP2SHELL without doing some significant setup first, so I suggest you take that off the table for now.

So it looks like you can start the server from QSH interactively.  What happens when you start QSH interactively and enter the same command that you are submitting to batch?  Does it work without changing the directory first?

/tmp/sfdc_rc_trunk_nojruby/thin start -e development -p 9292

Assuming that doesn't work, next, test your startruby shell script interactively in QSH.  Does it work?  If so, then submit the shell script to batch using the QSH command, not QP2SHELL.

Unless your Ruby distro is specifically designed for QSH, you are probably better off running it in a PASE shell, so you may want to change your shebang line to to run in the PASE shell.  This means that even if you start from QSH, script gets executed in PASE - generally a good thing.

#!/QOpenSys/usr/bin/sh  

If you can get it to work from QSH interactive, then it should work OK from QSH batch, too.

- Gary

I
0
 
LVL 1

Author Closing Comment

by:Matthew Roessner
ID: 40437436
When I start QSH interactively (STRQSH) and enter the command I am submitting to batch:

/tmp/sfdc_rc_trunk_nojruby/startruby

Everything starts up fine (but I am "stuck" in QSH and if I exit - Ruby ends.

I did have to modify my startruby script to make sure was running from PASE:

#!/QOpenSys/usr/bin/sh            
cd /tmp/sfdc_rc_trunk_nojruby      
thin start -e development -p 9292  

Now when I start from a command line:

SBMJOB CMD(QSH CMD('/tmp/sfdc_rc_trunk_nojruby/startruby')) JOB(POWER_RUBY) JOBQ(*LIBL/QRUBY) USER(QSYSOPR)

Everything starts up correctly and all seems to be working as expected.  Looks like starting my script and running from the pase shell was the ticket.

Thanks for your help Gary!
0
 
LVL 35

Expert Comment

by:Gary Patterson
ID: 40437519
Happy to help.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
RPG Free Prototypes using  *LDA data 5 230
AS400  SNDDST Truncating 5 112
AS/400 Overlays 3 42
DBCS data to printer file iSeries 8 23
A lot of things can happen during a presentation, worst of which is “death by PowerPoint.” Here are a few mistakes to avoid to make your slides clean.
The goal of this blog is: - To define the incident management process - To go over the key elements of an incident management system - To look into incident alert management tools that integrate with ConnectWise.
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question