Can’t install mogodb and mysql due systemd lack

Forum Forums General Software Can’t install mogodb and mysql due systemd lack

  • This topic has 7 replies, 4 voices, and was last updated Sep 2-1:22 am by Pelucia Siffred.
Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #87876
    Member
    Pelucia Siffred

      I’m trying to install mongodb with the instructions from this link: https://www.mongodb.com/docs/manual/tutorial/install-mongodb-on-debian/
      However, the following error message is shown in the terminal during installation:
      /var/lib/dpkg/info/mongodb-org-server.postinst: 44: systemctl: not found

      I test the mongod service and it just doesn’t exist:
      $ sudo service mongod status
      mongod: unrecognized service

      I’m having the same problem when I try to install mysql, the installer doesn’t install the System V Init scripts.

      #87883
      Forum Admin
      anticapitalista
        Helpful
        Up
        0
        ::

        You could ask mongodb and Debian to provide the SysVinit scripts.
        It’s not the fault of antiX that they don’t.

        Philosophers have interpreted the world in many ways; the point is to change it.

        antiX with runit - leaner and meaner.

        #87884
        Member
        iznit
          Helpful
          Up
          0
          ::

          the installer doesn’t install the System V Init scripts.

          Pelucia Siffred, mongodb have a ready to go init script https://raw.githubusercontent.com/mongodb/mongo/master/debian/init.d and read the manpage for update-rc.d command.

          For mysql (or mariadb), these:
          https://mariadb.com/kb/en/mysqlserver/#manually-installing-with-sysvinit
          https://raw.githubusercontent.com/mysql/mysql-server/8.0/support-files/mysql.server.sh

          Hey, those initscripts may need to be tweaked. Exact copy paste may produce errors.

          #87888
          Member
          olsztyn
            Helpful
            Up
            0
            ::

            These are just databases. In principle they should be able to be started independently from OS init, after OS is up. Is this some their restriction that they need OS init to be started?
            If it is their installation procedure restriction that would be a disappointment that their developers do not recognize such simple principle of architecture…

            • This reply was modified 8 months ago by olsztyn.

            Live antiX Boot Options (Previously posted by Xecure):
            https://antixlinuxfan.miraheze.org/wiki/Table_of_antiX_Boot_Parameters

            #87908
            Member
            iznit
              Helpful
              Up
              0
              ::

              okay, back to this detail

              the following error message is shown in the terminal during installation:
              /var/lib/dpkg/info/mongodb-org-server.postinst: 44: systemctl: not found

              Possible workaround, create a “dummy” [[[do nothing]]] systemctl
              sudo touch /usr/bin/systemctl
              then use chmod command or a file manager to set /usr/bin/systemctl as executable
              then again attempt to install mongodb.

              As olsztyn said, you could just manually start, as needed, the mysql and mongodb server processes.
              Or you could start the mysql and mongodb server processes via lines added into your session “startup” file.

              • This reply was modified 8 months ago by iznit. Reason: split long post into 2 parts
              #87910
              Member
              iznit
                Helpful
                Up
                0
                ::

                If you do do want mimic systemctl:

                A bit of pain in the butt to manually set up [[[ not tested, I cannot vouch for it ]]], but if this pythonic service manager works for you it will also be more broadly useful for managing other additional “service” daemon processes.

                download this….. http://deb.debian.org/debian/pool/main/d/docker-systemctl-replacement/docker-systemctl-replacement_1.4.4181-1.1.debian.tar.xz

                docker-systemctl-replacement

                Description: daemonless "systemctl" command to manage services without systemd
                 "systemctl" is a replacement command to control system daemons without
                 systemd. "systemctl" is useful in application containers where systemd is
                 not available to start/stop services.

                …..find systemctl3.py in the extracted tar.xz contents, and copy it to
                /usr/bin/systemctl
                [[[ it is a python3 script and may need minor edits ]]]
                and also click these weblinks to read

                NOTES.md
                HINTS.md
                STARTORDER.md
                plus the assorted *.md files here [[[ here ]]]
                or [[[better]]] download docker-systemctl-replacement_1.4.4181.orig.tar.xz and extract copies of those docs for future reference.

                #87927
                Member
                Pelucia Siffred
                  Helpful
                  Up
                  0
                  ::

                  Thank you very much @iznit, the mongodb script worked, but it has a bug. When I run “sudo service mongod start” the mongodb service starts, but when I run “sudo service mongod status” the following message appears:
                  Checking status of database: mongod apparently not running failed!

                  This message is wrong, I have verified that mongod is running. Also, “sudo service mongod stop” doesn’t work either.

                  As for the mysql script, I had to make some changes for it to work. I had to add the following lines:

                  PID_FILE_DIR="$(dirname "${mysqld_pid_file_path}")"
                  [ ! -d "${PID_FILE_DIR}" ] && mkdir -p -m 0755 "${PID_FILE_DIR}" && chown mysql:mysql "${PID_FILE_DIR}" || :
                  [ ! -d "${LOG_DIR}" ] && mkdir -p -m 0755 "${LOG_DIR}" && chown mysql:mysql "${LOG_DIR}" || :

                  Had to do this because the pid and log folders are removed when you power off the system, but they are not recreated by systemd when the system powers up. The mysql script worked perfectly with the changes I made.
                  The tip to mimic systemctl is great, I’ll test it and bring the answers soon. Thanks a lot for the tips.

                  #87928
                  Member
                  Pelucia Siffred
                    Helpful
                    Up
                    0
                    ::

                    For mongodb systemctl3.py has the same behavior as SysVinit scripts, the service starts but it is not possible to get the status or stop the service. Here is the copy of the terminal:

                    demo@antix1:~
                    $ sudo systemctl start mongod
                    demo@antix1:~
                    $ pidof mongod
                    52290
                    demo@antix1:~
                    $ sudo systemctl status mongod
                    mongod.service - MongoDB Database Server
                        Loaded: loaded (/usr/lib/systemd/system/mongod.service, disabled)
                        Active: inactive (dead)
                    demo@antix1:~
                    $ pidof mongod
                    52290
                    demo@antix1:~
                    $ sudo systemctl stop mongod
                    demo@antix1:~
                    $ pidof mongod
                    52290

                    As for mysql, systemctl3.py can’t even start the service:

                    $ sudo systemctl start mysql
                    ERROR:systemctl: Exec is not an absolute path: ExecStartPre=+/usr/share/mysql-8.0/mysql-systemd-start pre
                    ERROR:systemctl: Exec command does not exist: (ExecStartPre) +/usr/share/mysql-8.0/mysql-systemd-start
                    ERROR:systemctl: !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!
                    ERROR:systemctl: Found 2 problems in /usr/lib/systemd/system/mysql.service
                    ERROR:systemctl: The SystemD commands must always be absolute paths by definition.
                    ERROR:systemctl: Earlier versions of systemctl.py did use the subshell thus using $PATH
                    ERROR:systemctl: however newer versions use execve just like the real SystemD daemon
                    ERROR:systemctl: so that your docker-only service scripts may start to fail suddenly.
                    ERROR:systemctl: Now 1 executable paths were not found in the current environment.
                    ERROR:systemctl: !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!
                    ERROR:systemctl:the ExecStartPre control process exited with error code
                  Viewing 8 posts - 1 through 8 (of 8 total)
                  • You must be logged in to reply to this topic.