Hey
I'm currently trying to write a simple rc.d script to start sockso (a music server written in Java) at boot time.
To start the java program in the background I've a perl script in /usr/local/etc/rc.d/sockso.pl
To start the program I can use [CMD=""]perl sockso.pl start[/CMD], to stop it
I've written a simple rc.d script
When I call the script with the command
But when I try
Does anyone have a clue what could be wrong in my script?
Thank you!
I'm currently trying to write a simple rc.d script to start sockso (a music server written in Java) at boot time.
To start the java program in the background I've a perl script in /usr/local/etc/rc.d/sockso.pl
To start the program I can use [CMD=""]perl sockso.pl start[/CMD], to stop it
perl sockso.pl stop
.I've written a simple rc.d script
Code:
#!/bin/sh
#
# PROVIDE: sockso
# REQUIRE: LOGIN
# KEYWORD: shutdown
#
# Add the following lines to /etc/rc.conf.local or /etc/rc.conf
# to enable this service:
#
# sockso_enable (bool): Set to NO by default.
# Set it to YES to enable it.
. /etc/rc.subr
name="sockso"
rcvar=${name}_enable
sockso_enable=${sockso_enable-"NO"}
# command="/usr/local/etc/rc.d/sockso.pl"
# command_interpreter="/usr/local/bin/perl"
start_cmd="${name}_start"
stop_cmd="${name}_stop"
load_rc_config $name
sockso_start(){
echo "Starting sockso"
cd /usr/local/etc/rc.d
perl sockso.pl start
}
sockso_stop(){
echo "Stopping sockso"
cd /usr/local/etc/rc.d
perl sockso.pl stop
}
run_rc_command "$1"
When I call the script with the command
sh sockso start
it works.But when I try
service sockso start
it doesn't work. All I get is the output of echo but the program doesn't start.Does anyone have a clue what could be wrong in my script?
Thank you!