Services fail to start at boot
FedoraForum.org - Fedora Support Forums and Community
Results 1 to 5 of 5
  1. #1
    Join Date
    Oct 2011
    Posts
    208
    Linux (Fedora) Chrome 68.0.3440.42

    Services fail to start at boot

    Hi,

    I have a fedora28 system with apache installed. I've used systemctl to enable it at boot, but it refuses to start. I've also disabled firewalld from starting at boot, and it continues to start. Typically when I enable a service, systemctl will present a message like "Created symlink..." but when I do that with apache, it does not:

    # systemctl enable httpd.service
    # ls -l system/multi-user.target.wants/httpd.service
    lrwxrwxrwx. 1 root root 37 Sep 29 18:24 system/multi-user.target.wants/httpd.service -> /usr/lib/systemd/system/httpd.service

    When I try to disable firewalld (I'm using iptables for a server instead), it doesn't disable it.

    # systemctl disable firewalld.service

    When I try and enable iptables, it also does the same.

    # systemctl enable iptables.service
    # find . -iname \*iptables\* -ls
    149046 0 lrwxrwxrwx 1 root root 40 Sep 30 15:41 ./system/basic.target.wants/iptables.service -> /usr/lib/systemd/system/iptables.service

    What am I missing?

  2. #2
    Join Date
    Jun 2004
    Location
    Maryland, US
    Posts
    7,369
    Linux (Fedora) Firefox 62.0

    Re: Services fail to start at boot

    what does "systemctl status httpd.service" report?

    BTW, you seem to imply rebooting, so that should do what you asked for as an "enable" but try this:
    Code:
    systemctl --now enable  firewalld.service
    systemctl --now enable  httpd.service
    then immediately run the status command for both:
    Code:
    systemctl status  firewalld.service
    systemctl status  httpd.service
    '--now' + 'enable' should enable the service and start it right up without rebooting or having to run "start".

    post here if those state something is wrong
    Last edited by marko; 13th October 2018 at 11:12 PM.

  3. #3
    Join Date
    Oct 2011
    Posts
    208
    Linux (Fedora) Chrome 68.0.3440.42

    Re: Services fail to start at boot

    Quote Originally Posted by marko
    what does "systemctl status httpd.service" report?

    BTW, you seem to imply rebooting, so that should do what you asked for as an "enable" but try this:
    Code:
    systemctl --now enable  firewalld.service
    systemctl --now enable  httpd.service
    then immediately run the status command for both:
    Code:
    systemctl status  firewalld.service
    systemctl status  httpd.service
    '--now' + 'enable' should enable the service and start it right up without rebooting or having to run "start".

    post here if those state something is wrong
    Thanks so much for your help. The problem is that these services aren't enabled on boot. I can start them 'now' using your command or just 'service httpd start', but I'm interested in knowing what's keeping them from starting on boot, then I won't have to start them "now".

    Code:
    # systemctl status httpd.service
    ● httpd.service - The Apache HTTP Server
       Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled)
      Drop-In: /usr/lib/systemd/system/httpd.service.d
               └─php-fpm.conf
       Active: active (running) since Sun 2018-10-14 11:12:13 EDT; 10s ago
         Docs: man:httpd.service(8)
      Process: 13114 ExecReload=/usr/sbin/httpd $OPTIONS -k graceful (code=exited, status=0/SUCCESS)
     Main PID: 13783 (httpd)
       Status: "Running, listening on: port 443, port 80"
        Tasks: 213 (limit: 4915)
       Memory: 18.9M
       CGroup: /system.slice/httpd.service
               ├─13783 /usr/sbin/httpd -DFOREGROUND
               ├─13785 /usr/sbin/httpd -DFOREGROUND
               ├─13786 /usr/sbin/httpd -DFOREGROUND
               ├─13787 /usr/sbin/httpd -DFOREGROUND
               └─13788 /usr/sbin/httpd -DFOREGROUND
    
    Oct 14 11:12:13 mail02.example.com systemd[1]: Starting The Apache HTTP Server...
    Oct 14 11:12:13 mail02.example.com httpd[13783]: Server configured, listening on: port 443, port 80
    Oct 14 11:12:13 mail02.example.com systemd[1]: Started The Apache HTTP Server.
    Here's php-fpm which it appears to depend upon:

    Code:
    # systemctl status php-fpm.service
    ● php-fpm.service - The PHP FastCGI Process Manager
       Loaded: loaded (/usr/lib/systemd/system/php-fpm.service; disabled; vendor preset: disabled)
       Active: active (running) since Sat 2018-09-29 14:24:07 EDT; 2 weeks 0 days ago
     Main PID: 20497 (php-fpm)
       Status: "Processes active: 0, idle: 7, Requests: 21608, slow: 0, Traffic: 0req/sec"
        Tasks: 8 (limit: 4915)
       Memory: 39.0M
       CGroup: /system.slice/php-fpm.service
               ├─ 1811 php-fpm: pool www
               ├─11845 php-fpm: pool www
               ├─20497 php-fpm: master process (/etc/php-fpm.conf)
               ├─20499 php-fpm: pool www
               ├─20500 php-fpm: pool www
               ├─20501 php-fpm: pool www
               ├─20502 php-fpm: pool www
               └─20503 php-fpm: pool www
    
    Warning: Journal has been rotated since unit was started. Log output is incomplete or unavailable.
    Any ideas greatly appreciated.

  4. #4
    Join Date
    Jun 2004
    Location
    Maryland, US
    Posts
    7,369
    Linux (Fedora) Firefox 62.0

    Re: Services fail to start at boot

    Quote Originally Posted by gossamer
    Thanks so much for your help. The problem is that these services aren't enabled on boot. I can start them 'now' using your command or just 'service httpd start', but I'm interested in knowing what's keeping them from starting on boot, then I won't have to start them "now".

    Code:
    # systemctl status httpd.service
    ● httpd.service - The Apache HTTP Server
       Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled)
      Drop-In: /usr/lib/systemd/system/httpd.service.d
               └─php-fpm.conf
       Active: active (running) since Sun 2018-10-14 11:12:13 EDT; 10s ago
         Docs: man:httpd.service(8)
      Process: 13114 ExecReload=/usr/sbin/httpd $OPTIONS -k graceful (code=exited, status=0/SUCCESS)
     Main PID: 13783 (httpd)
       Status: "Running, listening on: port 443, port 80"
        Tasks: 213 (limit: 4915)
       Memory: 18.9M
       CGroup: /system.slice/httpd.service
               ├─13783 /usr/sbin/httpd -DFOREGROUND
               ├─13785 /usr/sbin/httpd -DFOREGROUND
               ├─13786 /usr/sbin/httpd -DFOREGROUND
               ├─13787 /usr/sbin/httpd -DFOREGROUND
               └─13788 /usr/sbin/httpd -DFOREGROUND
    
    Oct 14 11:12:13 mail02.example.com systemd[1]: Starting The Apache HTTP Server...
    Oct 14 11:12:13 mail02.example.com httpd[13783]: Server configured, listening on: port 443, port 80
    Oct 14 11:12:13 mail02.example.com systemd[1]: Started The Apache HTTP Server.
    Here's php-fpm which it appears to depend upon:

    Code:
    # systemctl status php-fpm.service
    ● php-fpm.service - The PHP FastCGI Process Manager
       Loaded: loaded (/usr/lib/systemd/system/php-fpm.service; disabled; vendor preset: disabled)
       Active: active (running) since Sat 2018-09-29 14:24:07 EDT; 2 weeks 0 days ago
     Main PID: 20497 (php-fpm)
       Status: "Processes active: 0, idle: 7, Requests: 21608, slow: 0, Traffic: 0req/sec"
        Tasks: 8 (limit: 4915)
       Memory: 39.0M
       CGroup: /system.slice/php-fpm.service
               ├─ 1811 php-fpm: pool www
               ├─11845 php-fpm: pool www
               ├─20497 php-fpm: master process (/etc/php-fpm.conf)
               ├─20499 php-fpm: pool www
               ├─20500 php-fpm: pool www
               ├─20501 php-fpm: pool www
               ├─20502 php-fpm: pool www
               └─20503 php-fpm: pool www
    
    Warning: Journal has been rotated since unit was started. Log output is incomplete or unavailable.
    Any ideas greatly appreciated.
    The "--now" flag is just a one time thing, I didn't mean it would solve some kind of "does not start at boot" problem, it's just a simpler way to enable and start with one line of command.
    What I was really trying to get was the status output and that seems to show that the httpd started up okay and the bold enabled here:
    Code:
       Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled)
    shows it should also start at boot. Maybe the 'php-fpm' is the problem because it's disabled(it is running but it was already running from 2 weeks back). Try:
    Code:
    systemctl --now enable php-fpm.service
    and reboot and see if that corrects it

  5. #5
    Join Date
    Oct 2011
    Posts
    208
    Linux (Fedora) Chrome 68.0.3440.42

    Re: Services fail to start at boot

    Quote Originally Posted by marko
    The "--now" flag is just a one time thing, I didn't mean it would solve some kind of "does not start at boot" problem, it's just a simpler way to enable and start with one line of command.
    What I was really trying to get was the status output and that seems to show that the httpd started up okay and the bold enabled here:
    Code:
       Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled)
    shows it should also start at boot. Maybe the 'php-fpm' is the problem because it's disabled(it is running but it was already running from 2 weeks back). Try:
    Code:
    systemctl --now enable php-fpm.service
    and reboot and see if that corrects it
    It looks like it is a dependency and wasn't enabled at boot. I ran "systemctl enable php-fpm.service" and it responded that it created the systemd symlink.

    How can I check to make sure there aren't other services that aren't starting because of dependencies?

    There are quite a few services, including dovecot and others that didn't start, and I suspect it's because of dependencies. I know I can use list-unit-files to identify those services which are enabled or disabled, but do you know of a way to identify the dependencies each of them have?

Similar Threads

  1. Services fail to start continuously
    By synops in forum Using Fedora
    Replies: 20
    Last Post: 20th June 2012, 02:58 AM
  2. Services fail to start
    By fedorahack in forum Installation, Upgrades and Live Media
    Replies: 2
    Last Post: 7th June 2012, 05:01 PM
  3. Fedora 16 Fail to start services
    By jan1024188 in forum Using Fedora
    Replies: 5
    Last Post: 20th February 2012, 04:02 PM
  4. chkconfig messes priorities - half of the services fail to start
    By duni in forum Alpha - Beta (Fedora 9 Only)
    Replies: 1
    Last Post: 18th May 2008, 06:41 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •