Skip to content

Commit 2dd4ab6

Browse files
committed
update the supervisor script and conf
now, we auto add the start.sh -> /usr/bin/gogs_start, then supervisor needn’t the full path, detail please see the commit. and how to use: entry gogs root path, then input scripts/gogs_supervisord.sh restart (add sudo if need)
1 parent b93ae45 commit 2dd4ab6

File tree

2 files changed

+14
-9
lines changed

2 files changed

+14
-9
lines changed

etc/supervisord.conf

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
[unix_http_server]
2-
file=/tmp/supervisor.sock ; path to your socket file
2+
file=log/supervisor.sock ; path to your socket file
33

44
[supervisord]
55
logfile=log/supervisord.log ; supervisord log file
66
logfile_maxbytes=50MB ; maximum size of logfile before rotation
77
logfile_backups=10 ; number of backed up logfiles
88
loglevel=warn ; info, debug, warn, trace
9-
pidfile=/tmp/supervisord.pid ; pidfile location
9+
pidfile=log/supervisord.pid ; pidfile location
1010
nodaemon=false ; run supervisord as a daemon
1111
minfds=1024 ; number of startup file descriptors
1212
minprocs=200 ; number of process descriptors
@@ -17,10 +17,10 @@ childlogdir=log
1717
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface
1818

1919
[supervisorctl]
20-
serverurl=unix:///tmp/supervisor.sock ; use a unix:// URL for a unix socket
20+
serverurl=unix://log/supervisor.sock ; use a unix:// URL for a unix socket
2121

2222
[program:gogs]
23-
command = /root/Developer/gopath/src/github.com/gogits/gogs/start.sh ; here must be the real url, not ~ or $GOROOT like
23+
command = gogs_start
2424
autostart = true
25-
stdout_logfile = log/supervisor-gogs-stderr.log
26-
stderr_logfile = log/supervisor-gogs-error.log
25+
stdout_logfile = log/supervisor-gogs-out.log
26+
stderr_logfile = log/supervisor-gogs-err.log

scripts/gogs_supervisord.sh

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
11
#!/bin/sh
22

3-
echo 'plase remember to modify the command path in etc/supervisord.conf(line 23)'
4-
5-
PID="/tmp/supervisord.pid"
3+
PID="log/supervisord.pid"
64
CONF="etc/supervisord.conf"
75

6+
EXEPATH='/usr/bin/gogs_start'
7+
if [ ! -f $EXEPATH ]; then
8+
gogs_scripts_path=$(cd `dirname $0`; pwd)
9+
echo $gogs_scripts_path
10+
sudo ln -s $gogs_scripts_path'/start.sh' /usr/bin/gogs_start
11+
fi
12+
813
LOGDIR="log"
914
if [ ! -d $LOGDIR ]; then
1015
mkdir $LOGDIR

0 commit comments

Comments
 (0)