Solve the problem start monitmonit.service is not a native service, redirecting to systemd-sysv-install

🚀 Monit failed to start? Teach you how to solve systemd-s in 1 minutesyv-install problem!

💻 Monit failed to start? Prompt "start monitmonit.service is not a native service, redirecting to systemd-sysv-install"? This article will teach you how to quickly fix it. Linux The server is back to normal operation! ⚡ For Ubuntu,CentOS, Debian and other systems, get it done in 3 simple steps! Don't worry about Monit anymore, come and learn it! 🔧

root@hcp:~# sudo systemctl enable monit
sudo systemctl start monitmonit.service is not a native service, redirecting to systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable monit

Your error message:

monit.service is not a native service, redirecting to systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable monit

meaning is : monit Not a native systemd service, but based on SysVinit(Old-style init system).

On systemctl enable monit When systemd finds monit Don't Have The actual systemd service file, so it automatically calls systemd-sysv-install To be compatible with the old service management method.

How to solve?

Solve the problem start monitmonit.service is not a native service, redirecting to systemd-sysv-install

You have 3 ways to fix this problem:

Method 1: Manually create a systemd service

if you wish monit It can be managed like a normal systemd service, you canManually create systemd unit file.

  1. Create a systemd service file :

    sudo nano /etc/systemd/system/monit.service
    
  2. Fill in the following content :

    [Unit]
    Description=Pro-active monitoring daemon for Unix systems
    After=network.target
    
    [Service]
    ExecStart=/usr/bin/monit -I
    ExecReload=/usr/bin/monit reload
    Restart=always
    StandardOutput=syslog
    StandardError=syslog
    SyslogIdentifier=monit
    
    [Install]
    WantedBy=multi-user.target
    

    Explanation :

    • ExecStart=/usr/bin/monit -I Let Monit use init mode.
    • Restart=always Make Monit automatically restart after a crash.
    • WantedBy=multi-user.target Let it start with the system.
  3. save and exit(according to Ctrl + X,then Y Enter).

  4. Reload systemd configuration :

    sudo systemctl daemon-reload
    
  5. Enable and start Monit :

    sudo systemctl enable monit
    sudo systemctl start monit
    
  6. Check Monit running status :

    sudo systemctl status monit
    

Method 2: Enable Monit using the old fashioned command

because monit It is probably based on SysVinit, not systemd, so you can use the traditional update-rc.d Order:

sudo update-rc.d monit defaults
sudo update-rc.d monit enable

Then start it manually:

sudo service monit start

Check Status :

sudo service monit status

If this succeeds, it means monit It relies on an older init system, not systemd.

Method 3: Directly use monit Command manual start

If you just want to run Monit temporarily without starting it automatically at boot, you can run it directly:

sudo monit

Then check:

sudo monit status

If you don't need systemd to control it, this will work just fine!

Final Thoughts

  • method 1(update-rc.d): Applicable to Monit based on SysVinit.
  • method 2(Manually create a systemd service): This is suitable for situations where you want to use systemd to manage Monit.
  • method 3(Run directly monit): Suitable for those who do not want to change the systemd configuration and just want Monit to run.

You can try first method 1If that doesn't work, use method 2 Create a systemd configuration. This will solve the problem perfectly! 🚀

Comment

Your email address will not be published. Required fields * Callout

Scroll to Top