From owner-freebsd-embedded@freebsd.org Fri Sep 27 16:22:10 2019 Return-Path: Delivered-To: freebsd-embedded@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id ABCBB12714E for ; Fri, 27 Sep 2019 16:22:10 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qk1-x72b.google.com (mail-qk1-x72b.google.com [IPv6:2607:f8b0:4864:20::72b]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46fxrx5hLfz41GD for ; Fri, 27 Sep 2019 16:22:09 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qk1-x72b.google.com with SMTP id f16so2413583qkl.9 for ; Fri, 27 Sep 2019 09:22:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=aCwBBw8NxBS71Nug3A8OG7LcHDH5yvrZ3UjsoeQkzx0=; b=NFjuf09wZoSEzwyp/ONIVrAdBvXjcv9OnbeZ1Dc82InGZFTn4WFAhx6NUtFKN1o57Q lalZnn7ycu7QU5m1FSM6E1YX5GOesYU7Ho9htmxJq+cT6c3XkrvwfVmeNx7h0VehTqUH EE3KIuh5/w7/OVFbcDszfexShVkP320lahLMSmwPMlX/WzC0jbSXp6gTYeDaTfO/sdIj 3nTUQEteYk2ERnbC6Ksr4jccv2uqlz3uel3TZTbvD12crNgXL2FT/TpmFAd2mQH7R2fE VYhL4/71xRuLc6gas1JQI9Rny4VAvCD3DdeVEmVQ0H9wYvEDe/syg+PcwJZ157bIQ3xG /KEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=aCwBBw8NxBS71Nug3A8OG7LcHDH5yvrZ3UjsoeQkzx0=; b=pviu9HqJOB+/cVF7nN+skiu6Rwi4h4O+OaZLNum0T8HHsFFw7PuVRGCbTM9A3pCimx e2FBwMdI/ga9om4/qV7TdPNm7BlHXdgHGr7dEQV8ib3SiUMtM1GFIevQ/qa4ASxHIwWE TUEG9a29fVhFuepUIoTPZhYXf3jRKfvyIe8nJ2Kfn8dqbXIPiKNQFp9Od7cCw+PgLzhR pruoiUrr5kx+yKRVZnpiHfhBMjOU4KlYO64Ia95Lc6Ddb4muHE+/crQDaiD+jiqdqjAc 6t5eSthCY3xo1SGKgLbhhs5QMLbK4WZp+aWc80sIkrH6DtDhvcRrTvvymTx0iQLgAC+E Pj+w== X-Gm-Message-State: APjAAAXJzn67/zxLqQjDuulPhWCx/rr6YMxy2f4p3aO/2LjZGi+qIWiv sybzAPTtZjIkFyGYZeizMu8M/jRARouLgnVBjfkByA== X-Google-Smtp-Source: APXvYqxpycbrhhLCRvVTJ0DVxU76eO0umKSIdwQi71CUk7Wj/lIJkweXDoMqcaSik/bao6MFxLxAA9MT8POGLPAMQUg= X-Received: by 2002:a37:7bc7:: with SMTP id w190mr5615625qkc.215.1569601326877; Fri, 27 Sep 2019 09:22:06 -0700 (PDT) MIME-Version: 1.0 References: <5eba25eb-9ba4-0c93-27c8-e834491298ad@sentex.net> In-Reply-To: <5eba25eb-9ba4-0c93-27c8-e834491298ad@sentex.net> From: Warner Losh Date: Fri, 27 Sep 2019 10:21:55 -0600 Message-ID: Subject: Re: watchdogd stat location To: mike tancsa Cc: freebsd-embedded X-Rspamd-Queue-Id: 46fxrx5hLfz41GD X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsdimp-com.20150623.gappssmtp.com header.s=20150623 header.b=NFjuf09w; dmarc=none; spf=none (mx1.freebsd.org: domain of wlosh@bsdimp.com has no SPF policy when checking 2607:f8b0:4864:20::72b) smtp.mailfrom=wlosh@bsdimp.com X-Spamd-Result: default: False [-4.85 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20150623.gappssmtp.com:s=20150623]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-embedded@freebsd.org]; DMARC_NA(0.00)[bsdimp.com]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20150623.gappssmtp.com:+]; RCPT_COUNT_TWO(0.00)[2]; RCVD_IN_DNSWL_NONE(0.00)[b.2.7.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; R_SPF_NA(0.00)[]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; MIME_TRACE(0.00)[0:+,1:+,2:~]; IP_SCORE(-2.85)[ip: (-9.45), ipnet: 2607:f8b0::/32(-2.59), asn: 15169(-2.17), country: US(-0.05)]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: freebsd-embedded@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Dedicated and Embedded Systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Sep 2019 16:22:10 -0000 On Fri, Sep 27, 2019 at 9:36 AM mike tancsa wrote: > We sometimes run into an issue where our embedded devices that boot off > a read only SD card, hang with a controller error. Its not clear if > this is a BIOS/firmware/SDCard or driver bug issue. Its pretty > infrequent, but annoying enough that I started to dig to see why the box > is not rebooting via the hardware watchdog. It seems to fail to reboot > the box as the stat that it does on the filesystem is off the md backed > /etc which is not impacted. I know I could run an external program, but > would it be safer to change the default directory where the stat is done > to something that is generally not mounted via ramdisk ? > > eg. > > > diff -u watchdogd.c.orig watchdogd.c > --- watchdogd.c.orig 2019-09-27 10:51:04.273113000 -0400 > +++ watchdogd.c 2019-09-27 10:51:23.592200000 -0400 > @@ -365,7 +365,7 @@ > if (test_cmd != NULL) > failed = system(test_cmd); > else > - failed = stat("/etc", &sb); > + failed = stat("/boot", &sb); > > error = watchdog_getuptime(&ts_end); > if (error) { > I think this is good. Warner