Try this.
Open your autostart file.
Code:
medit `/.config/autostart.sh
There isn't anything special about this file. It's just sitting there taking up a name and space. Lets put it to work.
autostart.sh wrote:
#!/bin/bash
#
# This files gets started after
# the boot sequence finished.
#
#opencpnais&
Add your commands that you claim work to the bottom of the file
Code:
#!/bin/bash
#
# This files gets started after
# the boot sequence finished.
#
#opencpnais&
sudo stty -F /dev/ttyS0 4800 &
sudo stty -F /dev/ttyS1 57600 &
Save and exit.
This file needs to be marked execuatable
Code:
chmod a+x ~/.config/autostart.sh
Now comes the magic part.
There is hardworking background application called
cron which takes care of time (chronological) events. Enter
Code:
crontab -e
The first time you will need to select an editor. #2 (nano) is a good choice.
A little (nano) text editor opens. It is very basic. Don't freak out. All of the commands are listed at the botton of the terminal. The chronology table looks like
Quote:
# Edit this file to introduce tasks to be run by cron.
#
# Each task to run has to be defined through a single line
# indicating with different fields when the task will be run
# and what command to run for the task
#
# To define the time you can provide concrete values for
# minute (m), hour (h), day of month (dom), month (mon),
# and day of week (dow) or use '*' in these fields (for 'any').#
# Notice that tasks will be started based on the cron's system
# daemon's notion of time and timezones.
#
# Output of the crontab jobs (including errors) is sent through
# email to the user the crontab file belongs to (unless redirected).
#
# For example, you can run a backup of all your user accounts
# at 5 a.m every week with:
# 0 5 * * 1 tar -zcf /var/backups/home.tgz /home/
#
# For more information see the manual pages of crontab(5) and cron(8)
#
# m h dom mon dow command
It's _empty_ except for the comments (
#). Add on a new line at the bottom of the file.
Code:
@reboot ~/.config/autostart.sh
This says, 'on every reboot, launch the following....',
<ctrl><x>to Save and Exit.
You will be asked to varify this is what you want to do.
Reboot. It happens auto-magically.
Don't trust that it is being executed? Add
Code:
touch ~/Desktop/YES_IT_IS_REALLY_WORKING
to the bottom of ~/.config/
autostart.sh and everytime you reboot, a file with the name YES_IT_IS_REALLY_WORKING will appear on your desktop.
Try it. Still not working? the
sudo command should still be active from the last go-round. Check the
stty commands.