# rc.d script doesn't start up



## cosmin (Sep 29, 2012)

Hello guys!

I have a jail for subsonic. In order to start-up subsonic when the jail starts up I've created a rc.d script:


```
#!/bin/sh

# PROVIDE: subsonic
# REQUIRE: daemon
# BEFORE: LOGIN

. /etc/rc.subr

name="subsonic"
rcvar=subsonic_start 
command="/usr/local/subsonic/subsonic.sh"

load_rc_config $name
run_rc_command "$1"
```

My rc.conf for the jail is:

```
Pretuned by German Engineers

# No network interfaces in jails
network_interfaces="re0"
hostname="subsonic"

kern_securelevel_enable="YES"
kern_securelevel=2  
# Prevent rpc
rpcbind_enable="NO"

# Prevent loads of jails doing their cron jobs at the same time
cron_flags="$cron_flags -J 15"

# Prevent syslog to open sockets
syslogd_flags="-ss"

# Prevent sendmail to try to connect to localhost
sendmail_enable="NO"
sendmail_submit_enable="NO"
sendmail_outbound_enable="NO"
sendmail_msp_queue_enable="NO"

# Bring up sshd, it takes some time and uses some entropy on first startup
sshd_enable="NO"

subsonic_enable="YES"
```

The problem is that subsonic doesn't start at startup time but I can started manually.
Please can you help me?


----------



## Nulani (Sep 30, 2012)

It's supposed to be:  

```
load_rc_config ${name}
```

I believe?


----------



## Nulani (Sep 30, 2012)

It is because rcvar is set to subsonic_start when it should be set to subsonic_enable.

Try: 


```
rcvar=`set_rcvar`
```

Sorry about the double post.


----------



## cosmin (Sep 30, 2012)

Thank for the answer, but it doesn't work.
I've changed to 

```
#!/bin/sh

# PROVIDE: subsonic
# REQUIRE: daemon
# BEFORE: LOGIN

. /etc/rc.subr

name=subsonic
rcvar=subsonic_enable
command="/usr/local/subsonic/subsonic.sh"
  

load_rc_config $name        
run_rc_command "$1
```

It's exactly how is described in FreeBSD Handbook.


----------

