init.d scripts does not start if not called with systemctl

Solution Verified - Updated -

Issue

  • When starting an initscript directly (without systemctl), the service does not start:

    $ /etc/init.d/foo start
    Starting foo (via systemctl):  Job for foo.service failed because a timeout was exceeded.
    See "systemctl status foo.service" and "journalctl -xe" for details.
                                                               [FAILED]
    
  • It starts only if called with systemctl:

    # systemctl start foo                                                                                                                                                                                                                                                                                       
    # systemctl status foo                                                                                                                                                                                                                                                                                     
    ● foo.service - LSB: Dummy Daemon                                                                                                                                                                                                                                                                                             
       Loaded: loaded (/etc/rc.d/init.d/foo; generated)                                                                                                                                                                                                                                                                           
       Active: active (running) since Fri 2020-12-11 03:54:02 EST; 13s ago                                                                                                                                                                                                                                                        
         Docs: man:systemd-sysv-generator(8)                                                                                                                                                                                                                                                                                      
        Tasks: 2 (limit: 11195)                                                                                                                                                                                                                                                                                                   
       Memory: 1.5M                                                                                                                                                                                                                                                                                                               
       CGroup: /system.slice/foo.service                                                                                                                                                                                                                                                                                          
               ├─6035 sleep 1000                                                                                                                                                                                                                                                                                                  
               └─6186 /usr/local/bin/foo                                                                                                                                                                                                                                                                                          
    
    Dec 11 03:54:02 rhel8 systemd[1]: Started LSB: Dummy Daemon.
    

Environment

  • Red Hat Enterprise Linux 8
  • systemd, SysV, procps-ng, initscripts

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content