Config keeps changing on boot

In the time I've been playing with openwrt, once you write something in /etc, it usually remains and survives rebooting.

In this case, on chaos calmer 2.264 (gl inet) the /etc/config/mjpg-streamer config file keeps changing from
option enabled '1'
to
option enabled 'o'

on each reboot. I built the firmware using the files/ method with the config file built in with a 1 so, what is going on?

Edit: Explanation -- get the modification date and time and the contents from the running system, ROM, and the overlay file system so that you can look at it before and after restarts or other changes.

for where in / /rom/ /overlay/upper/
do
  ls -l ${where}etc/config/mjpg-streamer
  cat ${where}etc/config/mjpg-streamer
  echo =====
done

I know you had a terrible time with mjpg-streamer, but you really should do what it takes to get onto a maintained version of OpenWrt.

Which device are you running?

Gl-inet mt300n v1 router.

The old mjpg-streamer is now working fine on my old openwrt devices. The only problem is that something keeps resetting etc/config/mjpg-streamer to something other than I last left it at.

After rebooting, I re-edited the file to be 1 then ran your code.

-rw-r--r--    1 root     root           323 Sep 16 03:26 /etc/config/mjpg-streamer

config mjpg-streamer 'core'
        option enabled '1'
        option input 'uvc'
        option output 'http'
        option device '/dev/video0'
        option resolution '1280x720'
        option yuv '0'
        option quality '80'
        option fps '20'
        option led 'auto'
        option www '/www/webcam'
        option port '8080'
        option username 'openwrt'
        option password 'openwrt'
=====
-rw-r--r--    1 root     root           415 Sep  3 19:16 /rom/etc/config/mjpg-streamer

config mjpg-streamer 'core'
        option enabled '1'
        option input 'uvc'
        option output 'http'
        option device '/dev/video0'
        option resolution '1024x768'
        option yuv '0'
        option quality '80'
        option fps '15'
        option led 'auto'
        option www '/www/webcam'
        option port '8080'
        option username 'openwrt'
        option password 'openwrt'

=====
-rw-r--r--    1 root     root           323 Sep 16 03:26 /overlay/upper/etc/config/mjpg-streamer

config mjpg-streamer 'core'
        option enabled '1'
        option input 'uvc'
        option output 'http'
        option device '/dev/video0'
        option resolution '1280x720'
        option yuv '0'
        option quality '80'
        option fps '20'
        option led 'auto'
        option www '/www/webcam'
        option port '8080'
        option username 'openwrt'
        option password 'openwrt'
=====

After rebooting, I ran your code again;

-rw-r--r--    1 root     root           323 Sep 16 03:26 /etc/config/mjpg-streamer

config mjpg-streamer 'core'
        option enabled '1'
        option input 'uvc'
        option output 'http'
        option device '/dev/video0'
        option resolution '1280x720'
        option yuv '0'
        option quality '80'
        option fps '20'
        option led 'auto'
        option www '/www/webcam'
        option port '8080'
        option username 'openwrt'
        option password 'openwrt'
=====
-rw-r--r--    1 root     root           415 Sep  3 19:16 /rom/etc/config/mjpg-streamer

config mjpg-streamer 'core'
        option enabled '1'
        option input 'uvc'
        option output 'http'
        option device '/dev/video0'
        option resolution '1024x768'
        option yuv '0'
        option quality '80'
        option fps '15'
        option led 'auto'
        option www '/www/webcam'
        option port '8080'
        option username 'openwrt'
        option password 'openwrt'

=====
-rw-r--r--    1 root     root           323 Sep 16 03:26 /overlay/upper/etc/config/mjpg-streamer

config mjpg-streamer 'core'
        option enabled '1'
        option input 'uvc'
        option output 'http'
        option device '/dev/video0'
        option resolution '1280x720'
        option yuv '0'
        option quality '80'
        option fps '20'
        option led 'auto'
        option www '/www/webcam'
        option port '8080'
        option username 'openwrt'
        option password 'openwrt'
=====

I then ran cat and see it is back to 0 but the rest of the settings remain as they were.

cat /etc/config/mjpg-streamer

config mjpg-streamer 'core'
        option enabled '0'
        option input 'uvc'
        option output 'http'
        option device '/dev/video0'
        option resolution '1280x720'
        option yuv '0'
        option quality '80'
        option fps '20'
        option led 'auto'
        option www '/www/webcam'
        option port '8080'
        option username 'openwrt'
        option password 'openwrt'

Interesting, I ran your code again this morning and now it shows 0 in the last entry. The device has not rebooted since I was ssh'd in and still am this morning.

-rw-r--r--    1 root     root           323 Sep 16 03:29 /etc/config/mjpg-streamer

config mjpg-streamer 'core'
        option enabled '0'
        option input 'uvc'
        option output 'http'
        option device '/dev/video0'
        option resolution '1280x720'
        option yuv '0'
        option quality '80'
        option fps '20'
        option led 'auto'
        option www '/www/webcam'
        option port '8080'
        option username 'openwrt'
        option password 'openwrt'
=====
-rw-r--r--    1 root     root           415 Sep  3 19:16 /rom/etc/config/mjpg-streamer

config mjpg-streamer 'core'
        option enabled '1'
        option input 'uvc'
        option output 'http'
        option device '/dev/video0'
        option resolution '1024x768'
        option yuv '0'
        option quality '80'
        option fps '15'
        option led 'auto'
        option www '/www/webcam'
        option port '8080'
        option username 'openwrt'
        option password 'openwrt'

=====
-rw-r--r--    1 root     root           323 Sep 16 03:29 /overlay/upper/etc/config/mjpg-streamer

config mjpg-streamer 'core'
        option enabled '0'
        option input 'uvc'
        option output 'http'
        option device '/dev/video0'
        option resolution '1280x720'
        option yuv '0'
        option quality '80'
        option fps '20'
        option led 'auto'
        option www '/www/webcam'
        option port '8080'
        option username 'openwrt'
        option password 'openwrt'

Any thoughts? Anyone?

Some cron job during night ?

So that eliminates reboot being the cause

Shows that something or someone changed the config to disable mjpeg-streamer at least once at or before 03:29 on the 16th.

That the previous modification time is 03:26 on the 16th is "curious" -- as if something in the first couple minutes of run changes the config.

That's interesting. There are no cron jobs, there is no one else using the device, no script doing anything that could do this. I've rebuilt the device several times thinking I've done something wrong but each time, the same results.

usb hotplug, camera detection.

If it isn't immediately obvious, I'd dig through the scripts in /lib/ and /etc/ with something like fgrep -rI enabled and fgrep -rI mjpg-streamer (-r recursive, -I no "binary" files).

Edit: Now that you know it isn't "changing on boot" (which is a "well known" problem with, for example low-flash devices), it might help to make the thread title more descriptive of your specific problem..

1 Like

I was wrong. I had put something in the rc.local to make the option 0 on boot while testing and totally forgot that. Since you guys mentioned scripts, it got me thinking about all of the testing I had been through about a month or two ago and just this morning remembered that.

Thank you very much for your help on this as it gave me the lead I needed.

3 Likes