【问题标题】:Apache listed in runlevels, not starting at boot (OpenSuse 12.3)Apache 在运行级别中列出,而不是在启动时启动 (OpenSuse 12.3)
【发布时间】:2014-04-04 12:23:52
【问题描述】:

我希望我的已编译 apache2 服务器在我的 OpenSuse 12.3 服务器启动时运行。

我按照https://serverfault.com/questions/16839/how-do-i-get-apache-to-startup-at-bootime-on-linux中列出的程序,即:

  • 创建文件 /etc/init.d/apache2

  • 将其添加到服务中

    chkconfig --add apache2

我可以看到它在 YaST 的运行级别管理器中列出(不确定确切的名称,因为我的发行版是西班牙语)

apache2 Yes*

我认为这意味着该服务配置为在启动时启动,但在我检查时并未运行。

我的/etc/init.d/apache2的内容是:

#!/bin/bash
#
### BEGIN INIT INFO
# Provides:       apache2
# Default-Start:  3 5
# Description:    Controlar el servidor apache2
### END INIT INFO
/home/servidor/apache/bin/apachectl $@

我尝试更改文件的权限,通过 systemd 启用服务,几乎所有我在网上找到的东西都无济于事:

systemctl start apache2.service
systemctl enable apache2.service
chkconfig apache2 on

任何帮助将不胜感激。

【问题讨论】:

    标签: apache boot opensuse runlevel


    【解决方案1】:

    您是否尝试在您的 init.d 文件中添加 chkconfig 支持行?

    # chkconfig: - 85 15
    # description: Apache is a World Wide Web server.  It is used to serve \
    #              HTML files and CGI.
    # processname: httpd
    # config: /etc/httpd/conf/httpd.conf
    # config: /etc/sysconfig/httpd
    # pidfile: /var/run/httpd.pid
    

    当然,相应地更改路径和值。有关更多详细信息,您可以查看https://code.google.com/p/xinc/issues/detail?id=145。它不是 openSuse 论坛,但 chkconfig 也适用于 openSuse 12.3。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多