Closed jeffg324 closed 3 years ago
@jeffg324 there are multiple ways to do it from QSH but this one I believe is very straight forward.
Create this script somewhere in the IFS on your system (you will need to reference it later) https://github.com/ThePrez/IBMiOSS-utils/blob/master/sbmjob.sh
Call it like this: QSH CMD('/oss_scripts/sbmjob.sh node-red')
NOTE: You can change which subsystem node (or whatever job you want to launch) starts under by modifying the script. I changed my to QPGMR.
Things to keep in mind:
I hope this helps. Let me know if you have other questions.
That's great, I was on the right path, thanks Matt!
You're welcome
Thanks, @thebeardedgeek !!
If you get into starting/managing multiple services, you might find my Service Commander tool handy as well.
That's a slick tool, thanks @ThePrez !
I noticed you have Kafka in the video, I'm interested in trying that as well, any tips on where to get install and setup help?
I do! https://github.com/IBM/ibmi-oss-examples/blob/master/camel/dtaq_to_kafka/KAFKA_DEPLOY.md
And you can get some free hands-on at https://www.zend.com/ibm-i-training-exercises
Feel free to come back with any questions remaining that you might have
Also, FWIW, I hope to publish this feature next week: https://github.com/ThePrez/ServiceCommander-IBMi/issues/25
It should allow you to define services as autostart and then change the *SC
TCP server to autostart (at least that's the vision. I am a newb at that aspect of things)
@jeffg324 Were you ever able to get this working?
I was playing around with this today and came up with another way to do it: ===> SBMJOB CMD(QSH CMD('/oss_scripts/start-node.sh')) JOB(NODERED) JOBQ(QPGMR) USER(MATTDEV)
Contents of start-node.sh:
PATH=/QOpenSys/pkgs/lib/nodejs12/bin:/QOpenSys/pkgs/bin:$PATH
export PATH
echo $PATH
node-red
@thebeardedgeek Thanks for following up on this. I was not able to get it to work and after spending a few hours on it I got distracted by 'work' and haven't been back. ;-)
I put your script in with a small change to use nodejs14 and the sbmjob worked like a charm! Thanks again, looking forward to customizing some dashboard elements for our environment.
@jeffg324 glad to hear that worked.
Here are two things to take into consideration.
node-red
and that's itSBMJOB CMD(QSH CMD('start-node.sh')) JOB(NODERED) JOBQ(QPGMR) USER(MATTDEV)
Personally I like specifying the path so that it is explicit.@jeffg324 , I think this is resolved, but feel free to reopen if you need more assistance. @thebeardedgeek , thanks for the help!
Hi, I set up the Node-Red Dashboard example (Thank you Matt!) and I'm sure I'm missing something easy....... how do you auto start node-red without signing into SSH? I would like to have it start anytime the system restarts with my intervention, maybe submit a job with STRQSH?