Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
diaspora
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Milan
diaspora
Commits
fcd70ce1
Commit
fcd70ce1
authored
14 years ago
by
Alec Leamas
Browse files
Options
Downloads
Patches
Plain Diff
Add a configuration file
Adds a config file with environment and default thin options
parent
ed8878c7
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
config/server.sh
+11
-0
11 additions, 0 deletions
config/server.sh
script/server
+14
-14
14 additions, 14 deletions
script/server
with
25 additions
and
14 deletions
config/server.sh
0 → 100644
+
11
−
0
View file @
fcd70ce1
#
# Included by script/server
#
THIN_PORT
=
3000
SOCKET_PORT
=
8080
# See thin -h for possible values.
DEFAULT_THIN_ARGS
=
"-p
$THIN_PORT
"
# Uncomment to run in production mode.
#export RAILS_ENV="production rails server"
This diff is collapsed.
Click to expand it.
script/server
+
14
−
14
View file @
fcd70ce1
...
...
@@ -6,27 +6,28 @@
realpath
=
$(
ruby
-e
"puts File.expand_path(
\"
$0
\"
)"
)
cd
$(
dirname
$realpath
)
/..
PORT
=
3000
THIN_ARGS
=
"
$@
"
while
[
$#
-gt
0
]
;
do
if
[
"
$1
"
=
'-p'
]
;
then
PORT
=
"
$2
"
break
fi
shift
[
-e
config/server.sh
]
&&
source
config/server.sh
# Scan for -p, find out what port thin is about to use.
args
=
"
$DEFAULT_THIN_ARGS
$@
"
prev_arg
=
''
for
arg
in
$(
echo
$args
|
awk
'{ for (i = 1; i <= NF; i++) print $i}'
)
do
[
"
$prev_arg
"
=
'-p'
]
&&
THIN_PORT
=
"
$arg
"
prev_arg
=
"
$arg
"
done
# Is someone listening on the ports already? (ipv4 only test ?)
services
=
$(
netstat
-nl
|
grep
'[^:]:'
$PORT
'[ \t]'
)
services
=
$(
netstat
-nl
|
grep
'[^:]:'
$
THIN_
PORT
'[ \t]'
)
if
[
-n
"
$services
"
]
;
then
echo
"Error:
something is already using thin port
$PORT
. Exiting"
>
&2
echo
"Error:
thin port
$THIN_PORT
is already in use
. Exiting"
>
&2
echo
"
$services
"
exit
64
fi
services
=
$(
netstat
-nl
|
grep
'[^:]:
8080
[ \t]'
)
services
=
$(
netstat
-nl
|
grep
'[^:]:
'
$SOCKET_PORT
'
[ \t]'
)
if
[
-n
"
$services
"
]
;
then
echo
"Error:
something is already using websocket port 8080
. Exiting"
>
&2
echo
"Error:
websocket port
$SOCKET_PORT
is already in use
. Exiting"
>
&2
echo
"
$services
"
exit
64
fi
...
...
@@ -49,5 +50,4 @@ fi
mkdir
-p
-v
log/thin/
bundle
exec
ruby ./script/websocket_server.rb&
bundle
exec
thin start
$THIN_ARGS
bundle
exec
thin start
$args
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment