FreeBSD Bugzilla – Attachment 157603 Details for
Bug 200743
[MAINTAINER] games/minecraft-server: rc.d improvements
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch File
patch.diff (text/plain), 2.71 KB, created by
Jonathan Price
on 2015-06-10 08:50:37 UTC
(
hide
)
Description:
Patch File
Filename:
MIME Type:
Creator:
Jonathan Price
Created:
2015-06-10 08:50:37 UTC
Size:
2.71 KB
patch
obsolete
>Index: Makefile >=================================================================== >--- Makefile (revision 388983) >+++ Makefile (working copy) >@@ -2,6 +2,7 @@ > > PORTNAME= minecraft-server > PORTVERSION= 1.8.7 >+PORTREVISION= 1 > CATEGORIES= games java > MASTER_SITES= https://s3.amazonaws.com/Minecraft.Download/versions/${PORTVERSION}/ > DISTNAME= minecraft_server.${PORTVERSION}.jar >Index: files/minecraft.in >=================================================================== >--- files/minecraft.in (revision 388983) >+++ files/minecraft.in (working copy) >@@ -20,18 +20,23 @@ > minecraft_mem=${minecraft_mem:-"1024M"} > minecraft_args=${minecraft_args:-""} > >-extra_commands="console status" >+extra_commands="console status kill" > start_cmd="${name}_start" > stop_cmd="${name}_stop" > console_cmd="${name}_console" > status_cmd="${name}_status" >+kill_cmd="${name}_kill" > >+is_running() >+{ >+ pgrep -qu mcserver java >+ return $? >+} >+ > minecraft_start() > { >- pgrep -qu mcserver java >- isrunning=$? >- if [ ${isrunning} -eq 0 ]; then >- echo "${name} already running." >+ if is_running; then >+ echo "${name} is already running." > else > echo "Starting ${name}." > cd %%PREFIX%%/minecraft-server >@@ -41,9 +46,7 @@ > > minecraft_stop() > { >- pgrep -qu mcserver java >- isrunning=$? >- if [ ${isrunning} -eq 0 ]; then >+ if is_running; then > echo "Stopping ${name}." > su mcserver -c "%%LOCALBASE%%/bin/tmux send-keys -t ${name} \"stop\" ENTER" > >@@ -50,27 +53,25 @@ > i=0 > while [ $i -lt 10 ]; do > i=$(($i + 1)) >- pgrep -qu mcserver java >- stillrunning=$? >- if [ ${stillrunning} -eq 0 ]; then >+ if is_running; then > sleep 1 > else >- echo "${name} stopped." >+ echo "${name} has been stopped." > return > fi > done >- echo "ERROR: ${name} could not be stopped." >+ echo "WARN: ${name} could not be stopped or is taking longer than expected." >+ echo "WARN: To view the console, type 'service ${name} console'" >+ echo "WARN: To kill $[name}, type 'service ${name} kill'" > else >- echo "${name} not running." >+ echo "${name} is not running." > fi > } > > minecraft_console() > { >- pgrep -qu mcserver java >- isrunning=$? >- if [ ${isrunning} -ne 0 ]; then >- echo "${name} not running." >+ if ! is_running; then >+ echo "${name} is not running." > else > export TERM=xterm > su mcserver -c "%%LOCALBASE%%/bin/tmux attach-session -t ${name}" >@@ -79,9 +80,7 @@ > > minecraft_status() > { >- pgrep -qu mcserver java >- isrunning=$? >- if [ ${isrunning} -eq 0 ]; then >+ if is_running; then > echo "${name} is running." > else > echo "${name} is not running." >@@ -88,4 +87,14 @@ > fi > } > >+minecraft_kill() >+{ >+ if ! is_running; then >+ echo "${name} is not running." >+ else >+ pkill -KILL -u mcserver java >+ echo "${name} has been killed." >+ fi >+} >+ > run_rc_command "$1"
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
freebsd
:
maintainer-approval+
Actions:
View
|
Diff
Attachments on
bug 200743
:
157580
|
157581
|
157582
| 157603 |
157604
|
157605