-
Notifications
You must be signed in to change notification settings - Fork 17
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
Correct debug certs path #27
Conversation
Signed-off-by: worksofliam <mrliamallan@live.co.uk>
@worksofliam |
@SJLennon Yes, exactly that. But the server would still need to be started by an admin. |
@worksofliam |
@SJLennon There are only two ways to start the debug service:
|
So after an IPL (which PUB400 does every Sunday morning), someone with advanced authority would need to bring up Code for IBM i and start the server. Or through New Nav if the certificates had been generated. To me, not having a command to start the server seems counter intuitive to the concept of automation and avoiding manual input to get the system running. Do you know what special authority is required to start the server? I'll check it out when released, but it seems like the current debug isn't going to work on PUB400 |
@SJLennon Right, as it stands in VS Code today (before this merge) the debugger won't work. But, after this merges and releases, it might. I would think SECADM would be needed to generate certificates and start the server.
Agree. Not much I can do about that because the Debug Service is out of my control. Though, technically it can be automated through PASE (which is how we also start it) |
I'll go out on a limb here, but since we basically run a set of shell commands to start the debug service, putting them in a shell script that gets executed along with |
@sebjulliand @worksofliam |
@SJLennon I ran a fewt test and here are two scripts that can help with that. Generate certificates and keystore script - here I assume that the server's common name is PUB400.COM and its IP #!/QOpenSys/pkgs/bin/bash
openssl genrsa -out debug_service.key 2048;
openssl req -new -key debug_service.key -out debug_service.csr -subj '/CN=PUB400.COM';
openssl x509 -req -in debug_service.csr -signkey debug_service.key -out debug_service.crt -days 1095 -sha256 -req -extfile <(printf "subjectAltName=DNS:PUB400.COM,IP:185.113.5.134");
openssl pkcs12 -export -out debug_service.pfx -inkey debug_service.key -in debug_service.crt -password pass:PUB400.COM; Start debug service script, assuming the keystore has been generated in #!/QOpenSys/pkgs/bin/bash
export JAVA_HOME=/QOpenSys/QIBM/ProdData/JavaVM/jdk80/64bit;
export DEBUG_SERVICE_KEYSTORE_FILE="/QIBM/UserData/IBMiDebugService/certsdebug_service.pfx";
export DEBUG_SERVICE_KEYSTORE_PASSWORD=$(DEBUG_SERVICE_KEYSTORE_PASSWORD="PUB400.COM" /QIBM/ProdData/IBMiDebugService/bin/encryptKeystorePassword.sh | /usr/bin/tail -n 1);
/QOpenSys/usr/bin/nohup /QIBM/ProdData/IBMiDebugService/bin/startDebugService.sh &
system "STRDBGSVR"; So, if we can have the PUB400 admins to generate the keystore (once) and then schedule the script above to start the debug service and debug server when the LPAR is booted, that would make debugging on PUB400 from VSCode available to everybody. |
Maybe we can have ServiceCommander managing the service? I will look into this... |
@sebjulliand Appreciate the scripting effort. Shell scripting isn't my strength... I did some testing on PUB400 with interesting results. I created I confirmed that there were no certificates:
I ran gencerts.sh:
But no certificates were generated:
In Code for IBM i I ran
Emptied IBMIDEBUGSERVICE and ran the script commands one at a time:
But still no certs. Anything else I can do? |
@SJLennon What is the working directory (you see that using the You probably have the certificate files from your tests in your home directory... You could run Btw, remember to change the mode of the certificate files after creation - your profile will be the owner and no-one else may read all the files. You change this by running |
@chrjorgensen Regarding the mode, considering that I am thinking about tightly locked down machines, like PUB400.COM. On PUB400, the IBMIDEBUGSERVICE directory is owned by QSYS, so I guess it was created by IBM, with this authority, and anyone can write to it, but can't delete it. Certificates currently generated by Code for IBM i have the authorities that look like this, which is different from chmod 777.
I'm wondering if maybe these authorities are being changed in 2.9.0 and if there should be some documentation produced for tightly controlled machine with multiple users. This script now creates certs for me:
Now on to get the debug server started. |
I've contacted Holger Scherer, the great guy and IBM Champion behind PUB400, if we could have the debug service running on PUB400 and are now waiting for his answer. There's no longer any need for anyone to make certificates or start the debug server - it will all be fixed when Holger hopefully have agreed to my request and we have the debug service up and running with the correct certificates... 🙏 |
Awesome! Thank you very much @chrjorgensen ! |
@chrjorgensen Questions:
Thanks for making the effort. |
No, it should work for all Code for IBM i versions with code for the IBM i debugger extension - which versions I'm not sure, but maybe @worksofliam can answer?
The debug server is started as part of the IPL - so no manual intervention is required. We only need the debug service to be started as well as part of the IPL. |
I'd double check that as it is not running right now. |
Sorry, my mistake - I double-checked and the server running is the debug hub ( The debug servers and service really ARE confusing... 😞 I will talk to Holger about having the debug server started at IPL as well... |
Right! But we'll try to ease this with that debug server/service status PR 😉 |
In theory this should work in 2.8.0 assuming the path is pointing to the correct place in the Connection Settings. |
@chrjorgensen So maybe the port isn't open. Though I do seem to have started a QB5ROUTER job:
Anything I can do/provide to help? Should I need to create a new issue for this? Debug is indeed confusing (on PUB400).. |
No description provided.