問題タブ [upstart]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
php - PHPスクリプトでのジョブの再起動(upstart)
現在、最新のプロジェクトの管理ポータルを作成しています。私は自分のコンピューターで新興企業を機能させるために戦ってきましたが、今ではウェブから新興企業を操作できるようにしたいと考えていました。PHPスクリプトで次を実行する必要があります
ご覧のとおり、sudo はこれらのコマンドのテーマであるため、この php スクリプトから何らかの方法で sudo を実行する必要があります。どうすればこの問題に対処できますか、または回避策はありますか。
それが重要な場合:
ruby - Chef レシピ: Upstart デーモンが Ruby で起動しない
プロビジョニング システム (CHEF) の最後のステップとして、Ruby Mongrel スクリプトを実行したいと考えています。したがって、次のエントリを含む upstart .conf ファイルを作成しました。
ただし、log.txt ファイルは空で、netstat -an | を実行しています。grep 3000 は何も表示しません。スクリプトは実行可能ではないと思っていましたが、chmod を実行しても何も変わりませんでした。
ただし、スクリプトを手動で実行すると、サーバーを起動できます
スクリプトの内容は次のとおりです。
RVM と Ruby 1.8.7、Rubygems 1.3.7 で Vagrant を実行しています。ブートストラップのレシピは次のとおりです。
何か案が?ありがとう
python - upstartジョブでPythonからstdoutをキャプチャする
upstartジョブとして実行すると、python2.6スクリプトのstdout出力をファイルに保存するのに苦労しています。
これは私の現在のテストスクリプトです:
私がそうすればそれはうまくいきます$ myscript >> /var/log/myscript
。両方見えます。
ただし、起動スクリプトとして、次のconfを使用すると
/etc/init/myscript.conf:
私はこれを見る:
/li>
stderrとstdoutに別のファイルを使用すると、両方が作成されますが、stdoutは常に空です。
私は何が間違っているのですか?
sockets - MongoDB - ソケットに対する許可が拒否されました: /tmp/mongodb-27017.sock
Ubuntu 10.04 LTS で MongoDB が正しくシャットダウンされませんでした。root としてログインし、サービス mongodb start を介して Mongodb を実行すると、以下のエラーが発生します。
ルート経由で MongoDB を手動で実行すると、問題なく動作します。
/tmp/mongodb-27017.sock ファイルがないことを確認できました
トラブルシューティングはどこから始めればよいですか?
python - TornadowebWebアプリをupstartで管理することはできません
数日前、tornadowebフレームワーク上に作成したWebアプリが、upstartを介して停止または再起動しないことを知りました。Upstartはハングし、何もしません。
問題を調査したところ、upstartが間違ったPIDを受信したため、webappデーモンで1回しか実行できず、他に何もできないことがわかりました。
Straceは、デーモンが2回ではなく4回(!)のclone()呼び出しを行うことを示しています。
1週間前は何でも良かったし、webappは新興企業によって完全かつ正しく管理されていました。
OSはUbuntu10.04.03LTSです(数週間前のように)。
それを修正する方法はありますか?
PS:「expectfork |デーモン」ディレクティブについて知っていますが、何も変更されません;)
node.js - バイナリ データをログ ファイルに記録するプロセス
次のupstartスクリプトを使用してノードプロセスを開始し、stdoutとstderrを別々のファイルに記録しています。
問題は、両方のログ ファイルのヘッドにバイナリ データがあることです。これらのログをすばやく確認するために less または more を使用することはできません。これは非常に面倒です。そのプロセスがバイナリデータをログに記録するのを防ぐ方法はありますか?
python - Pythonを介してdbusオブジェクトインスタンスをフェッチするときに環境変数を渡す
pythonを使用して、Ubuntuでの新興ジョブのステータスを判断しています。
最近、upstart ジョブを変更して、Instance スタンザが次のようになるようにしましたinstance $some_var
。予想どおり、私のコードは機能しなくなりました。
私が試してみると:
それは私に言うのに失敗しますdbus.exceptions.DBusException: org.freedesktop.DBus.Error.InvalidArgs: Unknown parameter: some_var
some_var 環境変数を dbus インターフェイスに渡す必要があります。どうすればそれを行うことができますか?os.environ に設定してもうまくいかないようです。
ruby-on-rails - Using Upstart to manage Unicorn w/ rbenv + bundler binstubs w/ ruby-local-exec shebang
Alright, this is melting my brain. It might have something to do with the fact that I don't understand Upstart as well as I should. Sorry in advance for the long question.
I'm trying to use Upstart to manage a Rails app's Unicorn master process. Here is my current /etc/init/app.conf
:
That works just fine - the Unicorns start up great. What's not great is that the PID detected is not of the Unicorn master, it's of an sh
process. That in and of itself isn't so bad, either - if I wasn't using the automagical Unicorn zero-downtime deployment strategy. Because shortly after I send -USR2
to my Unicorn master, a new master spawns up, and the old one dies...and so does the sh
process. So Upstart thinks my job has died, and I can no longer restart it with restart
or stop it with stop
if I want.
I've played around with the config file, trying to add -D to the Unicorn line (like this: $APP_ROOT/bin/unicorn -c $APP_ROOT/config/unicorn.rb -E production -D
) to daemonize Unicorn, and I added the expect daemon
line, but that didn't work either. I've tried expect fork
as well. Various combinations of all of those things can cause start
and stop
to hang, and then Upstart gets really confused about the state of the job. Then I have to restart the machine to fix it.
I think Upstart is having problems detecting when/if Unicorn is forking because I'm using rbenv + the ruby-local-exec
shebang in my $APP_ROOT/bin/unicorn
script. Here it is:
Additionally, the ruby-local-exec
script looks like this:
So there's an exec
in there that I'm worried about. It fires up a Ruby process, which fires up Unicorn, which may or may not daemonize itself, which all happens from an sh
process in the first place...which makes me seriously doubt the ability of Upstart to track all of this nonsense.
Is what I'm trying to do even possible? From what I understand, the expect
stanza in Upstart can only be told (via daemon
or fork
) to expect a maximum of two forks.
redis - デーモン化された形式でRedisを実行し、Upstartを使用して管理することはできません
次のように、RedisのUpstartスクリプトを作成しました。
次に、redis.confを介してredisを次のように構成します。
すべてのドキュメントと私自身の実験によると、Redisはデーモン化された形式で2回フォークし、「expectデーモン」は機能するはずですが、Upstartスクリプトは常に前の親のPID(PID-1)を保持しています。誰かがこれを機能させましたか?
instance - 複数の upstart インスタンスを自動的に起動する
PHP のギアマン ワーカーを使用して、さまざまなタスクを並行して実行します。すべてがうまく機能し、必要なときに起動するためのばかげた小さなシェル スクリプトがあります。プログラマーである (したがって怠け者である) ので、新興スクリプトを使用してこれらを起動できるかどうかを確認したかったのです。
インスタンススタンザの使い方がわかったので、インスタンス番号で開始できます。
そして、これはうまく機能し、次のように開始します。
これらのワーカーを使用したい方法は、いくつかのワーカー (コアごとに 1 つなど) を起動することであり、起動時にこれを実行したいと考えています。明確にするために、コアの数を検出するために upstart スクリプトは必要ありません。「8 つのインスタンスを実行する」とだけ言ってよろしいのですが、それが複数の実行が必要な理由です。これを自動的に行うために、upstart スクリプトで「start on」句を使用する方法はありますか?
たとえば、インスタンス 1、2、3、4 を開始しますか? 次に、シャットダウン時に適切に終了しますか?
これをinit.dスクリプトにフックできると思いますが、upstartがこのようなことを処理できるかどうか、または誰かがこの問題を理解しているかどうか疑問に思っていました.
乾杯!