I had gotten curious enough about this go to the source, too.  I looked SysVinit up on 
Freshmeat, got an URL for the source (www.ibiblio.org), and downloaded the 
SysVinint-2.78.tar.gz.  

But after downloading and untarring, I couldn't find anything that looked like it 
would create these files (/halt, /poweroff).  As it turns out, the comments inside the 
halt.c file (in the SysVinint-2.78 tarball I downloaded) identified it as version 
2.74, dated 24-Feb-1998.  I guess I must have gotten an older version of the halt 
source.  You looked at the source from the RH7.0 src.rpm?  The section of code you 
quoted definitely isn't in the file I looked at.

But anyway, thanks for figuring out the answer to my last question.

The original issue, I think, was that someone (sorry, I don't remember who) wanted to 
know why upgrading from 6.2 to 7.0 changed the behavior of the `halt` command.  

__
Larry Grover, PhD
Assoc Prof of Physiology
Marshall Univ Sch of Med



On Fri, 27 Oct 2000 14:23:02 -0400 (EDT), Charles Galpin 
<[EMAIL PROTECTED]> wrote:
>
> yeah, but not much more use. So I downloaded the source, and see that in
> halt.c the halt/poweroff command creates them. do_shutdown just calles
> shutdown. 
>
>                 if (c != '0' && c != '6') {
>                         char *file;
>
>                         if (do_poweroff) {
>                                 file = strdup("/poweroff");
>                         } else {
>                                 file = strdup("/halt");
>                         }
>                         close(open(file, O_CREAT|O_RDWR, 0644));
>                         free(file);
>
>                         do_shutdown(do_reboot ? "-r" : "-h", tm);
>                 }
>
> So that answers that, but I have forgotten the orignal issue. How/when is
> /etc/rc.d/init.d/halt called? We know that calling halt -p or poweroff
> will do what we want, and calling shutdown will not (unless the /poweroff
> file is created), but I don't recall how we got started with this one :)
>
> My 6.2 box has a /usr/bin/shutdown script that seems to make all thsi work
> ok - maybe this is the critical difference, as on my 7.0 box
> /sbin/shutdown gets called directly instead.
>
>  charles
>
>
> On Fri, 27 Oct 2000, Rick Warner wrote:
>
>> 
>> 
>> Using a combination of find, grep, and strings, the following are the only
>> files that reference /poweroff:
>> 
>>     /etc/rc.d/rc.sysinit
>>     /etc/rc.d/init.d/halt
>>     /usr/share/doc/initscripts-5.49/ChangeLog
>>     /usr/share/doc/SysVinit-2.78/changelog
>> 
>> The latter two may be the most useful.
>> 
>> - rick warner
>> 
>> On Fri, 27 Oct 2000, Larry Grover wrote:
>> 
>> > I found the answer to one of these questions myself:
>> > 
>> > rc.sysinit (line 540) rm's /halt, /poweroff, and a few other files that might be 
>lying around.
>> > 
>> > But I haven't found out what creates these files during shutdown.  Does anyone 
>know?
>> > 
>> > __
>> > Larry Grover, PhD
>> > Assoc Prof of Physiology
>> > Marshall Univ Sch of Med



_______________________________________________
Redhat-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-list

Reply via email to