-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Q] How to ensure that user-specific to autostart after IPL? #220
Comments
Greetings. See this snippet from the PostgreSQL sample: |
Ope! Also, because the strtcpcvr code runs the QTCP user profile, the service definition needs to be available to that user. The easy way is to make it global (you can move your .yml file to `/QOpenSys/etc/sc/services) |
Hi Jesse, thanks for the response. I tried following configuration: The service configuration is placed in the global services folder and the Node.js project is also in a publicy accessible project folder.
However, that didn't work either. Checking the spoolfiles for QTCP reveals:
the user 'gueney' exists, since I'm logged into it. What authorities does QTCP need to start a job with a specific user during IPL? |
First, thanks for your great and enthusiastic presentation about IBM i and Open Source tools on CEC2023! Second, to submit a job for another user on IBM i, the user submitting the job must have For your setup to work, QTCP (running SC for This is maybe not what you want - I personally don't like other users having In our setup, we abandoned |
Hello @chrjorgensen , I am glad you enjoyed it! It was initially supposed to be a workshop so that people could leave with a nice PASE setup and do the examples I showed on their own but scheduling issues made that impossible. Maybe next time 😁 Thank you for that information. I am relatively new to the IBM i's authority/permission management and I think I was really needing that info. The scheduled job idea is great. I'll try that out asap! |
We use the built-in job scheduler for all jobs needed to be started at IPL after the system is back to normal. The last command in our QSTRUP program calls a CL command, which runs the following SQL:
The SQL runs through all scheduled jobs and changes those having the text "At IPL:" to By having this, we can easily add new IPL jobs by adding a job schedule entry with the text starting with "At IPL:" and a future date. I ought to make a blog entry about this - it has been on my todo list for too long time now! 😆 |
That is a really cool way! Would love to read the blog article about it. Is this CCSID-aware? We have a German system running with CCSID 273 (or actually 1141, I think) and have had problems in the past with text-comparison based operations because of CCSID issues. Alternatively, I guess one could write the |
There is no CCSID issue - all characters in |
You can use any criteria for selecting the scheduled job, and store this criteria somewhere. But you add an additional step besides adding the scheduled job by having to add the scheduled job to your criteria. Our method is the simplest and has worked fine for us for years now. 😃 |
Duh, you're absolutely right. So cool! I'll show this to our sysadmin. Thanks so much @chrjorgensen |
One thing to add, though: at latest versions, the STRTCPSVR handler program is built with
https://www.ibm.com/docs/en/i/7.3?topic=keywords-usrprfuser-owner It's still complicated:
Are you willing to verify that the Certainly this is a common issue in user experience with autostarting jobs and:
|
Oops.... Sorry, I see that you already did. I wonder if that failure is a separate bug. We should take another look at that check |
That check is coming from this section of code: private void verifyBatchUser() throws SCException {
final String batchUser = getBatchUser();
if (StringUtils.isEmpty(batchUser)) {
return;
}
final File usrprfChecker = new File("/qsys.lib/" + batchUser + ".usrprf");
if (!usrprfChecker.exists()) {
throw new SCException(m_logger, FailureType.INVALID_SERVICE_CONFIG, "ERROR: Service '%s' is configured to run as user '%s' but that profile doesn't exist or you do not have sufficient authorities!!", m_mainService.getName(), batchUser);
}
} I don't know why that'd be failing, but it seems to me like we're throwing a false/inappropriate error here. @chrjorgensen , anything obvious that I'm missing? |
@ThePrez No, nothing obvious - I'm as puzzled as you are... Are we sure the user running SC at the time of the userprofile check has the right authority? I don't know how to debug this, I'm not a Java programmer... 😉 |
I created a Node.js app that I'm trying to autostart after IPL. But it seems like it's not exactly working. The configuration of the service is as follows and was created using
scinit
without any modifications afterwards. I thought it might be related to the issue of running multiple STRTCPSVR commands simultaneously and did setADDENVVAR ENVVAR(SC_TCPSVR_SUBMIT) VALUE('Y') LEVEL(*SYS) REPLACE(*YES)
My config is as follows
The text was updated successfully, but these errors were encountered: