I've compiled kotlin source code to .jar file to run my personal authentication server. Upon referring to docs and other sources, I've made a authserver
rc script that looks like:
#!/bin/sh
. /etc/rc.subr
name=authserver
rcvar=authserver_enable
start_cmd="authserver_start"
stop_cmd="authserver_stop"
authserver_start()
{
source $HOME/backend/env.sh
/usr/local/bin/java java -jar $HOME/backend/one.karaage.mrwrapper-all.jar
}
authserver_stop()
{
}
load_rc_config $name
run_rc_command "$1"
file tree
.
├── backend
│ ├── env.sh
│ ├── one.karaage.mrwrapper-all.jar
│ └── rc.d
│ └── authserver
The issue I'm facing is, when I run service authserver start
I get .: cannot open /etc/rc.subr: Permission denied
.
Is there any other way than writing a rc script to autostart my .jar
file after system reboot/failure ?