Hello to everyone.
I'm trying to create a vnc-server service that should be enabled when the system start. I've created the script below that I've placed inside the folder: /usr/local/etc/rc.d
and inside the file /etc/rc.conf , I have included :
unfortunately it does not work. On the boot messages I see these errors :
can someone help me to understand where is the error ?
I'm trying to create a vnc-server service that should be enabled when the system start. I've created the script below that I've placed inside the folder: /usr/local/etc/rc.d
Code:
#!/bin/sh
# PROVIDE: vnc-server
#
# Add the following line to /etc/rc.conf[.local] to enable vnc-server.
#
# vnc-server_enable (bool): Set to 'YES' to enable
# Default: NO
#
# vnc-server_flags (str): Custom additional arguments to be passed to vnc-server.
# For example, to make it listen on TCP ports, set it
# to "--listen".
# Default: ""
#
. /etc/rc.subr
name=vnc-server
rcvar=vnc-server_enable
load_rc_config $name
: ${vnc-server_enable:="YES"}
: ${vnc-server_flags:="-geometry"}
command=/usr/local/bin/vncserver
pidfile=/var/run/${name}.pid
command_args="--daemon --pid-file=${pidfile}"
PATH="${PATH}:/usr/local/bin"
run_rc_command "$1"
and inside the file /etc/rc.conf , I have included :
Code:
vnc-server="YES"
vnc-server_flags="1920x1080"
unfortunately it does not work. On the boot messages I see these errors :
Code:
/etc/rc.conf: vnc-server=YES: not found
/etc/rc.conf: vnc-server_flag=1920x1080: not found
/etc/rc.conf : WARNING: $vnc-server_enable is not set properly
can someone help me to understand where is the error ?