Clonning and creating my own repo (help needed)

Issue #75 resolved
Phil Cote created an issue

I used ACS to install the RPMs on a system that does not have access to the IBM servers. I have other IBMi server that I need to install and maintain the RPMs. The PC I have ACS installed on does have access to the internet. I first followed the instruction on offline install (https://bitbucket.org/ibmi/opensource/src/20192a55b76d99a839815f61100e427ac75cdd11/docs/yum/#markdown-header-online-install-instructions-without-acs-open-source-management-tool) but decided that was not the best approach. I then use the instruction to clone. Now I’m lost on what to do next to have the other systems being able to use this repository that was downloaded when I cloned. The instructions on serving the internal repo mentions file nginx.conf but I can’t find it.

Can I simply add another .repo file to all server and configur it so that when I launch the Open Software utility in ACS so that it points to the internal repo so I can manage all RPMs via ACS? I have another repo file in /QOpenSys/etc/yum/repos.d called user-ibm.repo . I attached both the repo files as attachment.

Comments (13)

  1. Jesse G

    Hi, Phil.

    Thanks for posting your questions. You are spot on that you can configure all the other servers by just adding a .repo file. You just need to point it at your nginx server. I think the only piece that's missing for you is that nginx part.

    You will need to install nginx (this should undoubtedly be more explicit in the doc) and the run the startServer script, which should be in the IFS directory where you created the clone (in a /QOpenSys/QIBM/UserDara/rpm_repos subdirectory).

    This assumes you have an up-to-date ACS and have the checkbox for nginx documented here. ----> https://ibm.biz/ibmi-acs-clone-nginx

    The nginx support is a relatively new feature. If you used an older ACS, it would not create the nginx.conf or the scripts.

  2. Jesse G

    An aside, even if your IBM i has no external network access, you can still use the ACS tool to load on the initial environment (it will load through your PC). So it might be easier this way for your other systems

  3. Phil Cote reporter

    I attached another file with screen shots of when I open the ACS package manager. Yes, I did load the initial packages from the ACS since it is connected to the internet.

    My question on the screen shots, I think I still have leftovers of the time I tried to do offline setup. It shows some packages repository as @localMirror. I did remove that repo file with the same name a couple days ago. That local Mirror was in baseurl=file:///QOpenSys/etc/yum/IBMRepoLocalMirror/repo. Is there cleanup to do here? I have 2 repo files now in /QOpenSys/etc/yum/repos.d, ibm.repo and user-ibm.repo. They are attached to this case.

    I see the startserver script. How do I execute this? Via SSH terminal? What commands? Not sure how to use bash.

    What should the user-ibm.repo file look like on the repository server and what should it look like on the other servers?

    How do I access nginx? Is this though a web browser?

    Thanks.

  4. Jesse G

    It looks like ACS is working, which is good. The “Error” on the updates tab is a bit of a misnomer, saying there are no upgrades available (you’re already at the latest). I don’t think you need to worry about cleaning up those @localMirror ones. When they get updated, they’ll show the new repo.

    You can run the startServer script from anywhere you have a shell (for instance, QSH, Qp2Term, or most preferrably, an SSH terminal). It will start your nginx jobs in the background, and will, by default, launch an http server listening on port 2055.

    Your user-ibm.repo looks correct for on your repo server. On the other servers, it will look something like this:

    [user-ibm]
    name=user-ibm
    baseurl=http://myreposerver.mynetwork.com:2055
    enabled=1
    gpgcheck=0
    

    The other servers will access that nginx server via port 2055. You don’t need to do anything explicitly apart from start or stop it. You can test that the nginx server is running just by visiting the address in your web browser (for instance http://myreposerver.mynetwork.com:2055).

    Thanks!

  5. Phil Cote reporter

    Thanks Jesse. I am having issues starting the nginx server. I used the following commands:

    1. QSH and then /QOpenSys/QIBM/UserData/rpm_repos/ibm/startServer. No errors are displayed on the terminal. I checked to see if any QP0ZSPWT jobs were started and none were started. I also did not see any jobs in QHTTPSVR subsystem. I’m not sure where to find logs.
    2. I also tried these commands from the following link. (https://www.ibm.com/support/pages/how-install-nginx-ibm-i). The command I tried from these instructions STRQSH CMD('/QOpenSys/pkgs/bin/nginx'). The terminal session did not display and error messages. Again, I did not see any jobs in QHTTPSVR and did not see any QP0ZSPWT jobs.
    3. Then I tried CALL PGM(QP2TERM) PARM('/QOpenSys/pkgs/bin/nginx') and got the following
                                                   /QOpenSys/pkgs/bin/nginx                        
    

    nginx: [emerg] open() "/QOpenSys/etc/nginx/logs/nginx.pid" failed (2: No such file or directory)

    Looks like a log directory needs to be created.

    What path should I use for the startserver script?

    Where could I find the logs to do some trouble shooting?

    Thanks again for your help.

  6. Jesse G

    Is there any jobs listening on port 2055?

    You could try turning on logging by adding this line to nginx.conf (after the pid line):

    error_log error.log warn;

    That will cause error.log to be produced in /QOpenSys/etc/nginx (fully-qualify it if you want it somewhere else). The most common cause of error is that port 2055 is already taken, but hopefully this gives you some bread crumbs.

  7. Phil Cote reporter

    Yes, I see jobs listening on that port. My job names are different, not sure if that is a typo in the documentation. I have 5 jobs called QP0ZSPWP. I use my browser to point at that server on that port and get an error 403 Forbidden:

    403 Forbidden


    nginx/1.15.2

    I did add the line #error_log error.log warn;, all other lines have a # in front so I added one. I ended and restarted the server and the log file is not present. I’m assuming that a certain file in the IFS is public exclude but not sure where that would be. From searching the internet, it may be an issue with an index file. I also see in the path /QOpenSys/etc/nginx 2 nginx files (nginx.conf and nginx.conf.default). Is the second one .default the file that is being used?

    Would it be possible to have a remote session to my server to troubleshoot?

    Thanks again.

  8. Jesse G

    Oops… I gave you bad advice… I forgot that IBM’s default nginx.conf file turns off file listing by default. The 403 is expected (and likely means you’re up and running). You can test instead by visiting this in your browser: http://mysystem:2055/repodata/repomd.xml (it will either display xml or let you download an xml file with repo metadata).

    You can ignore the nginx.confand nginx.conf.default files in /QOpenSys/etc/nginx (the nginx.conf is for a global nginx config if that makes sense [in your case it does not] and the other is just a copy of the default).

  9. Phil Cote reporter

    I was able to open the XML file from the repository server. I modified the repo file on the other server (server2), the one that is not the repository.

    /QOpenSys/etc/yum/repos.d
    Beginning of data**
    [ibm]
    name=ibm
    baseurl=http://10.128.203.131.com:2055
    enabled=1
    gpgcheck=0
    sslverify=0
    End of Data********

    When I use ACS to connect to server2, it does not show any available updates and packages. Do I need to install, configure and start nginx on server2?

    Thanks

  10. Phil Cote reporter

    Disregard the last post. I see I had .com in my address. After fixing this, I can see everything and able to install curl.

    Thanks

  11. Log in to comment