ソースを参照

Better running on sock

George Baugh 5 ヶ月 前
コミット
ebeedebb90
3 ファイル変更10 行追加3 行削除
  1. 3 1
      bin/build_zone
  2. 4 2
      tcms
  3. 3 0
      tcms-uwsgi

+ 3 - 1
bin/build_zone

@@ -48,7 +48,9 @@ use Net::IP;
 
 use Getopt::Long qw{GetOptionsFromArray};
 
-main(@ARGV) unless caller;
+$ENV{NOHUP} = 1;
+
+exit main(@ARGV) unless caller;
 
 sub main(@args) {
 

+ 4 - 2
tcms

@@ -1,3 +1,5 @@
 #!/bin/bash
-export PSGI_ENGINE='uwsgi'
-uwsgi --ini config/tcms.ini
+pkill -F run/tcms.pid
+sudo WWW_VERBOSE=1 www/server.psgi --listen run/tcms.sock --group www-data --user $USER --daemonize --pid run/tcms.pid
+#XXX Net::Server does not expect to run as a user other than that of the webserver
+sudo chmod 0775 run/tcms.sock

+ 3 - 0
tcms-uwsgi

@@ -0,0 +1,3 @@
+#!/bin/bash
+export PSGI_ENGINE='uwsgi'
+uwsgi --ini config/tcms.ini