Linux

プロセスが環境変数をもつ

勘違いしていたのだがプロセスが環境変数を保持している。ユーザが持っているわけではない。 supervisodをrootユーザで実行し、その子プロセスが実行するアプリケーションは別ユーザで実行するようにsupervisor.confを設定( http://supervisord.org/configur…

logrotateのタイミングでsupervisordのプロセスが落ちる

結論から言うと、ドキュメントちゃんと読んでなかったおれが悪い。 例えば、nginxのログに対してlogrotateの設定ファイルを書くと、 /var/log/nginx/*log { create 0644 nginx nginx daily rotate 10 missingok notifempty compress postrotate [ -f /var/ru…

supervisorの起動スクリプト

supervisorの最新版をeasy_installでインストールしたら起動スクリプトがなかったので簡単なやつを書いた。centos6.7で /etc/init.d/supervisord として配置する。 #!/bin/sh # # supervisord - this script starts and stops supervisord # # chkconfig: 35…

Goアプリケーションをsupervisorでdaemonとして起動する

起動したGoのアプリケーションをdaemonプロセスとして動かす。なお、Centos6.7を使用している。 Supervisor: A Process Control System — Supervisor 3.3.3 documentation Install $ wget https://bootstrap.pypa.io/ez_setup.py -O - | python $ easy_insta…

CentOSでユーザ追加

DockerでGoの環境構築する際にCentOSでユーザ追加したのでメモ。 $ useradd -m -d /home/docker -s /bin/bash docker $ echo "docker:docker" | chpasswd $ echo "docker ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers useradd:新規ユーザの追加 chpasswdでパス…