MacPorts的Apache2的停止启动上启动 [英] MacPorts Apache2 Stopped Launching on Boot

查看:148
本文介绍了MacPorts的Apache2的停止启动上启动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我最近注意到,在两个不同的机器上的东西是一种通过使用MacPorts安装的Apache2似乎​​已经停止,当我开机启动。诚实的事实是,我也不敢保证就那么以前做的,但它的东西,我想我会注意到,因为在安装LaunchDaemon是我的安装​​过程的一部分。事实上,如果我尝试重新加载LaunchDaemon,它失败:

  $ sudo的launchctl负载-w /Library/LaunchDaemons/org.macports.apache2.plist
org.macports.apache2:已加载

除非我手动(使用须藤apachectl中重启),grep'ing在我的进程列表不是的Apache2或的httpd只生产这个启动Apache:

  $ sudo的PS -ef | egrep的的Apache2 |的httpd
    0 52 0 0:00.06? 0:00.08 /选择/ local / bin目录/ daemondo --label = Apache2的--start-CMD /opt/local/etc/LaunchDaemons/org.macports.apache2/apache2.wrapper启动; --stop-CMD /opt/local/etc/LaunchDaemons/org.macports.apache2/apache2.wrapper停止; --restart-CMD /opt/local/etc/LaunchDaemons/org.macports.apache2/apache2.wrapper重启; --pid =无

1410639199 6960 6792 0 0:00.00 ttys001 0:00.00 egrep的的Apache2 |的httpd

看起来像守护程序本身很到位,但没有可执行文件。据我所知/所知道的,相关的可执行文件(httpd和apachectl中)是由大家的可执行文件。

有没有其他人注意到这一点?任何想法?

更新

如下要求,我没有执行 launchctl列表。该名单很长,我不知道如何剪断它,但我只想说,没有 org.macports。* 项目列示。这本身,因为我的MySQL守护进程加载同样的方式很有意思。它的工作原理,但还没有出现在列表中。让我知道是否是真正需要的整个输出。

更新

我认为我已经执行 launchctl列表下sudo的,而是由下面mipadi的评论提示,我试图再次保证的,我这样做了,并我认为不正确。当在sudo下执行时,MacPorts的项目如下:

  51  -  org.macports.mysql5
52 - org.macports.apache2

我不知道是否会有所帮助,但它是一个小的详细信息仍然。

更新

我问在<一个不同的,但相互关联的问题href=\"http://stackoverflow.com/questions/2195298/launchdaemons-and-environment-variables\">http://stackoverflow.com/questions/2195298/launchdaemons-and-environment-variables.因为我了解我会及时更新这两个问题。

更新

今天,基于邮件列表的投入,我尝试使用通配符主目录。在学术上,这是一个有点更具包容性的比我想,但实际的现实是,我使用此计算机只有一个;当然谁愿意有Apache的配置文件是唯一一个周围铺设。

 包含/用户/ * / Dropbox的/应用程序支持/阿帕奇/ conf.d.osx / *。CONF
包括/用户/ * /库/ Application Support / MacPorts的/阿帕奇/ conf.d / *。CONF

不幸的是...

 的httpd:关于/opt/local/apache2/conf/httpd.conf 512行语法错误:不允许通配符模式包含/用户/ * / Dropbox的/应用程序支持/阿帕奇/conf.d.osx/*.conf


解决方案

因为我现在知道的为什么的阿帕奇已经停止在启动时加载,我要阐明这个问题的答案,并标记这个问题的回答。阿帕奇已经停止发射开机的原因是,我想分享跨系统的的httpd.conf 文件。配置文件存在,从我的家目录内的目录需要包含文件。由于home目录是每台机器上的不同,我试图引用 $ {HOME} 环境变量。

这工作正常手动启动机器启动后的时候,却启动失败,因为环境变量尚未设置。如上所述,请参见这个问题了解详情。

Something that I've noticed recently on two different machines is that Apache2 installed via MacPorts seems to have stopped launching when I boot up. The honest truth is that I can't swear it did so before, but it's something I think I'd notice because installing the LaunchDaemon is part of my install process. In fact, if I try to reload the LaunchDaemon, it fails:

$ sudo launchctl load -w /Library/LaunchDaemons/org.macports.apache2.plist
org.macports.apache2: Already loaded

Unless I start Apache manually (using sudo apachectl restart), grep'ing for either "apache2" or "httpd" in my process list only produces this:

$ sudo ps -ef | egrep "apache2|httpd"
    0    52     1   0   0:00.06 ??         0:00.08 /opt/local/bin/daemondo --label=apache2 --start-cmd /opt/local/etc/LaunchDaemons/org.macports.apache2/apache2.wrapper start ; --stop-cmd /opt/local/etc/LaunchDaemons/org.macports.apache2/apache2.wrapper stop ; --restart-cmd /opt/local/etc/LaunchDaemons/org.macports.apache2/apache2.wrapper restart ; --pid=none

1410639199 6960 6792 0 0:00.00 ttys001 0:00.00 egrep apache2|httpd

Looks like the daemon itself is in place, but no executable. As far as I know/can tell, the relevant executables (httpd and apachectl) are executable by everyone.

Has anyone else noticed this? Any ideas?

UPDATE

As requested below, I did execute launchctl list. The list is long and I'm not sure how to snip it, but suffice to say that no org.macports.* items are listed. That in itself is interesting because my MySQL daemon is loaded the same way. It works, but also doesn't appear in the list. Let me know if the entire output is really needed.

UPDATE

I assumed that I had executed launchctl list under sudo, but prompted by mipadi's comment below, I tried again ensuring that I did so and I assumed incorrectly. When executed under sudo, the MacPorts items appear:

51  -   org.macports.mysql5
52  -   org.macports.apache2

I'm not sure whether that will help, but it's a little more info nonetheless.

UPDATE

I've asked a different, but related, question at http://stackoverflow.com/questions/2195298/launchdaemons-and-environment-variables. I'll update both questions as I learn more.

UPDATE

Today, based on mailing list input, I tried using a wildcard home directory. Academically, it's a little more inclusive than I'd like, but the practical reality is that I'm the only one using this computer; certainly the only one who'd have Apache config files laying around.

Include "/Users/*/Dropbox/Application Support/apache/conf.d.osx/*.conf"
Include "/Users/*/Library/Application Support/MacPorts/apache/conf.d/*.conf"

Unfortunately...

httpd: Syntax error on line 512 of /opt/local/apache2/conf/httpd.conf: Wildcard patterns not allowed in Include /Users/*/Dropbox/Application Support/apache/conf.d.osx/*.conf

解决方案

Since I now know why Apache has stopped loading on startup, I'm going to articulate that answer and mark this question as answered. The reason Apache has stopped launching on boot is that I'm trying to share an httpd.conf file across systems. The config file needs to Include files from directories that exist within my home directory. Since the home directory is different on each machine, I was trying to reference the ${HOME} environment variable.

This works fine when manually starting after the machine is booted, but fails on startup because the environment variable isn't yet set. As mentioned above, see this question for more information.

这篇关于MacPorts的Apache2的停止启动上启动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆