Other run a golang script as rc.d script strange!

Hi,
I am trying to run a executable I created with golang named webstart located in /go/webstart/webstart

Here is a script I create based on this example
Code:
#!/bin/sh
. /etc/rc.subr
name="startweb"
rcvar="startweb_enable"
command="/go/webstart/webstart"
load_rc_config $name
run_rc_command "$1"
then I added startweb_enable="YES" in /etc/rc.conf
then I reboot
then I try to start with command

service startweb start

I get error
Code:
env: /usr/local/etc/rc.d/startweb: No such file or directory
What I am doing wrong?
if I run it with ./webstart from /go/webstart/ everything is fine

Thank you

I am using FreeBSD 13.1
 
Where is your script stored and what is its filename? It seems as if there is no /usr/local/etc/rc.d/startweb.
 
Where is your script stored and what is its filename? It seems as if there is no /usr/local/etc/rc.d/startweb.
~ # ls -l /usr/local/etc/rc.d/startweb
-rwxr-xr-x 1 root wheel 156 Oct 26 10:39 /usr/local/etc/rc.d/startweb

my script is in /usr/local/etc/rc.d/ as you can see.
 
i am using freebsd 13.1
FreeBSD version 13.1 is end of line since the end of July 2023 and thus not supported in this forum anymore (Thread 40469).​
env: /usr/local/etc/rc.d/startweb: No such file or directory
Searching the error message you find Thread 88802. There encoding was an issue. To figure out your situation run the script in foreground:​
[…] try to run the script "by hand" and try to figure out where it breaks:
Code:
sh -x /usr/local/etc/rc.d/ubuntu onestart
 
Back
Top