Hi,
I am trying to auto-start my application on boot-up, but can't seem to make it work.
I have tried three different methods...
1) I tried using crontab, placing either a link to my application or a shell script.
Neither one seemed to work.
example:
@reboot sudo /home/laser/./lasam.sh
lasam.sh is:
#!/bin/bash
cd /home/laser
export DISPLAY=:0
sudo /home/laser/./fltk
- or -
@reboot sudo /home/laser/./fltk
2) Putting a service into /etc/init.d/lasamservice
which contains:
### BEGIN INIT INFO
# Provides: Lasam Service
# Required-Start: $all
# Required-Stop:
# Default-Start: 5
# Default-Stop: 6
# Short-Description: Lasam Program
### END INIT INFO
/home/laser/./lasam.sh
Then, activating the service by
sudo update-rc.d lasamservice defaults
3) I tried adding a line to /etc/rc.local:
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
startx
#sudo /home/laser/./lasam.sh
exit 0
None of these techniques seem to work.
It ends up with a command prompt on the screen.
What am I doing wrong, and which of these is the best?
Thanks!
- al
I am trying to auto-start my application on boot-up, but can't seem to make it work.
I have tried three different methods...
1) I tried using crontab, placing either a link to my application or a shell script.
Neither one seemed to work.
example:
@reboot sudo /home/laser/./lasam.sh
lasam.sh is:
#!/bin/bash
cd /home/laser
export DISPLAY=:0
sudo /home/laser/./fltk
- or -
@reboot sudo /home/laser/./fltk
2) Putting a service into /etc/init.d/lasamservice
which contains:
### BEGIN INIT INFO
# Provides: Lasam Service
# Required-Start: $all
# Required-Stop:
# Default-Start: 5
# Default-Stop: 6
# Short-Description: Lasam Program
### END INIT INFO
/home/laser/./lasam.sh
Then, activating the service by
sudo update-rc.d lasamservice defaults
3) I tried adding a line to /etc/rc.local:
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
startx
#sudo /home/laser/./lasam.sh
exit 0
None of these techniques seem to work.
It ends up with a command prompt on the screen.
What am I doing wrong, and which of these is the best?
Thanks!
- al
Statistics: Posted by laughingcat — Thu Apr 25, 2024 10:13 pm — Replies 4 — Views 80