Solved service -e Not Showing Custom Enabled Service.

I have a jail with a custom rc.d script that I had made to run a server on boot.

The script at /usr/local/etc/rc.d/minecraft looks like this:

Code:
#!/bin/sh

. /etc/rc.subr

name=minecraft
rcvar=minecraft_enable

required_files="/opt/servers/minecraft/start.sh"

start_cmd=${name}_start
stop_cmd=${name}_stop

minecraft_start()
{
   echo "Starting ${name}."
   /opt/servers/minecraft/start.sh
   echo "Done."
}
minecraft_stop()
{
   #My Stop Command
}

load_rc_config $name
run_rc_command "$@"

Inside my /etc/rc.conf I have minecraft_enable="YES". However after a restart of the jail, the service never started. If I do service -e the output is:

Code:
/etc/rc.d/cleanvar
/etc/rc.d/netif
/etc/rc.d/newsyslog
/etc/rc.d/syslogd
/etc/rc.d/virecover
/etc/rc.d/cleartmp
/etc/rc.d/motd
/etc/rc.d/cron

Am I missing something? If I run service start minecraft everything runs just fine.
 
If you look at other rc scripts you see lines at the top with PROVIDE, REQUIRE, etc. in them. Even though they are commented there are required by rcorder(8) (which service -e calls) to do its job.

Where can I find a good list of REQUIRE variables for rcorder? I'm not seeing a list on the guide for rc.d scripts.
 
The names of other services are valid values for it i.e. the value from the PROVIDE entries in files from /etc/rc.d and /usr/local/etc/rc.d. Usually the filename matches what is in PROVIDE.
 
The names of other services are valid values for it i.e. the value from the PROVIDE entries in files from /etc/rc.d and /usr/local/etc/rc.d. Usually the filename matches what is in PROVIDE.

Thanks! This completely resolved my issue.
 
Back
Top