Something is wrong with rcvar or I am just blatant. For example: 1) Enable powerd in rc.conf # echo 'enable_powerd="YES"' >> /etc/rc.conf 2) Launch powerd # /etc/rc.d/powerd start Starting powerd. 3) And stopping it. # /etc/rc.d/powerd stop Stopping powerd. Everything looks fine, but when I disable powerd in rc.conf then problem arise. 1) Disable powerd in rc.conf- comment it out. # enable_powerd="YES" 2) Stop powerd # /etc/rc.d/powerd stop ...silence- nothing in logs either. What? Not even a warning message and powerd is actually running- why I have to reboot to disable it? I know that I can stop it by enabling it in rc.conf but what the point? Same problem when I want to start some service without appropriate line in rc.conf. I'd prefer to see somekind of warning about misconfigured rc.conf or at least information about what's going on in reality. Andrei
On Wednesday 28 November 2007 02:16:51 pm Andrei Kolu wrote:> Something is wrong with rcvar or I am just blatant. > > For example: > > 1) Enable powerd in rc.conf > # echo 'enable_powerd="YES"' >> /etc/rc.conf > 2) Launch powerd > # /etc/rc.d/powerd start > Starting powerd. > 3) And stopping it. > # /etc/rc.d/powerd stop > Stopping powerd. > > Everything looks fine, but when I disable powerd in rc.conf then problem > arise. > > 1) Disable powerd in rc.conf- comment it out. > # enable_powerd="YES" > 2) Stop powerd > # /etc/rc.d/powerd stop > ...silence- nothing in logs either. > > What? Not even a warning message and powerd is actually running- why I haveto> reboot to disable it? I know that I can stop it by enabling it in rc.confbut> what the point? Same problem when I want to start some service without > appropriate line in rc.conf. I'd prefer to see somekind of warning about > misconfigured rc.conf or at least information about what's going on in > reality.Use forcestart or forcestop to manage services that are not enabled in rc.conf. This is normal. If you got a warning, then on shutdown every rc.d script that is disabled would whine. Simiarly on boot since all rc.d scripts are started on boot. -- John Baldwin
On Wednesday 28 November 2007 20:16:51 Andrei Kolu wrote:> Something is wrong with rcvar or I am just blatant. > > For example: > > 1) Enable powerd in rc.conf > # echo 'enable_powerd="YES"' >> /etc/rc.conf > 2) Launch powerd > # /etc/rc.d/powerd start > Starting powerd. > 3) And stopping it. > # /etc/rc.d/powerd stop > Stopping powerd. >Agree - everything just fine.> Everything looks fine, but when I disable powerd in rc.conf then problem > arise. > > 1) Disable powerd in rc.conf- comment it out. > # enable_powerd="YES" > 2) Stop powerd > # /etc/rc.d/powerd stop > ...silence- nothing in logs either. >Stop for a moment - enable_powerd means actually 'enable action carried by /etc/rc.d/powerd script', using this semantics actually explains all details. Or you could treat it as a stack of a sort, reversing order to 2) 1) just produces desired output.> What? Not even a warning message and powerd is actually running- why I have > to reboot to disable it? I know that I can stop it by enabling it in > rc.conf but what the point? Same problem when I want to start some service > without appropriate line in rc.conf. I'd prefer to see somekind of warning > about misconfigured rc.conf or at least information about what's going on > in reality. >I hope my explanation above suffices. I was hit by this too, but rc.d scripts behavior is well designed and understandable. If, for some reason, you are still hit with described behavior, there is a save rope - /etc/rc.d/powerd forcestop will stop powerd even if there is no enable var in rc.conf. Regards, Milan -- No need to mail me directly. Just reply to mailing list, please.
In the last episode (Nov 28), Andrei Kolu said:> Something is wrong with rcvar or I am just blatant. > > For example: > > 1) Enable powerd in rc.conf > # echo 'enable_powerd="YES"' >> /etc/rc.conf > 2) Launch powerd > # /etc/rc.d/powerd start > Starting powerd. > 3) And stopping it. > # /etc/rc.d/powerd stop > Stopping powerd. > > Everything looks fine, but when I disable powerd in rc.conf then problem > arise. > > 1) Disable powerd in rc.conf- comment it out. > # enable_powerd="YES" > 2) Stop powerd > # /etc/rc.d/powerd stop > ...silence- nothing in logs either. > > What? Not even a warning message and powerd is actually running- why > I have to reboot to disable it? I know that I can stop it by enabling > it in rc.conf but what the point? Same problem when I want to start > some service without appropriate line in rc.conf. I'd prefer to see > somekind of warning about misconfigured rc.conf or at least > information about what's going on in reality.Try "/etc/rc.d/powerd forcestop". What happens during startup and shutdown is that all rc.d scripts are run with "start" or "stop" arguments, and only the ones that have been enabled do anything. -- Dan Nelson dnelson@allantgroup.com
John Baldwin <jhb@freebsd.org> wrote on 28 Nov 2007 14:37:> Use forcestart or forcestop to manage services that are not enabled in > rc.conf. This is normal. If you got a warning, then on shutdown every rc.dMost (all?) people recommend in this thread the use of "forcestart" / "forcestop". Is it not better to use "onestart" / "onestop"? When I remember right the "force" ignores any failed preconditions. Regards, Frank -- Frank Behrens, Osterwieck, Germany PGP-key 0x5B7C47ED on public servers available.