Send Motion-user mailing list submissions to
        motion-user@lists.sourceforge.net

To subscribe or unsubscribe via the World Wide Web, visit
        https://lists.sourceforge.net/lists/listinfo/motion-user
or, via email, send a message with subject or body 'help' to
        motion-user-requ...@lists.sourceforge.net

You can reach the person managing the list at
        motion-user-ow...@lists.sourceforge.net

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Motion-user digest..."


Today's Topics:

   1. Re: Motion crashing regularly (Barry Martin)
   2. Re: Motion crashing regularly (Ian Smith)


----------------------------------------------------------------------

Message: 1
Date: Mon, 23 Oct 2023 07:57:12 -0500
From: Barry Martin <barry3mar...@gmail.com>
To: motion-user@lists.sourceforge.net
Subject: Re: [Motion-user] Motion crashing regularly
Message-ID: <c7a891dd-07a8-4eb7-bdc2-6afd5aa30...@gmail.com>
Content-Type: text/plain; charset="utf-8"; Format="flowed"


On 10/23/23 04:42, Ian Smith wrote:
> On a regular basis, the software crashes. Ideally, I would like to 
> understand why, and eliminate the problem - if that isn't possible, I 
> would like it to automatically restart on crashing, but I don't know 
> how to do that, so any help would be appreciated.


Ian:


I also have crashes ? more of the random type than regular, but my 
sloppy-but-it-generally-works solution may be helpful. I am running 
Motion on Raspberry Pi?s with one USB camera each, so the commands 
should be similar as you are running Ubuntu.


cron:

# Check for loss of an error every 10 minutes

*/10 * * * * /usr/bin/sh /home/pi/Scripts/Timeout.sh



Some extracts from my Timeout file (bash script):


####


tail /var/log/syslog | grep "Timeout waiting for hardware interrupt"

if [ $? -eq 0 ]

then

echo "Oh bother said Pooh!"

sudo shutdown -r now

else

echo "Nothing to look at, keep moving...."

fi



####



###########


tail /var/log/user.log | grep "Watchdog timeout did NOT restart"

if [ $? -eq 0 ]

then

echo "Oh mannnnnn!"

sudo shutdown -r now

else

echo "No problem-o."

fi


###########



And kind of as a side note:

###########

# Recycle Motion when goes off-line

# NOTE: at home directory: sudo chown pi:pi Scripts


# sudo service motion status | grep Active > $HOME/Scripts/Motion_Status.txt

# sudo service motion status | grep Active > 
/home/pi/Scripts/Motion_Status.txt

sudo service motion status | grep Active > /mnt/ramdisk/Motion_Status.txt

# Without the grep need to <q>uit manually


# tail $HOME/Scripts/Motion_Status.txt | grep running

tail /mnt/ramdisk/Motion_Status.txt | grep running


if [ $? -eq 0 ]

then

echo "Motion is running."

else

echo "WHOA!! Motion has a problem!!"

sudo service motion stop

sleep 3

sudo service motion start


fi


###########


Couple of things with that snippet:

the use of grep to automatically quit the service inquiry


I sometimes found when using ?sudo service restart motion? it restarted 
too quickly. Using the stop, 3 second delay, and the the start worked 
better.


There are more options but I don?t think they?d appreciate me clogging 
the forum.


And yes, the echo?s are a little strange but come in handy for testing 
(manual run from Terminal).


HTH and Good Luck!

Barry


P.S.: I wrote this off-line and copied in but the script indentions are 
being retained.


-------------- next part --------------
An HTML attachment was scrubbed...

------------------------------

Message: 2
Date: Mon, 23 Oct 2023 14:51:36 +0100
From: Ian Smith <ian.smit...@gmail.com>
To: motion-user@lists.sourceforge.net
Subject: Re: [Motion-user] Motion crashing regularly
Message-ID: <33f2514b-e317-4c8e-9ff4-f5a8ec06d...@gmail.com>
Content-Type: text/plain; charset="utf-8"; Format="flowed"

Dear tosiara,



dmesg | grep motion:-

    [444459.258671] motion[80328]: segfault at 7f1e13fff9d0 ip
    00007f1e57b2cf3b sp 00007fff88205940 error 4 in
    libpthread-2.31.so[7f1e57b22000+11000]
    [705225.520491] motion[223917]: segfault at 7fccd67fc9d0 ip
    00007fcd69ac1f3b sp 00007ffda959e160 error 4 in
    libpthread-2.31.so[7fcd69ab7000+11000]
    [787983.562989] motion[399066]: segfault at 7f225f7fe9d0 ip
    00007f22fc75cf3b sp 00007ffd16f68620 error 4 in
    libpthread-2.31.so[7f22fc752000+11000]
    [1829792.299538] motion[419253]: segfault at 7f93f87f89d0 ip
    00007f94954f0f3b sp 00007ffdd009f0c0 error 4 in libpthread-2.31.so
    (deleted)[7f94954e6000+11000]
    [1910188.043222] motion[910831]: segfault at 7faecd7fa9d0 ip
    00007faee4f7bf3b sp 00007ffd23eb62c0 error 4 in
    libpthread-2.31.so[7faee4f71000+11000]
    [2005358.077095] motion[1038294]: segfault at 7fc1099ad9d0 ip
    00007fc186c8bf3b sp 00007ffec2b88fd0 error 4 in
    libpthread-2.31.so[7fc186c81000+11000]
    [2005716.005322] motion[1100332]: segfault at 7f53df7fe9d0 ip
    00007f54232e2f3b sp 00007ffdc3fcb330 error 4 in
    libpthread-2.31.so[7f54232d8000+11000]
    [2083358.109426] motion[1101810]: segfault at 7feef27f49d0 ip
    00007fefe609bf3b sp 00007ffd236b8c10 error 4 in
    libpthread-2.31.so[7fefe6091000+11000]
    [2168644.486393] motion[1220168]: segfault at 7f7647df89d0 ip
    00007f7714853f3b sp 00007ffc286fb3e0 error 4 in
    libpthread-2.31.so[7f7714849000+11000]
    [2176293.809908] motion[1227671]: segfault at 7fa0dd4ae9d0 ip
    00007fa1a9102f3b sp 00007ffe0ec18f90 error 4 in
    libpthread-2.31.so[7fa1a90f8000+11000]
    [2177775.294817] motion[1231112]: segfault at 7fa129ffb9d0 ip
    00007fa15d7b2f3b sp 00007fff16133020 error 4 in
    libpthread-2.31.so[7fa15d7a8000+11000]


Sadly, that left me none the wiser, but maybe someone might understand.


Along a similar vein, the following seemed to crop up a few times:-

    Oct 23 10:38:35 [NAME] kernel: [2177775.294817] motion[1231112]:
    segfault at 7fa129ffb9d0 ip 00007fa15d7b2f3b sp 00007fff16133020
    error 4 in libpthread-2.31.so[7fa15d7a8000+11000]



(Many thanks also to Barry - I will look into your suggestions - which I 
did like - especially the Winnie The Pooh theme - just my style!).

Kind Regards,


On 23/10/2023 12:57, tosiara wrote:
> Also check syslog and dmesg - there may be hardware related errors
>
> On Mon, Oct 23, 2023 at 12:44?PM Ian Smith<ian.smit...@gmail.com>  wrote:
>>
>>
>> Once more, I suspect the issue I am facing is by my doing something wrong, 
>> but any assistance would be appreciated.
>>
>> I run Motion on Ubuntu 20.04, with multiple cameras, of which one is a USB 
>> camera (which may not be relevant).
>>
>> I run logging - at level 9 (all).
>>
>> On a regular basis, the software crashes. Ideally, I would like to 
>> understand why, and eliminate the problem - if that isn't possible, I would 
>> like it to automatically restart on crashing, but I don't know how to do 
>> that, so any help would be appreciated.
>>
>> The log provides the following as an example - in the seconds leading up to 
>> the crash:-
>>
>> [0:motion] [ERR] [ALL] [Oct 23 10:13:39] motion_watchdog: Thread 7 - 
>> Watchdog timeout. Trying to do a graceful restart
>> [0:motion] [ERR] [ALL] [Oct 23 10:13:49] motion_watchdog: Thread 7 - 
>> Watchdog timeout did NOT restart, killing it!
>> [5:ml5:CAMLOC] [NTC] [ALL] [Oct 23 10:13:49] mlp_actions: End of event 18
>> [5:ml5:CAMLOC] [INF] [EVT] [Oct 23 10:13:50] event_new_video: Source FPS 15
>> [5:ml5:CAMLOC] [INF] [ENC] [Oct 23 10:13:50] ffmpeg_set_quality: libx264 
>> codec vbr/crf/bit_rate: 28
>> [5:ml5:CAMLOC] [NTC] [EVT] [Oct 23 10:13:50] event_newfile: File of type 8 
>> saved to: [VIDEO].mkv
>> [5:ml5:CAMLOC] [NTC] [ALL] [Oct 23 10:13:50] motion_detected: Motion 
>> detected - starting event 19
>> [5:ml5:CAMLOC] [NTC] [ALL] [Oct 23 10:13:54] mlp_actions: End of event 19
>>
>>
>>
>> Any guidance would be most appreciated.
>>
>> Many thanks,
>> _______________________________________________
>> Motion-user mailing list
>> Motion-user@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/motion-user
>> https://motion-project.github.io/
>>
>> Unsubscribe:https://lists.sourceforge.net/lists/options/motion-user
>
> _______________________________________________
> Motion-user mailing list
> Motion-user@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/motion-user
> https://motion-project.github.io/
>
> Unsubscribe:https://lists.sourceforge.net/lists/options/motion-user
-------------- next part --------------
An HTML attachment was scrubbed...

------------------------------



------------------------------

Subject: Digest Footer

_______________________________________________
Motion-user mailing list
Motion-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/motion-user


------------------------------

End of Motion-user Digest, Vol 206, Issue 2
*******************************************

Reply via email to