compiling within cage

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mike
    Junior Member
    Forum Explorer
    • Mar 2021
    • 13

    #1

    compiling within cage

    When trying to compile an eggdrop as a user in cage with normal shell enabled as bash, you receive this error. I tested full compile of eggdrop as root to assure gcc or tcl wasn lost in upgrade to cloudlinux

    bash-4.1$ ./configure

    This is Eggdrops GNU configure script.
    Its going to run a bunch of tests to hopefully make your compile
    work without much twiddling.

    checking for gcc... gcc
    checking for C compiler default output file name... a.out
    checking whether the C compiler works... yes
    checking whether we are cross compiling... no
    checking for suffix of executables...
    checking for suffix of object files... o
    checking whether we are using the GNU C compiler... yes
    checking whether gcc accepts -g... yes
    checking for gcc option to accept ANSI C... none needed
    checking how to run the C preprocessor... /lib/cpp
    configure: error: C preprocessor "/lib/cpp" fails sanity check
    See `config.log for more details.

    But as root, it fully compiles.
  • iseletsk
    Senior Member
    • Dec 2017
    • 1199

    #2
    if you are missing any RPMs inside cagefs, do:

    cagefsctl --addrpm=nameofrpm
    for each RPM
    followed by cagefsctl --update

    Comment

    • mike
      Junior Member
      Forum Explorer
      • Mar 2021
      • 13

      #3
      Doesn seem to work, I get a options menu for commands.

      root@server1 [/lib]# cagefsctl --addrpm=gcc

      Use following syntax to manage CageFS:
      /usr/sbin/cagefsctl [OPTIONS]
      Options:

      Comment

      • iseletsk
        Senior Member
        • Dec 2017
        • 1199

        #4
        rpm -qa|grep cagefs
        Are you sure you are running latest version of cagefs?

        Comment

        • mike
          Junior Member
          Forum Explorer
          • Mar 2021
          • 13

          #5
          I tried the full name too, same result

          cagefsctl --addrpm=gcc-c++-4.4.6-3.el6.x86_64

          Use following syntax to manage CageFS:
          /usr/sbin/cagefsctl [OPTIONS]
          Options:
          -i | --init : initialize CageFS (create CageFS if it does not exist)

          Comment

          • mike
            Junior Member
            Forum Explorer
            • Mar 2021
            • 13

            #6
            root@server1 [/]# rpm -qa|grep cagefs
            cagefs-3.2-1.el6.cloudlinux.x86_64
            root@server1 [/]#

            Comment

            • iseletsk
              Senior Member
              • Dec 2017
              • 1199

              #7
              sorry, try --addrpm gcc-c++

              Comment

              • mike
                Junior Member
                Forum Explorer
                • Mar 2021
                • 13

                #8
                root@server1 [/]# cagefsctl --addrpm gcc-c++
                root@server1 [/]# cagefsctl --addrpm gcc
                root@server1 [/]# cagefsctl --addrpm cpp
                root@server1 [/]# cagefsctl --update
                Updating users ...
                Updating user testacc ...

                works, but compiling as user testacc I still receive

                checking how to run the C preprocessor... /lib/cpp
                configure: error: C preprocessor "/lib/cpp" fails sanity check
                See `config.log for more details.

                Comment

                • iseletsk
                  Senior Member
                  • Dec 2017
                  • 1199

                  #9
                  Try adding /usr/include to .cfg files.

                  Comment

                  • mike
                    Junior Member
                    Forum Explorer
                    • Mar 2021
                    • 13

                    #10
                    Ok in the config,log file I now get..

                    fr om /usr/include/limits.h:145,
                    fr om /usr/lib/gcc/x86_64-redhat-linux/4.4.6/include/limits.h:122,
                    fr om /usr/lib/gcc/x86_64-redhat-linux/4.4.6/include/syslim its.h:7,
                    from /usr/lib/gcc/x86_64-redhat-linux/4.4.6/include/lim its.h:11,
                    from conftest.c:10:
                    /usr/include/bits/local_lim.h:39:26: error: linux/lim its.h: No such file or directory
                    configure:2389: $? = 1
                    configure: failed program was:
                    | /* confdefs.h. */
                    |

                    So, Im still missing a rpm to add that will allow cage users to talk to kernel header.. Not sure what though as I tried both glibc-headers-devel and glibc-header but they aren installed on the machine.

                    Comment

                    • mike
                      Junior Member
                      Forum Explorer
                      • Mar 2021
                      • 13

                      #11
                      Sorry first day playing with this, where do I find the .cfg file?

                      Comment

                      • mike
                        Junior Member
                        Forum Explorer
                        • Mar 2021
                        • 13

                        #12
                        found it /etc/cagefs/conf.d and added it to shells.cfg

                        and getting further now

                        checking for working mmap... yes
                        checking for broken libsafe sscanf... no
                        checking for Tcl library... not found
                        checking for Tcl header... found /usr/include/tcl.h
                        checking whether the Tcl system has changed... yes
                        configure: error:

                        Tcl cannot be found on this system.

                        so need to add tcl rpms now

                        Comment

                        • avolkov
                          Member
                          • Apr 2017
                          • 50

                          #13
                          .cfg files are in /etc/cagefs/conf.d directory

                          Comment

                          • mike
                            Junior Member
                            Forum Explorer
                            • Mar 2021
                            • 13

                            #14
                            make[1]: Leaving directory `/home/testacc/eggdrop1.6.19/scripts

                            Installation completed.

                            Yay! Thank you for all the prompt help!

                            Comment

                            • mike
                              Junior Member
                              Forum Explorer
                              • Mar 2021
                              • 13

                              #15
                              Is there a way in cage to limit running background processes? Like say only allow 2 eggdrops to run.

                              Comment

                              Working...