From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Running a Shell Script on Boot via init.d

Hey, All.

 

Having some fun trying to run a shell script to auto-start some things via init.d. Understand that getting these wrong can have major implications.They're also a bit of a mystic art to get right IMO. Hoping someone can offer some assistance on what might be wrong, and potential ways to troubleshoot issues like this that happen without loud errors. The script worked to launch/modify what I had wanted to do, but had symptoms within the LabVIEW toolchain such as no more discovery with Max or not being able to deploy to target. Could still ping, ssh, sftp, add to project, discover cards, but if you enabled script on boot, certain things wouldn't work, disable script on boot, back to working.

 

Command Line arguments as well as script file content are below.

Command Line commands:

GoTo /etc/init.d and execute the following commands (likely as admin).
Based on this link https://unix.stackexchange.com/questions/20357/how-can-i-make-a-script-in-etc-init-d-start-at-boot


chmod +x x11vnc_starter
chkconfig --add x11vnc_starter
chkconfig --level 2345 x11vnc_starter on

 

Verify the script is added and enabled appropriately
chkconfig --list | grep x11vnc_starter

rhenderson_0-1678828453091.png

 

Contents of x11vnc-starter file:

#! /bin/sh
### BEGIN INIT INFO
# Provides: x11vnc
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: x11vnc starter
# Description: starts the x11vnc server with specified options at set resolution
### END INIT INFO

export DISPLAY=:0
xrandr --display :0 --fb 1920x1080
x11vnc -display :0 -forever -shared -passwdfile /home/admin/.vnc/passwdfile

 

Thanks in advance,

Robert

0 Kudos
Message 1 of 1
(899 Views)