xastir autostart


ramsatphones@...
 

I have setup xastir to autostart using the .congif/autostart/xastir.desktop method
some times it works fine, sometimes it does not work fine and tight vnc works everytime. I have to power cycle the pi several times before xastir autostarts. What i am trying to achieve is that if the power goes out then comes back on everything starts back up automatically. what can cause xastir to not boot if the power is pulled then comes back? is there a better way to do this?

regards

Woz VK4LEG


g4sra
 

On 21/04/14 09:13, ramsatphones@... wrote:
What i am trying to achieve is that if the power goes out then comes back on everything starts back up automatically.
The only way you can achieve that is to avoid file system corruption.

Either have the Pi shut down properly - buy an UPS, there is one
specifically available for the PI but it may not be compatible with
other expansion boards.

Or have your SD Card file system mounted read-only with temporary
working storage in RAM (all my Pi's work this way, it increases SD Card
life considerably).


Jack Smith
 

Just thinking, would running from a USB stick help with either the speed or card lifespan issues?

 

73,

Jack KE4LWT

Very much a pi newbie

 

From: Raspberry_Pi_4-Ham_RADIO@... [mailto:Raspberry_Pi_4-Ham_RADIO@...] On Behalf Of g4sra
Sent: Saturday, April 26, 2014 10:10 AM
To: Raspberry_Pi_4-Ham_RADIO@...
Subject: Re: [Raspberry_Pi_4-Ham_RADIO] xastir autostart

 

 

On 21/04/14 09:13, ramsatphones@... wrote:
> What i am trying to achieve is that if the power goes out then comes back on everything starts back up automatically.
The only way you can achieve that is to avoid file system corruption.

Either have the Pi shut down properly - buy an UPS, there is one
specifically available for the PI but it may not be compatible with
other expansion boards.

Or have your SD Card file system mounted read-only with temporary
working storage in RAM (all my Pi's work this way, it increases SD Card
life considerably).


g4sra
 

On 26/04/14 21:30, CyclingSoldier wrote:
Just thinking, would running from a USB stick help with either the speed or card lifespan issues?
You could spread the writes across both the SD Card and the USB stick to
wear them both at a slower rate, but there are better ways.
A USB HDD connected via a powered hub works respectably with the Pi.

Re the speed, everything USB (& the ethernet) eventually goes through a
single USB port (the one on the SoC itself). Also USB can be a fairly
processor intensive protocol, don't expect anything amazing, be happy
with 'it-does-the-job'.


Jack Smith
 

I had thought about the HDD solution, especially as I have a couple of disused laptop sized ones running about.  Would there be any noticeable increase in map loading speeds?  If not, just the ability to have “more stuff” would be useful in itself.

 

73,

Jack KE4LWT

 

From: Raspberry_Pi_4-Ham_RADIO@... [mailto:Raspberry_Pi_4-Ham_RADIO@...] On Behalf Of g4sra
Sent: Saturday, April 26, 2014 5:50 PM
To: Raspberry_Pi_4-Ham_RADIO@...
Subject: Re: [Raspberry_Pi_4-Ham_RADIO] xastir autostart

 

 

On 26/04/14 21:30, CyclingSoldier wrote:
> Just thinking, would running from a USB stick help with either the speed or card lifespan issues?
You could spread the writes across both the SD Card and the USB stick to
wear them both at a slower rate, but there are better ways.
A USB HDD connected via a powered hub works respectably with the Pi.

Re the speed, everything USB (& the ethernet) eventually goes through a
single USB port (the one on the SoC itself). Also USB can be a fairly
processor intensive protocol, don't expect anything amazing, be happy
with 'it-does-the-job'.


ramsatphones@...
 

Hi 

The issue I have is that using the .config/autostart/xstir.desktop method xastir starts before startx has finished. So xastir is running but in the back ground. How can I delay the start up of xastir until after startx has finished? 

Not really worried about the life of the SD card a this stage. I will look at the HDD options once its auto starting as required.

regards

Woz


Basil Gunn
 

Posted by: "g4sra" g4sra
On 21/04/14 09:13, ramsatphones@... wrote:

What i am trying to achieve is that if the power goes out then comes
back on everything starts back up automatically. The only way you can
achieve that is to avoid file system corruption.
Either have the Pi shut down properly - buy an UPS, there is one
pecifically available for the PI but it may not be compatible with
other expansion boards.
Or have your SD Card file system mounted read-only with temporary
working storage in RAM (all my Pi's work this way, it increases SD Card
life considerably).
This is just a data point for what works for me, ymmv.

I run a UDR cpu card (similar to Pi) in my truck which gets its
power from a cigarette lighter, that is, the cpu card gets rudely shut
down on a regular basis. I have been running it like this for over a
year with no problems. This is a Debian Linux system that runs a
version of dantracker.

Below is the partition format line from my script that builds the root file
system on the flash part.
$flashdevice_part2 is a variable for the partition the udr56k uses, ie. /dev/sdb2

mkfs.ext4 -E stride=2,stripe-width=512 -b 4096 -L NWDR_Root_FS "$flashdevice_part2"

The point to note is the above line uses ext4 with journaling turned on.

Another point is that you need to use a "decent" flash part. Not some
flash knock-off that works in your camera so might work. The term
"decent" invokes about a 10 page discussion. I have NEVER had an SD
card fail due to excessive write cycles in the last 3 years for the
UDR boards.

/Basil n7nix


g4sra
 

On 27/04/14 11:29, ramsatphones@... wrote:
Hi

The issue I have is that using the .config/autostart/xstir.desktop method xastir starts before startx has finished. So xastir is running but in the back ground.
That should not happen until after the desktop has loaded, I will have
to investigate that myself it may be a bug (that needs reporting).

How can I delay the start up of xastir until after startx has finished?
A very quick bodge to get you by for now...

Create '/usr/local/bin/start_xastir.sh' with the contents

# wait 30 seconds
sleep 30
# now really start xastir
exec /bin/xastir

and make it executable 'chmod u+x /usr/local/bin/start_xastir.sh'

and launch that from xastir.desktop instead

Exec=/usr/local/bin/start_xastir.sh


Ray Wells
 

Being a shell script, you may need to have "#!/bin/bash" as the first line, making the script ....

#!/bin/bash
# wait 30 seconds
sleep 30
# now really start xastir
exec /bin/xastir

Ray vk2tv


On 28/04/14 05:12, g4sra wrote:
 

On 27/04/14 11:29, ramsatphones@... wrote:
> Hi
>
> The issue I have is that using the .config/autostart/xstir.desktop method xastir starts before startx has finished. So xastir is running but in the back ground.
That should not happen until after the desktop has loaded, I will have
to investigate that myself it may be a bug (that needs reporting).

> How can I delay the start up of xastir until after startx has finished?

A very quick bodge to get you by for now...

Create '/usr/local/bin/start_xastir.sh' with the contents

# wait 30 seconds
sleep 30
# now really start xastir
exec /bin/xastir

and make it executable 'chmod u+x /usr/local/bin/start_xastir.sh'

and launch that from xastir.desktop instead

Exec=/usr/local/bin/start_xastir.sh




g4sra
 

On 27/04/14 23:48, Ray Wells wrote:
Being a shell script, you may need to have "#!/bin/bash" as the first
line, making the script ....

#!/bin/bash
# wait 30 seconds
sleep 30
# now really start xastir
exec /bin/xastir

Ray vk2tv
And what happens then if he is running tsh or csh ;)

The shebang line is a good idea, and essential when the processing
application needs help. If it was a perl script for example then it
would be needed, without, the User's login shell should get used by
default (queryable from the environment).



On 28/04/14 05:12, g4sra wrote:

On 27/04/14 11:29, ramsatphones@... wrote:
Hi

The issue I have is that using the .config/autostart/xstir.desktop
method xastir starts before startx has finished. So xastir is running
but in the back ground.
That should not happen until after the desktop has loaded, I will have
to investigate that myself it may be a bug (that needs reporting).

How can I delay the start up of xastir until after startx has finished?
A very quick bodge to get you by for now...

Create '/usr/local/bin/start_xastir.sh' with the contents

# wait 30 seconds
sleep 30
# now really start xastir
exec /bin/xastir

and make it executable 'chmod u+x /usr/local/bin/start_xastir.sh'

and launch that from xastir.desktop instead

Exec=/usr/local/bin/start_xastir.sh


Ray Wells
 

On 28/04/14 21:38, g4sra wrote:
 

On 27/04/14 23:48, Ray Wells wrote:
> Being a shell script, you may need to have "#!/bin/bash" as the first
> line, making the script ....
>
> #!/bin/bash
> # wait 30 seconds
> sleep 30
> # now really start xastir
> exec /bin/xastir
>
> Ray vk2tv
And what happens then if he is running tsh or csh ;)

Thanks for your comments.

I did think about other shells when writing my suggestion but given that this is a RPi forum where the are many newcomers to Linux, and where the default shell is bash, I chose to not muddy the waters. Anyone who has enough knowledge of Linux to be changing the default shell will likely also have enough knowledge to make the appropriate correction to that line, just as we had to when dash replaced bash as the default shell in Debian at one stage, resulting in some scripts written for the less pedantic bash not running, or running with errors in dash.

Ray vk2tv


The shebang line is a good idea, and essential when the processing
application needs help. If it was a perl script for example then it
would be needed, without, the User's login shell should get used by
default (queryable from the environment).