Solved Custom service: /usr/local/etc/rc.d/step-ca: WARNING: no shebang line in /usr/local/sbin/step-ca

I am making my custom service for runnig step-ca with it's port, as the one is coming with is miss functioning.
The code goes like:
Code:
#!/bin/sh

. /etc/rc.subr

name=step_ca
rcvar=step_ca_enable

export STEPPATH="/usr/local/etc/step/"
command="/usr/local/sbin/step-ca --password-file=/usr/local/etc/step/password.txt /usr/local/etc/step/config/ca.json"

load_rc_config $name
run_rc_command "$1"
but when I try to run it, service step-ca start, I get the error
Code:
/usr/local/etc/rc.d/step-ca: WARNING: no shebang line in /usr/local/sbin/step-ca
/usr/local/etc/rc.d/step-ca: WARNING: run_rc_command: cannot run /usr/local/sbin/step-ca --password-file=/usr/local/etc/step/password.txt /usr/local/etc/step/config/ca.json
Even when I run STEPPATH="/usr/local/etc/step/" /usr/local/sbin/step-ca --password-file=/usr/local/etc/step/password.txt /usr/local/etc/step/config/ca.json everything goes well.
 
Chaning it for:
Code:
#!/bin/sh

. /etc/rc.subr

name=step_ca
rcvar=step_ca_enable
start_cmd="${name}_start"
stop_cmd=":"

step_ca_start() {
        export STEPPATH="/usr/local/etc/step/"
        /usr/sbin/daemon /usr/local/sbin/step-ca --password-file=/usr/local/etc/step/password.txt /usr/local/etc/step/config/ca.json
}

load_rc_config $name
run_rc_command "$1"
solved the problem
 
Back
Top