ブート時に開始することを意図した Python でロギング アプリケーションを作成しましたが、Ubuntu の Upstart init daemonでアプリを開始できませんでした。sudo /usr/local/greeenlog/main.pywを使用して端末から実行すると、アプリケーションは完全に機能します。アップスタートの仕事のために私が試したことは次のとおりです。
/etc/init/greenlog.conf
# greeenlog
description "I log stuff."
start on startup
stop on shutdown
script
exec /usr/local/greeenlog/main.pyw
end script
私のアプリケーションは、重要な場合に備えて、1 つの子スレッドを開始します。結果に変更を加えることなく、 expect fork stanzaでジョブを試しました。また、 sudoを使用し、スクリプト ステートメントを使用せずにこれを試しました (唯一の exec ステートメントのみ)。いずれの場合も、ブート後、running status greeenlogはgreeenlog stop/waitingを返し、running start greeenlogは次を返します。
start: Rejected send message, 1 matched rules; type="method_call", sender=":1.61" (uid=1000 pid=2496 comm="start) interface="com.ubuntu.Upstart0_6.Job" member="Start" error name="(unset)" requested_reply=0 destination="com.ubuntu.Upstart" (uid=0 pid=1 comm="/sbin/init"))
誰かが私が間違っていることを見ることができますか? 私はあなたが与えることができる任意の助けに感謝します. ありがとう。