monit installation failed with Ubuntu20.04 (64 bit)

Issue #1072 closed
v.rajesh created an issue

Hello,

I am using “Ubuntu 20.04.6 LTS”, and I tried to install ‘monit’ on my pc. And I am getting the below errors while installing, please help me to solve this issue.

rajesh@rajesh-workstation:~$ sudo apt-get install monit
Reading package lists... Done
Building dependency tree
Reading state information... Done
Suggested packages:
default-mta | postfix | mail-transport-agent sysvinit-core
The following NEW packages will be installed
monit
0 to upgrade, 1 to newly install, 0 to remove and 54 not to upgrade.
Need to get 0 B/320 kB of archives.
After this operation, 964 kB of additional disk space will be used.
Selecting previously unselected package monit.
(Reading database ... 444865 files and directories currently installed.)
Preparing to unpack .../monit_1%3a5.26.0-4_amd64.deb ...
Unpacking monit (1:5.26.0-4) ...
Setting up monit (1:5.26.0-4) ...
Job for monit.service failed because the control process exited with error code.
See "systemctl status monit.service" and "journalctl -xe" for details.
invoke-rc.d: initscript monit, action "restart" failed.
● monit.service - LSB: service and resource monitoring daemon
Loaded: loaded (/etc/init.d/monit; generated)
Active: failed (Result: exit-code) since Mon 2023-05-08 14:14:45 CEST; 5ms ago
Docs: man:systemd-sysv-generator(8)
Process: 6519 ExecStart=/etc/init.d/monit start (code=exited, status=1/FAILURE)

Mai 08 14:14:45 rajesh-workstation systemd[1]: Starting LSB: service and resource monitoring daemon...
Mai 08 14:14:45 rajesh-workstation monit[6519]: * Starting daemon monitor monit
Mai 08 14:14:45 rajesh-workstation monit[6523]: AssertException: The control file '/etc/monit/monitrc' is not a file
Mai 08 14:14:45 rajesh-workstation monit[6523]: raised in handle_options at src/monit.c:654
Mai 08 14:14:45 rajesh-workstation monit[6519]: ...fail!
Mai 08 14:14:45 rajesh-workstation systemd[1]: monit.service: Control process exited, code=exited, status=1/FAILURE
Mai 08 14:14:45 rajesh-workstation systemd[1]: monit.service: Failed with result 'exit-code'.
Mai 08 14:14:45 rajesh-workstation systemd[1]: Failed to start LSB: service and resource monitoring daemon.
dpkg: error processing package monit (--configure):
installed monit package post-installation script subprocess returned error exit status 1
Processing triggers for man-db (2.9.1-1) ...
Processing triggers for systemd (245.4-4ubuntu3.20) ...
Errors were encountered while processing:
monit
E: Sub-process /usr/bin/dpkg returned an error code (1)

Thanks,

Rajesh

Comments (4)

  1. Tildeslash repo owner

    Ubuntu monit package is 3rd party - we're sorry we're not Ubuntu package maintainers, please contact Ubuntu.

    According to the error, it is missing the configuration file during the installation.

  2. Henning Bopp

    Cannot confirm. I've just started a Ubuntu 20.04 VM. Everything's working as expecting with default sources:

    root@monit-1072:~# apt install monit
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    Suggested packages:
      default-mta | postfix | mail-transport-agent sysvinit-core
    The following NEW packages will be installed:
      monit
    0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
    Need to get 320 kB of archives.
    After this operation, 964 kB of additional disk space will be used.
    Get:1 https://mirror.hetzner.com/ubuntu/packages focal/universe amd64 monit amd64 1:5.26.0-4 [320 kB]
    Fetched 320 kB in 0s (5,034 kB/s)
    Selecting previously unselected package monit.
    (Reading database ... 37598 files and directories currently installed.)
    Preparing to unpack .../monit_1%3a5.26.0-4_amd64.deb ...
    Unpacking monit (1:5.26.0-4) ...
    Setting up monit (1:5.26.0-4) ...
    Processing triggers for man-db (2.9.1-1) ...
    Processing triggers for systemd (245.4-4ubuntu3.21) ...
    
    
    root@monit-1072:~# ll /etc/monit/
    total 40
    drwxr-xr-x  6 root root  4096 May  9 08:41 ./
    drwxr-xr-x 97 root root  4096 May  9 08:41 ../
    drwxr-xr-x  2 root root  4096 May  9 08:41 conf-available/
    drwxr-xr-x  2 root root  4096 Feb  5  2020 conf.d/
    drwxr-xr-x  2 root root  4096 Feb  5  2020 conf-enabled/
    -rw-------  1 root root 13111 Feb  5  2020 monitrc
    drwxr-xr-x  2 root root  4096 May  9 08:41 templates/
    
    
    
    root@monit-1072:~# systemctl status monit
    ● monit.service - LSB: service and resource monitoring daemon
         Loaded: loaded (/etc/init.d/monit; generated)
         Active: active (running) since Tue 2023-05-09 08:41:24 UTC; 1min 26s ago
           Docs: man:systemd-sysv-generator(8)
          Tasks: 1 (limit: 2275)
         Memory: 1.4M
         CGroup: /system.slice/monit.service
                 └─8450 /usr/bin/monit -c /etc/monit/monitrc
    
    May 09 08:41:24 monit-1072 systemd[1]: Starting LSB: service and resource monitoring daemon...
    May 09 08:41:24 monit-1072 monit[8431]:  * Starting daemon monitor monit
    May 09 08:41:24 monit-1072 monit[8431]:    ...done.
    May 09 08:41:24 monit-1072 systemd[1]: Started LSB: service and resource monitoring daemon.
    

    In your log, it states Need to get 0 B/320 kB of archives. -- so the download was already done, or there has already been a unsuccessful install or something...

  3. v.rajesh reporter

    Hello,

    I have totally removed all the files related to monit manually, and installed monit again. Then the installation was successfull but when I run “monit start all” command I am getting this error: “Cannot find the Monit control file at ~/.monitrc, /etc/monitrc, /etc/monit/monitrc, /usr/local/etc/monitrc or at ./monitrc”

    And I noticed the monitrc file is missing from the related folder. Somebody help me to solve this problem as it became little bit headache for me.

    Regards,

    Rajesh

  4. Log in to comment