| <?xml version="1.0"?> |
| <!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1"> |
| <!-- |
| Copyright 2015-2020 Rivoreo |
| |
| Permission is hereby granted, free of charge, to any person obtaining |
| a copy of this software and associated documentation files (the |
| "Software"), to deal in the Software without restriction, including |
| without limitation the rights to use, copy, modify, merge, publish, |
| distribute, sublicense, and/or sell copies of the Software, and to |
| permit persons to whom the Software is furnished to do so, subject to |
| the following conditions: |
| |
| The above copyright notice and this permission notice shall be |
| included in all copies or substantial portions of the Software. |
| |
| THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
| EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
| MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
| NONINFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE |
| FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF |
| CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION |
| WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
| --> |
| |
| <service_bundle type="manifest" name="minecraft"> |
| <service name="site/minecraft" type="service" version="1"> |
| |
| <create_default_instance enabled="false" /> |
| <!--<single_instance/>--> |
| |
| <dependency name="network" grouping="require_all" restart_on="error" type="service"> |
| <service_fmri value="svc:/milestone/network:default"/> |
| </dependency> |
| |
| <dependency name="filesystem" grouping="require_all" restart_on="error" type="service"> |
| <service_fmri value="svc:/system/filesystem/local"/> |
| </dependency> |
| |
| <!-- |
| <method_context> |
| <method_credential user="%{user}" group="games"/> |
| </method_context> |
| --> |
| |
| <exec_method type="method" name="start" exec="/lib/svc/method/minecraft start" timeout_seconds="60"/> |
| <exec_method type="method" name="stop" exec="/lib/svc/method/minecraft stop" timeout_seconds="60"/> |
| |
| <property_group name="startd" type="framework"> |
| <propval name="duration" type="astring" value="contract"/> |
| <propval name="ignore_error" type="astring" value="core,signal"/> |
| </property_group> |
| |
| <property_group name="config" type="application"> |
| <propval name="user" type="astring" value="minecraft" /> |
| <propval name="home" type="astring" value="/var/games/minecraft" /> |
| <propval name="start_command" type="astring" value="exec sh run.sh" /> |
| <propval name="use_tmux" type="boolean" value="false" /> |
| <propval name="session_name" type="astring" value="minecraft" /> |
| <propval name="alt_log_file" type="astring" value="/dev/null" /> |
| <property name="servers" type="astring" /> |
| </property_group> |
| |
| <stability value="Evolving"/> |
| |
| <template> |
| <common_name> |
| <loctext xml:lang="C"> |
| Minecraft server |
| </loctext> |
| </common_name> |
| <pg_pattern name="config" type="application" target="this"> |
| <prop_pattern name="user" type="astring" required="true"> |
| <common_name> |
| <loctext xml:lang="C"> |
| The user name to run Minecraft server |
| </loctext> |
| </common_name> |
| </prop_pattern> |
| <prop_pattern name="home" type="astring" required="false"> |
| <common_name> |
| <loctext xml:lang="C"> |
| Home directory of Minecraft server instances |
| </loctext> |
| </common_name> |
| </prop_pattern> |
| <prop_pattern name="start_command" type="astring" required="true"> |
| <common_name> |
| <loctext xml:lang="C"> |
| Server startup command |
| </loctext> |
| </common_name> |
| </prop_pattern> |
| <prop_pattern name="use_tmux" type="boolean" required="true"> |
| <common_name> |
| <loctext xml:lang="C"> |
| Enable to uses of tmux(1) |
| </loctext> |
| </common_name> |
| </prop_pattern> |
| <prop_pattern name="session_name" type="astring" required="true"> |
| <common_name> |
| <loctext xml:lang="C"> |
| Base session name of tmux(1) sessions |
| </loctext> |
| </common_name> |
| </prop_pattern> |
| <prop_pattern name="alt_log_file" type="astring" required="true"> |
| <common_name> |
| <loctext xml:lang="C"> |
| Redirect outputs to this file if tmux(1) is not used |
| </loctext> |
| </common_name> |
| </prop_pattern> |
| <prop_pattern name="servers" type="astring" required="true"> |
| <common_name> |
| <loctext xml:lang="C"> |
| List of server instance names |
| </loctext> |
| </common_name> |
| </prop_pattern> |
| </pg_pattern> |
| </template> |
| |
| </service> |
| |
| </service_bundle> |