I have compiled and installed Trinitycore (for personal use) and I want it to start with the system as a service.
My /usr/local/etc/rc.d/worldserver files is:
and when I start it with the command [cmd=]service worldserver start[/cmd] I get:
What am I doing wrong?
My /usr/local/etc/rc.d/worldserver files is:
Code:
#!/bin/sh
#
# $FreeBSD: $
#
# PROVIDE: worldserver
# REQUIRE: SERVERS
# BEFORE: DAEMON
# KEYWORD: shutdown
#
# Add the following line to /etc/rc.conf[.local] to enable worldserver
#
# worldserver_enable (bool): Set to "NO" by default.
# Set it to "YES" to enable worldserver.
# worldserver_args (str): Custom additional arguments to be passed
# to worldserver (default empty).
#
. /etc/rc.subr
name="worldserver"
rcvar=worldserver_enable
load_rc_config $name
: ${worldserver_enable="NO"}
: ${worldserver_pidfile="/var/run/worldserver.pid"}
: ${worldserver_lockfile="/var/spool/lock/worldserver.lock"}
pidfile="/var/run/worldserver.pid"
required_files="/usr/local/etc/worldserver.conf"
command="/usr/local/bin/screen -d -m -S worldserver /usr/local/bin/worldserver"
run_rc_command "$1"
and when I start it with the command [cmd=]service worldserver start[/cmd] I get:
Code:
/usr/local/etc/rc.d/worldserver: WARNING: no shebang line in /usr/local/bin/screen
[: /usr/local/bin/screen: unexpected operator
Starting worldserver.
What am I doing wrong?