시작시 왜 launchctl.plst가 실행되지 않습니까?


3

시작시 Mongo를 실행하기 위해이 plist를 만들었지 만 실행되지 않습니다. 시작할 때마다 이것을 실행해야합니다.

launchctl load /Library/LaunchDaemons/org.mongo.mongod.plist

그런 다음 잘 작동합니다.

여기는 /Library/LaunchDaemons/org.mongo.mongod.plist입니다

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>Label</key>
    <string>org.mongo.mongod</string>
    <key>ProgramArguments</key>
    <array>
        <string>/usr/local/mongo/bin/mongod</string>
        <string>--config=/usr/local/etc/mongod.conf</string>
    </array>
    <key>RunAtLoad</key>
    <true/>
    <key>KeepAlive</key>
    <true/>
</dict>
</plist>

감사

편집 : 여기 system.log의 내용이 있습니다

$ cat /var/log/system.log | grep launch
May  8 06:43:57 localhost com.apple.launchd[1]: *** launchd[1] has started up. ***
May  8 06:43:57 localhost com.apple.launchd[1]: *** Shutdown logging is enabled. ***
May  8 06:44:06 localhost com.apple.launchd[1] (nginx): Unknown key for boolean: NetworkState
May  8 06:44:15 localhost distnoted[67]: assertion failed: 13C1021: liblaunch.dylib + 25164 [38D1AB2C-A476-385F-8EA8-7AB604CA1F89]: 0x25
May  8 06:44:23 Jonahs-iMac.local aosnotifyd[64]: aosnotifyd has been launched
May  8 06:44:39 jonahs-imac com.apple.launchd[1] (0x7fc812f1c4c0.anonymous.nohup[212]): assertion failed: 13C1021: launchd + 73282 [425516B6-9F3E-342F-87B3-EC461EBA6A1A]: 0x0
May  8 06:44:39 jonahs-imac com.apple.launchd[1] (0x7fc812f1c4c0.anonymous.nohup[212]): Switching sessions is not allowed in the system Mach bootstrap.
May  8 06:44:39 jonahs-imac com.apple.launchd[1] (0x7fc812f1c4c0.anonymous.nohup[212]): _vprocmgr_switch_to_session(): kr = 0x44c
May  8 06:44:39 jonahs-imac com.apple.launchd[1] (0x7fc812e50b90.anonymous.nohup[213]): assertion failed: 13C1021: launchd + 73282 [425516B6-9F3E-342F-87B3-EC461EBA6A1A]: 0x0
May  8 06:44:39 jonahs-imac com.apple.launchd[1] (0x7fc812e50b90.anonymous.nohup[213]): Switching sessions is not allowed in the system Mach bootstrap.
May  8 06:44:39 jonahs-imac com.apple.launchd[1] (0x7fc812e50b90.anonymous.nohup[213]): _vprocmgr_switch_to_session(): kr = 0x44c
May  8 06:44:40 jonahs-imac.home launchctl[245]: com.apple.findmymacmessenger: Already loaded
May  8 06:44:41 jonahs-imac com.apple.launchd[1]: System: Could not find requested session: Aqua
May  8 06:44:41 jonahs-imac com.apple.launchd.peruser.501[261]: Background: Aqua: Registering new GUI session.
May  8 06:44:41 jonahs-imac com.apple.launchd[1] (com.wacom.pentablet[252]): Exited with code: 255
May  8 06:44:41 jonahs-imac com.apple.launchd.peruser.501[261] (com.apple.EscrowSecurityAlert): Unknown key: seatbelt-profiles
May  8 06:44:41 jonahs-imac com.apple.launchd.peruser.501[261] (com.apple.ReportCrash): Falling back to default Mach exception handler. Could not find: com.apple.ReportCrash.Self
May  8 06:44:41 jonahs-imac.home launchctl[264]: com.apple.pluginkit.pkd: Already loaded
May  8 06:44:41 jonahs-imac.home launchctl[264]: com.apple.sbd: Already loaded
May  8 06:44:42 jonahs-imac com.apple.launchd[1] (com.wacom.ConsumerTouchDriver.158960[260]): Exited with code: 255
May  8 06:44:42 jonahs-imac com.apple.launchd.peruser.501[261] (com.google.GoogleContactSyncAgent[312]): Exited with code: 2
May  8 06:44:42 jonahs-imac com.apple.launchd.peruser.501[261] (com.apple.iTunesHelper.35584[317]): Spawned and waiting for the debugger to attach before continuing...
May  8 06:44:42 jonahs-imac com.apple.launchd.peruser.501[261] (com.runningwithcrayons.Alfred-2.28016[318]): Spawned and waiting for the debugger to attach before continuing...
May  8 06:44:42 jonahs-imac com.apple.launchd.peruser.501[261] (com.google.Chrome.12000[320]): Spawned and waiting for the debugger to attach before continuing...
May  8 06:44:42 jonahs-imac accountsd[323]: assertion failed: 13C1021: liblaunch.dylib + 25164 [38D1AB2C-A476-385F-8EA8-7AB604CA1F89]: 0x25
May  8 06:44:43 jonahs-imac com.apple.launchd.peruser.501[261] (com.apple.mrt.uiagent[297]): Exited with code: 255
May  8 06:44:44 jonahs-imac.home com.apple.IconServicesAgent[344]: IconServicesAgent launched.
May  8 06:44:46 jonahs-imac.home TabletDriver[308]: Finish launching /Library/Application Support/Tablet/PenTabletDriver.app/Contents/Resources/ConsumerTouchDriver.app
May  8 06:44:47 jonahs-imac.home TabletDriver[308]: Finish launching /Library/Application Support/Tablet/PenTabletDriver.app/Contents/Resources/TabletDriver.app
May  8 06:44:49 jonahs-imac.home Google Chrome Helper[363]: Process unable to create connection because the sandbox denied the right to lookup com.apple.coreservices.launchservicesd and so this process cannot talk to launchservicesd. : LSXPCClient.cp #426 ___ZN26LSClientToServerConnection21setupServerConnectionEiPK14__CFDictionary_block_invoke() q=com.apple.main-thread

에 관련 항목이 system.log있습니까?
nohillside

어디서 찾을 수 있습니까?
jwerre

이것은 어리석은 질문 일지 모르지만 해당 구성 파일의 경로는 맞습니까? mongod가있는 /usr/local/mongo/bin것이 조금 이상해 보이지만 구성 파일이 /usr/local/etc있습니까? plist 파일에서 분명히 잘못된 것을 볼 수 없기 때문에 묻습니다 .
mjturner 2014 년

를 참조 /var/log/system.log하거나 sudo grep launch /var/log/system.log터미널에서 직접 실행
nohillside

1
발행 launchctl load /Library/LaunchDaemons/org.mongo.mongod.plist하면 작업을 사용자 시작 인스턴스에로드하지만 부팅시 작업은 시스템 시작 인스턴스에로드됩니다. sudo launchctl load /Library/LaunchDaemons/org.mongo.mongod.plist이것이 실패하는 이유를 찾으려면 입력하십시오 .
LCC

답변:


1

인수 키를의 값과 구분하지 않기 때문에 문제가 발생했을 수 있습니다 ProgramArguments.

이런 식으로 쓰지 말고 :

<key>ProgramArguments</key>
<array>
    <string>/usr/local/mongo/bin/mongod</string>
    <string>--config=/usr/local/etc/mongod.conf</string>
</array>

당신은 작성해야 --config하고 /usr/local/etc/mongod.conf같은 각 개별 라인 :

<key>ProgramArguments</key>
<array>
    <string>/usr/local/mongo/bin/mongod</string>
    <string>--config</string>
    <string>/usr/local/etc/mongod.conf</string>
</array>

또한 .plist 파일을 수정할 때는 먼저 파일을 언로드 한 다음 다시로드하여 시작된 파일을 활성화해야합니다.


GNU getopt (3)에 따르면 그는 괜찮을 것입니다. 긴 옵션은 --arg=param또는 형식의 매개 변수를 취할 수 있습니다 --arg param.
LCC

나중에 시도했습니다. 성공하지 못했습니다.
jwerre

0

Adobe Application Manager를 실행하여이 문제를 해결했습니다.

당사 사이트를 사용함과 동시에 당사의 쿠키 정책개인정보 보호정책을 읽고 이해하였음을 인정하는 것으로 간주합니다.
Licensed under cc by-sa 3.0 with attribution required.