简体   繁体   English

新贵:工作未能开始

[英]Upstart: Job failed to start

EDIT 编辑

status marybaked yields status marybaked收益率

marybaked stop/waiting marybaked停止/等待

Here is the output of /var/log/syslog : 这是/var/log/syslog的输出:

May 3 16:24:39 marybakedpdx kernel: [ 3464.189563] init: Failed to spawn marybakedpdx main process: unable to find setuid user 5月3日16:24:39 marybakedpdx内核:[3464.189563] init:无法生成marybakedpdx主进程:无法找到setuid用户

May 3 16:24:44 marybakedpdx kernel: [ 3469.342062] init: Failed to spawn marybaked main process: unable to find setuid user 5月3日16:24:44 marybakedpdx内核:[3469.342062] init:无法生成marybaked主进程:无法找到setuid用户


When I run start marybaked I get: 当我start marybaked我得到:

start: Job failed to start 开始:作业无法启动

When I run start <anything else> I get: 当我start <anything else>我得到:

start: Unknown job: 开始:未知工作:

There is no marybaked.log log in my /var/logs/upstart directory...What's going on here? 我的/var/logs/upstart目录中没有marybaked.log日志......这里发生了什么? How can upstart recognize that marybaked is a job and fails to start it, but doesnt create an error log for it? upstart怎么能认识到marybaked是一个工作并且无法启动它,但是没有为它创建错误日志?

Here is my /etc/init/marybaked.conf file: 这是我的/etc/init/marybaked.conf文件:

# upstart service file at /etc/init/marybakedpdx.conf
    description "Meteor.js (NodeJS) application"
    author "Daniel Speichert <daniel@speichert.pro>"

    # When to start the service
    start on started mongodb and runlevel [2345]

    # When to stop the service
    stop on shutdown

    # Automatically restart process if crashed
    respawn
    respawn limit 10 5

    # we don't use buil-in log because we use a script below
    # console log

    # drop root proviliges and switch to mymetorapp user
    setuid marybakedpdx
    setgid marybakedpdx

    script
        export PATH=/opt/local/bin:/opt/local/sbin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
        export NODE_PATH=/usr/lib/nodejs:/usr/lib/node_modules:/usr/share/javascript
        # set to home directory of the user Meteor will be running as
        export PWD=/home/marybakedpdx
        export HOME=/home/marybakedpdx
        # leave as 127.0.0.1 for security
        export BIND_IP=127.0.0.1
        # the port nginx is proxying requests to
        export PORT=8080
        # this allows Meteor to figure out correct IP address of visitors
        export HTTP_FORWARDED_COUNT=1
        # MongoDB connection string using marybakedpdx as database name
        export MONGO_URL=mongodb://localhost:27017/marybakedpdx
        # The domain name as configured previously as server_name in nginx
        export ROOT_URL=http://marybakedpdx.com
        # optional JSON config - the contents of file specified by passing "--settings" parameter to meteor command in development mode
        export METEOR_SETTINGS='{ "somesetting": "someval", "public": { "othersetting": "anothervalue" } }'
        # this is optional: http://docs.meteor.com/#email
        # commented out will default to no email being sent
        # you must register with MailGun to have a username and password there
        # export MAIL_URL=smtp://postmaster@mymetorapp.net:password123@smtp.mailgun.org
        # alternatively install "apt-get install default-mta" and uncomment:
        # export MAIL_URL=smtp://localhost
        exec node /home/marybakedpdx/bundle/main.js >> /home/marybakedpdx/marybakedpdx.log
    end script

Your upstart file looks ok, what's most likely happening is something within your script block is failing. 您的upstart文件看起来没问题,最可能发生的是script块中的某些内容失败。 It should be detailed in the syslog . 它应该在syslog详细说明。

Try looking into /var/log/syslog 尝试查看/var/log/syslog

For further debugging, you should also try to touch files at various points, to further narrow down the issue. 为了进一步调试,您还应尝试在各个点touch文件,以进一步缩小问题范围。 For example: 例如:

touch /tmp/marybake0
exec node /home/marybakedpdx/bundle/main.js >> /home/marybakedpdx/marybakedpdx.log

touch will create the file if it doesn't exist. 如果文件不存在,touch将创建该文件。

EDIT: 编辑:

Judging from your updated post, the user marybakedpdx doesn't exist. 从您更新的帖子判断,用户marybakedpdx不存在。 Try running the following: 尝试运行以下内容:

adduser marybakedpdx
addgroup marybakedpdx

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM