Re: rc script: manual stop vs system shutdown

2019-08-01 Thread Enji Cooper

> On Aug 1, 2019, at 11:07, Andriy Gapon  wrote:
> 
>> On 01/08/2019 20:30, Enji Cooper wrote:
>> On Aug 1, 2019, at 08:53, Rodney W. Grimes  
>> wrote:
>> 
 
 Is it possible in an rc script to distinguish between a manual stop
 (e.g., service foo stop) and a stop during a system shutdown (via
 rc.shutdown) ?
 Are there any marker variables for that?
 Or something in the global system state?
>>> 
>>> Not that I can think of, but I like this idea,
>>> I am sure that use cases exist.
>> 
>> Have you looked at:
>> keyword: shutdown
>> etc?
> 
> AFAIK, that keyword only controls whether 'foo stop' is called during
> shutdown or not.

This is correct.

The other implemented keyword is ‘nostart’ (iirc). The two in tandem would 
likely fit your need, minus someone manually starting a script.

-Enji
___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: drm-legacy is broken, again

2019-08-01 Thread Niclas Zeising

On 2019-08-01 21:42, Steve Kargl wrote:

On Thu, Aug 01, 2019 at 03:31:15PM -0400, Mark Johnston wrote:

On Thu, Aug 01, 2019 at 12:30:24PM -0700, Steve Kargl wrote:

On Thu, Aug 01, 2019 at 03:22:27PM -0400, Mark Johnston wrote:

On Thu, Aug 01, 2019 at 12:10:09PM -0700, Steve Kargl wrote:

Just updated /usr/src to top of tree.

Trying to update drm-legacy port.  After
a failed 'make' in /usr/ports/drm-legacy


The patch below should fix it.  drm was relying on refcount.h including
limits.h.

diff --git a/src/dev/drm2/drmP.h b/src/dev/drm2/drmP.h
index 3af7ad1..7cbd8db 100644
--- a/src/dev/drm2/drmP.h
+++ b/src/dev/drm2/drmP.h
@@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$");
  
  #include 

  #include 
+#include 
  #include 
  #include 
  #include 


Thanks for the quick response.  I had recalled someone
has/had been undoing some header pollution changes,
but the individual names escaped me.


I reproduced the issue and submitted a PR:
https://github.com/FreeBSDDesktop/drm-legacy/pull/13



Thanks for that, too.  I'm not in a position to
submit a PR as my mouse has gone missing under
Xorg.



Port has been updated:
https://svnweb.freebsd.org/changeset/ports/507828
Regards
--
Niclas Zeising
___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: rc script: manual stop vs system shutdown

2019-08-01 Thread Ian Lepore
On Thu, 2019-08-01 at 21:14 +0300, Andriy Gapon wrote:
> On 01/08/2019 19:12, Warner Losh wrote:
> > 
> > 
> > On Thu, Aug 1, 2019, 10:53 AM Rodney W. Grimes
> > mailto:freebsd-...@gndrsh.dnsmgr.net>>
> > wrote:
> > 
> > >
> > > Is it possible in an rc script to distinguish between a manual stop
> > > (e.g., service foo stop) and a stop during a system shutdown (via
> > > rc.shutdown) ?
> > > Are there any marker variables for that?
> > > Or something in the global system state?
> > 
> > Not that I can think of, but I like this idea,
> > I am sure that use cases exist.
> > 
> > 
> > What is the use case that needs to disambiguate the two cases...
> 
> I have one use case in mind and it's a truly special case.
> I want rc.d/watchdogd to gracefully stop watchdogd and to disable the
> watchdog timer when the stop action is requested manually.  And I want
> it to stop watchdogd and set the watchdog timer to a special shutdown
> timeout during the shutdown.  If the special timeout is configured, of
> course.
> 

The shutdown timeout is already supported:  you just set '-x '
in watchdogd_flags in rc.conf; no changes to the rc.d script needed.

I think probably you don't even need the first part of what you want. 
The -x arg covers you in the reboot case; most people probably won't
use it.  But if you are using it, and you want to truly kill the dog,
you would just do "watchdog -t 0" after "service watchdogd stop".  If
you really felt the need to cover that with a single service command,
then how about using "service watchdogd cancel" where the cancel verb
does the -t 0 after killing the daemon?

-- Ian


___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: drm-legacy is broken, again

2019-08-01 Thread Steve Kargl
On Thu, Aug 01, 2019 at 03:31:15PM -0400, Mark Johnston wrote:
> On Thu, Aug 01, 2019 at 12:30:24PM -0700, Steve Kargl wrote:
> > On Thu, Aug 01, 2019 at 03:22:27PM -0400, Mark Johnston wrote:
> > > On Thu, Aug 01, 2019 at 12:10:09PM -0700, Steve Kargl wrote:
> > > > Just updated /usr/src to top of tree.
> > > > 
> > > > Trying to update drm-legacy port.  After
> > > > a failed 'make' in /usr/ports/drm-legacy
> > > 
> > > The patch below should fix it.  drm was relying on refcount.h including
> > > limits.h.
> > > 
> > > diff --git a/src/dev/drm2/drmP.h b/src/dev/drm2/drmP.h
> > > index 3af7ad1..7cbd8db 100644
> > > --- a/src/dev/drm2/drmP.h
> > > +++ b/src/dev/drm2/drmP.h
> > > @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$");
> > >  
> > >  #include 
> > >  #include 
> > > +#include 
> > >  #include 
> > >  #include 
> > >  #include 
> > 
> > Thanks for the quick response.  I had recalled someone
> > has/had been undoing some header pollution changes,
> > but the individual names escaped me.  
> 
> I reproduced the issue and submitted a PR:
> https://github.com/FreeBSDDesktop/drm-legacy/pull/13


Thanks for that, too.  I'm not in a position to
submit a PR as my mouse has gone missing under 
Xorg.

-- 
Steve
___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: rc script: manual stop vs system shutdown

2019-08-01 Thread Andriy Gapon
On 01/08/2019 21:53, Freddie Cash wrote:
> On Thu, Aug 1, 2019, 11:15 AM Andriy Gapon,  > wrote:
> 
> On 01/08/2019 19:12, Warner Losh wrote:
> >
> >
> > On Thu, Aug 1, 2019, 10:53 AM Rodney W. Grimes
> >  
>  >>
> > wrote:
> >
> >     >
> >     > Is it possible in an rc script to distinguish between a
> manual stop
> >     > (e.g., service foo stop) and a stop during a system shutdown
> (via
> >     > rc.shutdown) ?
> >     > Are there any marker variables for that?
> >     > Or something in the global system state?
> >
> >     Not that I can think of, but I like this idea,
> >     I am sure that use cases exist.
> >
> >
> > What is the use case that needs to disambiguate the two cases...
> 
> I have one use case in mind and it's a truly special case.
> I want rc.d/watchdogd to gracefully stop watchdogd and to disable the
> watchdog timer when the stop action is requested manually.  And I want
> it to stop watchdogd and set the watchdog timer to a special shutdown
> timeout during the shutdown.  If the special timeout is configured, of
> course.
> 
> 
> A horribly hackish workaround could be to do a "pgrep shutdown" and
> "pgrep reboot" and "pgrep halt" in the stop function of the RC script.
> If one of those those processes exist, then a system shutdown/reboot is
> in progress.
> 
> Not elegant, but could be workable until something nicer is added.

I think that shutdown by default sends a signal to init and exits.
It's init that kicks off rc.shutdown.


-- 
Andriy Gapon
___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: drm-legacy is broken, again

2019-08-01 Thread Mark Johnston
On Thu, Aug 01, 2019 at 12:30:24PM -0700, Steve Kargl wrote:
> On Thu, Aug 01, 2019 at 03:22:27PM -0400, Mark Johnston wrote:
> > On Thu, Aug 01, 2019 at 12:10:09PM -0700, Steve Kargl wrote:
> > > Just updated /usr/src to top of tree.
> > > 
> > > Trying to update drm-legacy port.  After
> > > a failed 'make' in /usr/ports/drm-legacy
> > 
> > The patch below should fix it.  drm was relying on refcount.h including
> > limits.h.
> > 
> > diff --git a/src/dev/drm2/drmP.h b/src/dev/drm2/drmP.h
> > index 3af7ad1..7cbd8db 100644
> > --- a/src/dev/drm2/drmP.h
> > +++ b/src/dev/drm2/drmP.h
> > @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$");
> >  
> >  #include 
> >  #include 
> > +#include 
> >  #include 
> >  #include 
> >  #include 
> 
> Thanks for the quick response.  I had recalled someone
> has/had been undoing some header pollution changes,
> but the individual names escaped me.  

I reproduced the issue and submitted a PR:
https://github.com/FreeBSDDesktop/drm-legacy/pull/13
___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: drm-legacy is broken, again

2019-08-01 Thread Steve Kargl
On Thu, Aug 01, 2019 at 03:22:27PM -0400, Mark Johnston wrote:
> On Thu, Aug 01, 2019 at 12:10:09PM -0700, Steve Kargl wrote:
> > Just updated /usr/src to top of tree.
> > 
> > Trying to update drm-legacy port.  After
> > a failed 'make' in /usr/ports/drm-legacy
> 
> The patch below should fix it.  drm was relying on refcount.h including
> limits.h.
> 
> diff --git a/src/dev/drm2/drmP.h b/src/dev/drm2/drmP.h
> index 3af7ad1..7cbd8db 100644
> --- a/src/dev/drm2/drmP.h
> +++ b/src/dev/drm2/drmP.h
> @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$");
>  
>  #include 
>  #include 
> +#include 
>  #include 
>  #include 
>  #include 

Thanks for the quick response.  I had recalled someone
has/had been undoing some header pollution changes,
but the individual names escaped me.  

-- 
Steve
___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: drm-legacy is broken, again

2019-08-01 Thread Mark Johnston
On Thu, Aug 01, 2019 at 12:10:09PM -0700, Steve Kargl wrote:
> Just updated /usr/src to top of tree.
> 
> Trying to update drm-legacy port.  After
> a failed 'make' in /usr/ports/drm-legacy

The patch below should fix it.  drm was relying on refcount.h including
limits.h.

diff --git a/src/dev/drm2/drmP.h b/src/dev/drm2/drmP.h
index 3af7ad1..7cbd8db 100644
--- a/src/dev/drm2/drmP.h
+++ b/src/dev/drm2/drmP.h
@@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$");
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


drm-legacy is broken, again

2019-08-01 Thread Steve Kargl
Just updated /usr/src to top of tree.

Trying to update drm-legacy port.  After
a failed 'make' in /usr/ports/drm-legacy

% make |& tee drm.txt
% tail drm.txt

===> drm2/drm2 (all)
Warning: Object directory not changed from original 
/usr/ports/graphics/drm-legacy-kmod/work/drm-legacy-990f64b/drm2/drm2
cc  -O2 -pipe -march=bdver2 -fno-strict-aliasing -march=bdver2  -Werror 
-D_KERNEL -DKLD_MODULE -nostdinc  
-I/usr/ports/graphics/drm-legacy-kmod/work/drm-legacy-990f64b/drm2/../src/ -I. 
-I/usr/src/sys -I/usr/src/sys/contrib/ck/include -fno-common  
-fno-omit-frame-pointer -mno-omit-leaf-frame-pointer 
-fdebug-prefix-map=./machine=/usr/src/sys/amd64/include 
-fdebug-prefix-map=./x86=/usr/src/sys/x86/include -MD  
-MF.depend.drm_crtc.o -MTdrm_crtc.o -mcmodel=kernel -mno-red-zone -mno-mmx 
-mno-sse -msoft-float  -fno-asynchronous-unwind-tables -ffreestanding -fwrapv 
-fstack-protector -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes 
-Wmissing-prototypes -Wpointer-arith -Wcast-qual -Wundef -Wno-pointer-sign 
-D__printf__=__freebsd_kprintf__ -Wmissing-include-dirs 
-fdiagnostics-show-option -Wno-unknown-pragmas -Wno-error-tautological-compare 
-Wno-error-empty-body -Wno-error-parentheses-equality 
-Wno-error-unused-function -Wno-error-pointer-sign 
-Wno-error-shift-negative-value -Wno
 -address-of-packed-member  -mno-aes -mno-avx  -std=iso9899:1999 -c 
/usr/ports/graphics/drm-legacy-kmod/work/drm-legacy-990f64b/src/dev/drm2/drm_crtc.c
 -o drm_crtc.o
/usr/ports/graphics/drm-legacy-kmod/work/drm-legacy-990f64b/src/dev/drm2/drm_crtc.c:1128:21:
 error: use of undeclared identifier 'USHRT_MAX'
if (in->hdisplay > USHRT_MAX || in->hsync_start > USHRT_MAX ||
   ^
/usr/ports/graphics/drm-legacy-kmod/work/drm-legacy-990f64b/src/dev/drm2/drm_crtc.c:1128:52:
 error: use of undeclared identifier 'USHRT_MAX'
if (in->hdisplay > USHRT_MAX || in->hsync_start > USHRT_MAX ||
  ^
/usr/ports/graphics/drm-legacy-kmod/work/drm-legacy-990f64b/src/dev/drm2/drm_crtc.c:1129:23:
 error: use of undeclared identifier 'USHRT_MAX'
 in->hsync_end > USHRT_MAX || in->htotal > USHRT_MAX ||
 ^
/usr/ports/graphics/drm-legacy-kmod/work/drm-legacy-990f64b/src/dev/drm2/drm_crtc.c:1129:49:
 error: use of undeclared identifier 'USHRT_MAX'
 in->hsync_end > USHRT_MAX || in->htotal > USHRT_MAX ||
   ^
/usr/ports/graphics/drm-legacy-kmod/work/drm-legacy-990f64b/src/dev/drm2/drm_crtc.c:1130:19:
 error: use of undeclared identifier 'USHRT_MAX'
 in->hskew > USHRT_MAX || in->vdisplay > USHRT_MAX ||
 ^
/usr/ports/graphics/drm-legacy-kmod/work/drm-legacy-990f64b/src/dev/drm2/drm_crtc.c:1130:47:
 error: use of undeclared identifier 'USHRT_MAX'
 in->hskew > USHRT_MAX || in->vdisplay > USHRT_MAX ||
 ^
/usr/ports/graphics/drm-legacy-kmod/work/drm-legacy-990f64b/src/dev/drm2/drm_crtc.c:1131:25:
 error: use of undeclared identifier 'USHRT_MAX'
 in->vsync_start > USHRT_MAX || in->vsync_end > USHRT_MAX ||
   ^
/usr/ports/graphics/drm-legacy-kmod/work/drm-legacy-990f64b/src/dev/drm2/drm_crtc.c:1131:54:
 error: use of undeclared identifier 'USHRT_MAX'
 in->vsync_start > USHRT_MAX || in->vsync_end > USHRT_MAX ||
^
/usr/ports/graphics/drm-legacy-kmod/work/drm-legacy-990f64b/src/dev/drm2/drm_crtc.c:1132:20:
 error: use of undeclared identifier 'USHRT_MAX'
 in->vtotal > USHRT_MAX || in->vscan > USHRT_MAX)
  ^
/usr/ports/graphics/drm-legacy-kmod/work/drm-legacy-990f64b/src/dev/drm2/drm_crtc.c:1132:45:
 error: use of undeclared identifier 'USHRT_MAX'
 in->vtotal > USHRT_MAX || in->vscan > USHRT_MAX)
   ^
/usr/ports/graphics/drm-legacy-kmod/work/drm-legacy-990f64b/src/dev/drm2/drm_crtc.c:1170:18:
 error: use of undeclared identifier 'INT_MAX'
if (in->clock > INT_MAX || in->vrefresh > INT_MAX)
^
/usr/ports/graphics/drm-legacy-kmod/work/drm-legacy-990f64b/src/dev/drm2/drm_crtc.c:1170:44:
 error: use of undeclared identifier 'INT_MAX'
if (in->clock > INT_MAX || in->vrefresh > INT_MAX)
  ^
/usr/ports/graphics/drm-legacy-kmod/work/drm-legacy-990f64b/src/dev/drm2/drm_crtc.c:1840:26:
 error: use of undeclared identifier 'INT_MAX'
if (plane_req->crtc_w > INT_MAX ||
^
/usr/ports/graphics/drm-legacy-kmod/work/drm-legacy-990f64b/src/dev/drm2/drm_crtc.c:1841:26:
 error: use of undeclared identifier 'INT_MAX'
plane_req->crtc_x > INT_MAX - (int32_t) plane_req->crtc_w ||
^

Re: rc script: manual stop vs system shutdown

2019-08-01 Thread Freddie Cash
On Thu, Aug 1, 2019, 11:15 AM Andriy Gapon,  wrote:

> On 01/08/2019 19:12, Warner Losh wrote:
> >
> >
> > On Thu, Aug 1, 2019, 10:53 AM Rodney W. Grimes
> > mailto:freebsd-...@gndrsh.dnsmgr.net>>
> > wrote:
> >
> > >
> > > Is it possible in an rc script to distinguish between a manual stop
> > > (e.g., service foo stop) and a stop during a system shutdown (via
> > > rc.shutdown) ?
> > > Are there any marker variables for that?
> > > Or something in the global system state?
> >
> > Not that I can think of, but I like this idea,
> > I am sure that use cases exist.
> >
> >
> > What is the use case that needs to disambiguate the two cases...
>
> I have one use case in mind and it's a truly special case.
> I want rc.d/watchdogd to gracefully stop watchdogd and to disable the
> watchdog timer when the stop action is requested manually.  And I want
> it to stop watchdogd and set the watchdog timer to a special shutdown
> timeout during the shutdown.  If the special timeout is configured, of
> course.
>

A horribly hackish workaround could be to do a "pgrep shutdown" and "pgrep
reboot" and "pgrep halt" in the stop function of the RC script. If one of
those those processes exist, then a system shutdown/reboot is in progress.

Not elegant, but could be workable until something nicer is added.

Cheers,
Freddie

Typos courtesy of my phone's keyboard.

>
___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: rc script: manual stop vs system shutdown

2019-08-01 Thread Andriy Gapon
On 01/08/2019 19:12, Warner Losh wrote:
> 
> 
> On Thu, Aug 1, 2019, 10:53 AM Rodney W. Grimes
> mailto:freebsd-...@gndrsh.dnsmgr.net>>
> wrote:
> 
> >
> > Is it possible in an rc script to distinguish between a manual stop
> > (e.g., service foo stop) and a stop during a system shutdown (via
> > rc.shutdown) ?
> > Are there any marker variables for that?
> > Or something in the global system state?
> 
> Not that I can think of, but I like this idea,
> I am sure that use cases exist.
> 
> 
> What is the use case that needs to disambiguate the two cases...

I have one use case in mind and it's a truly special case.
I want rc.d/watchdogd to gracefully stop watchdogd and to disable the
watchdog timer when the stop action is requested manually.  And I want
it to stop watchdogd and set the watchdog timer to a special shutdown
timeout during the shutdown.  If the special timeout is configured, of
course.

-- 
Andriy Gapon
___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: rc script: manual stop vs system shutdown

2019-08-01 Thread Andriy Gapon
On 01/08/2019 20:39, Rodney W. Grimes wrote:
>> On Aug 1, 2019, at 08:53, Rodney W. Grimes  
>> wrote:
>>

 Is it possible in an rc script to distinguish between a manual stop
 (e.g., service foo stop) and a stop during a system shutdown (via
 rc.shutdown) ?
 Are there any marker variables for that?
 Or something in the global system state?
>>>
>>> Not that I can think of, but I like this idea,
>>> I am sure that use cases exist.
>>
>> Have you looked at:
>> keyword: shutdown
>> etc?
> 
> Well that does indeed seem to wipe out my
> "Not that I can think of".  So infact an rc script
> can tell, it is invoked as:
> 
> /etc/rc.d/foo shutdown
> during a system shutdown
> 
> vs
> 
> /etc/rc.d/foo stop
> when invoked by service foo stop?
> 
> Is that correct?
> 

Except there is no 'foo shutdown'.  It's foo stop in both cases.
To be pedantic, it's foo faststop for shutdown, but that can be manually
invoked as well.

-- 
Andriy Gapon
___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: rc script: manual stop vs system shutdown

2019-08-01 Thread Andriy Gapon
On 01/08/2019 20:30, Enji Cooper wrote:
> On Aug 1, 2019, at 08:53, Rodney W. Grimes  
> wrote:
> 
>>>
>>> Is it possible in an rc script to distinguish between a manual stop
>>> (e.g., service foo stop) and a stop during a system shutdown (via
>>> rc.shutdown) ?
>>> Are there any marker variables for that?
>>> Or something in the global system state?
>>
>> Not that I can think of, but I like this idea,
>> I am sure that use cases exist.
> 
> Have you looked at:
> keyword: shutdown
> etc?

AFAIK, that keyword only controls whether 'foo stop' is called during
shutdown or not.


-- 
Andriy Gapon
___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: rc script: manual stop vs system shutdown

2019-08-01 Thread Andriy Gapon
On 01/08/2019 20:30, Enji Cooper wrote:
> On Aug 1, 2019, at 08:53, Rodney W. Grimes  
> wrote:
> 
>>>
>>> Is it possible in an rc script to distinguish between a manual stop
>>> (e.g., service foo stop) and a stop during a system shutdown (via
>>> rc.shutdown) ?
>>> Are there any marker variables for that?
>>> Or something in the global system state?
>>
>> Not that I can think of, but I like this idea,
>> I am sure that use cases exist.
> 
> Have you looked at:
> keyword: shutdown
> etc?

AFAIK, that keyword only controls whether 'foo stop' is called during
shutdown or not.


-- 
Andriy Gapon
___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: rc script: manual stop vs system shutdown

2019-08-01 Thread Rodney W. Grimes
> On Aug 1, 2019, at 08:53, Rodney W. Grimes  
> wrote:
> 
> >> 
> >> Is it possible in an rc script to distinguish between a manual stop
> >> (e.g., service foo stop) and a stop during a system shutdown (via
> >> rc.shutdown) ?
> >> Are there any marker variables for that?
> >> Or something in the global system state?
> > 
> > Not that I can think of, but I like this idea,
> > I am sure that use cases exist.
> 
> Have you looked at:
> keyword: shutdown
> etc?

Well that does indeed seem to wipe out my
"Not that I can think of".  So infact an rc script
can tell, it is invoked as:

/etc/rc.d/foo shutdown
during a system shutdown

vs

/etc/rc.d/foo stop
when invoked by service foo stop?

Is that correct?

-- 
Rod Grimes rgri...@freebsd.org
___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: rc script: manual stop vs system shutdown

2019-08-01 Thread Enji Cooper
On Aug 1, 2019, at 08:53, Rodney W. Grimes  
wrote:

>> 
>> Is it possible in an rc script to distinguish between a manual stop
>> (e.g., service foo stop) and a stop during a system shutdown (via
>> rc.shutdown) ?
>> Are there any marker variables for that?
>> Or something in the global system state?
> 
> Not that I can think of, but I like this idea,
> I am sure that use cases exist.

Have you looked at:
keyword: shutdown
etc?

>> Andriy Gapon
> -- 
> Rod Grimes rgri...@freebsd.org
> ___
> freebsd-current@freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/freebsd-current
> To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"
___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: rc script: manual stop vs system shutdown

2019-08-01 Thread Warner Losh
On Thu, Aug 1, 2019, 10:53 AM Rodney W. Grimes <
freebsd-...@gndrsh.dnsmgr.net> wrote:

> >
> > Is it possible in an rc script to distinguish between a manual stop
> > (e.g., service foo stop) and a stop during a system shutdown (via
> > rc.shutdown) ?
> > Are there any marker variables for that?
> > Or something in the global system state?
>
> Not that I can think of, but I like this idea,
> I am sure that use cases exist.
>

What is the use case that needs to disambiguate the two cases...

Warner

> Andriy Gapon
> --
> Rod Grimes
> rgri...@freebsd.org
> ___
> freebsd...@freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/freebsd-rc
> To unsubscribe, send any mail to "freebsd-rc-unsubscr...@freebsd.org"
>
___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: rc script: manual stop vs system shutdown

2019-08-01 Thread Rodney W. Grimes
> 
> Is it possible in an rc script to distinguish between a manual stop
> (e.g., service foo stop) and a stop during a system shutdown (via
> rc.shutdown) ?
> Are there any marker variables for that?
> Or something in the global system state?

Not that I can think of, but I like this idea,
I am sure that use cases exist.

> Andriy Gapon
-- 
Rod Grimes rgri...@freebsd.org
___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: Boot still broken from r349133-r349160 - Was re:(Problem with USB after r349133)

2019-08-01 Thread Scott Long
I’m 99% sure that the boot breakage is due to this commit:

Author: jkim
Date: Tue Jul  9 18:02:36 2019
New Revision: 349863
URL: https://svnweb.freebsd.org/changeset/base/349863

Log:
 MFV:   r349861

 Import ACPICA 20190703.

I have two systems now that are affected, and both of them
are “fixed” by reverting this.  I don’t know the root cause yet,
see my email to the svn-src-all mailing list.

Scott

> On Jul 29, 2019, at 8:29 PM, Nick Wolff  wrote:
> 
> Sorry boot is broken from harddrive or iso(as cdrom) for some users(at
> least 3) since somewhere in the revisions listed above and that still
> stands as of the Head snapshot of 072519. Sorry for lack of clarity. There
> was a thread under Problem with USB after r349133 but I decided to rename
> it to try to catch more people's eyes/get more reports in if people run
> into the issue. Don't think or at least know for sure USB is the problem as
> when you bypass the waiting for USB you get a different hang farther into
> system booting.
> 
> I will try to bisect the build in that magic revision range once I figure
> out on what system as it's my primary builder that's having this issue. Not
> that I have a lack of hardware I guess just time to setup something else.
> 
> 
> 
> 
> On Mon, Jul 29, 2019, 21:45 Clay Daniels Jr. 
> wrote:
> 
>> Rodney, you are right that the .iso "should work", and a lot of other
>> projects, from Microsoft Windows 10 to Trident BSD only a furnish an iso,
>> and no img file. FreeBSD is one of the few that give you both choices. The
>> problem goes deeper than any one operating system. If you've ever used the
>> Rufus tool to make a bootable usb, which is all Rufus does, you may have
>> come across problems with "mount root". I found this article, answered by a
>> Rufus developer very enlightening.
>> 
>> https://superuser.com/questions/1170832/why-are-there-different-options-for-creating-bootable-usb-compared-to-a-cd
>> 
>> I have a collection of usb thumbdrives here at my desk, and use them a
>> lot, but I also bought me some blank dvd disks and use them too.
>> 
>> But I think you are right, Nick Wolff's problem may be a a bug to be
>> reported. All I know is I took the same file,
>> FreeBSD-13.0-CURRENT-amd64-20190725-r350322-disc1.iso
>> 
>> , burned it to a dvd, and I'm now writing this email from the FreeBSD
>> 13.0-CURRENT r350322 partition of my computer.
>> 
>> Clay
>> 
> ___
> freebsd-current@freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/freebsd-current
> To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"

___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


rc script: manual stop vs system shutdown

2019-08-01 Thread Andriy Gapon


Is it possible in an rc script to distinguish between a manual stop
(e.g., service foo stop) and a stop during a system shutdown (via
rc.shutdown) ?
Are there any marker variables for that?
Or something in the global system state?

Thanks!
-- 
Andriy Gapon
___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"