MeetMe/newrelic_plugin_agent
Ubuntu 12.04 で upstart を使用して New Relic 監視プラグインを開始しようとしています。これが私が書いたスクリプトです:
env USER=newrelic
env DAEMON="/usr/local/bin/newrelic_plugin_agent"
env DAEMONARGS=" -c /etc/newrelic/newrelic_plugin_agent.cfg"
start on startup
stop on shutdown
exec start-stop-daemon --start --chuid $USER --exec $DAEMON --$DAEMONARGS
次のエラーが、対応する upstart ログに書き込まれます。Error starting /usr/local/bin/newrelic_plugin_agent: Cannot write to specified pid file path /var/run/newrelic/newrelic_plugin_agent.pid
--make-pidfile --pidfile /var/run/newrelic/newrelic_plugin_agent.pid
にパラメータを追加するとstart-stop-daemon
:
exec start-stop-daemon --start --make-pidfile --pidfile
/var/run/newrelic/newrelic_plugin_agent.pid --chuid $USER
--exec $DAEMON --$DAEMONARGS
ログには が含まれていますstart-stop-daemon: unable to open pidfile '/var/run/newrelic/newrelic_plugin_agent.pid' for writing (No such file or directory)
。
/var/run/newrelic/
フォルダが存在し、ユーザーが所有し、グループnewrelic
に割り当てられています。new relic
newrelic_plugin_agent が起動時に開始されるように、upstart スクリプトを作成するにはどうすればよいですか?