pax_global_header 0000666 0000000 0000000 00000000064 11256333254 0014516 g ustar 00root root 0000000 0000000 52 comment=fd9ef62a235e73cf6413101f3f25032d0493f1f3
cinit-0.3pre15/ 0000775 0000000 0000000 00000000000 11256333254 0013343 5 ustar 00root root 0000000 0000000 cinit-0.3pre15/ 0000664 0000000 0000000 00000000262 11256333254 0013405 0 ustar 00root root 0000000 0000000 This is a non-existing file, how did you find it? ;-)
It seems like you know a bit about your system, perhaps
you want to join cinit development in #cLinux on irc.freenode.org?
cinit-0.3pre15/.ditz-config 0000664 0000000 0000000 00000000162 11256333254 0015560 0 ustar 00root root 0000000 0000000 --- !ditz.rubyforge.org,2008-03-06/config
name: Nico Schottelius
email: nico@ikn.schottelius.org
issue_dir: bugs
cinit-0.3pre15/.gitignore 0000664 0000000 0000000 00000000520 11256333254 0015330 0 ustar 00root root 0000000 0000000 *.o
*.a
MT
ddoc
contrib+tools/cinit.graph.text
config.h
sbin
tmp
os/current
tmpbin
src/os/current
src/ipc/current
src/cinit
*.html
*.htm
*.man
*.texi
*.texi
*.docbook
src/halt.kill
src/poweroff.kill
src/reboot.kill
doc/man/*.[0-9]
doc/man/*.xml
src/cmd
.*.swp
.exclude
src/.configured
src/cinit.halt
src/cinit.poweroff
src/cinit.reboot
cinit-0.3pre15/COPYING 0000664 0000000 0000000 00000104513 11256333254 0014402 0 ustar 00root root 0000000 0000000 GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc.
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
Copyright (C)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see .
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
Copyright (C)
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
.
cinit-0.3pre15/CREDITS 0000664 0000000 0000000 00000001644 11256333254 0014370 0 ustar 00root root 0000000 0000000 --------------------------------------------------------------------------------
Credits - People contributed to cinit
Nico Schottelius, 2005-05-17 (Last Change: ls -l)
--------------------------------------------------------------------------------
The following list is sorted chronological, new contributors are
added at the end of the list.
René Nussbaumer
* helping with the general IPC idea
* testing and proof-reading code
Marcus Przyklink
* coding linear lists, making MAX_SVC obsolete
* providing cinit-vs.pl to visualize the cinit-tree
Matteo Croce
* finding good strip parameters to save about 30KiB (on glibc)
Sandro Koechli
* testing, testing and testing cinit and cinit documentation
Marcus Wagner
* building and maintaining the Debian package
Peter Portmann
* testing cinit and documentation, writing cinit.graph.text in C, other coding
Tonnerre Lombard
* NetBSD support (host + hints)
cinit-0.3pre15/Makefile 0000664 0000000 0000000 00000005672 11256333254 0015015 0 ustar 00root root 0000000 0000000 #
# cinit
# Nico Schottelius
#
# Don't edit Makefiles, use conf/* for configuration.
#
# Directories and files
CDIRS=src doc
#
# Targets
#
#
# Warn per default, make sure the user knows what she does
#
warn:
@cat doc/.buildwarn
all: sources documentation
dev-all: all sizecheck
install clean dist distclean:
@for subdir in ${CDIRS}; do \
echo "Making $@ in $$subdir"; \
(cd $$subdir && ${MAKE} ${MAKEFLAGS} $@) || break; \
done;
.PHONY: sources
sources:
${MAKE} -C src all
.PHONY: documentation
documentation:
${MAKE} -C doc documentation
sizecheck: sources
FILE="size/`date +%Y-%m-%d-%H%M%S`"; ls -l src/cinit > $$FILE; cat $$FILE; \
cg-add $$FILE
cg-commit $$FILE -m "Size added"
#cg-commit $$FILE -m "Size: $$(awk '{ print $5 }' $$FILE)"
source-size: clean
@echo -n "Source size (in KiB): "
@du -s src/ | awk '{ sum+=$$1 } END { print sum }'
install-miniconf:
./bin/cinit.install.miniconf
install-dir:
./bin/cinit.install.dir
config:
@./bin/cinit.configure.os
@./bin/cinit.configure.tools
@./bin/cinit.configure.ipc
@touch src/.configured
################################################################################
# Tests
#
tests:
# does not work, due getting killed, due to design :-)
#./scripts/internal/compile_run_as_compiler.sh
./scripts/internal/test_on_hosts.sh ./scripts/internal/compile_test.sh
DEBIAN=lenny
UMLDIR=test/uml
CONFDIR=etc/cinit/
uml-install-debian:
mkdir -p $(UMLDIR)
sudo /usr/sbin/debootstrap $(DEBIAN) $(UMLDIR)
me=$$(whoami); sudo chown -R $$me $(UMLDIR)
# only install binaries, no need to test documentation
uml-install-config:
rsync -av --delete ./$(CONFDIR) $(UMLDIR)/$(CONFDIR)
uml-install-cinit:
dir=$$(cd $(UMLDIR); pwd -P); make -C src DESTDIR=$$dir install
uml-run: uml-install-config
dir=$$(cd $(UMLDIR); pwd -P); linux root=/dev/root rootflags=$$dir rootfstype=hostfs init=/sbin/cinit
uml-run-sysv:
dir=$$(cd $(UMLDIR); pwd -P); linux root=/dev/root rootflags=$$dir rootfstype=hostfs
# debian-etch
de-install:
rsync -av --delete ./ root@de:cinit
rsync -av --delete ./etc/cinit/ root@de:/etc/cinit
ssh root@de '(cd cinit; make clean install)'
de-run:
ssh root@de reboot
UBUNTUHOST=cinit@192.168.122.2
UBUNTUCONF=./etc/cinit-ubuntu
UBUNTUINSTALL="cd cinit && make clean && sudo make install"
UBUNTUTEST="sudo reboot"
ubuntu-install:
rsync -av --delete ./ $(UBUNTUHOST):cinit
# rsync -av --delete ./$(UBUNTUCONF) $(UBUNTUHOST):/etc/cinit
ssh "$(UBUNTUHOST)" $(UBUNTUINSTALL)
ubuntu-test: ubuntu-install
ssh "$(UBUNTUHOST)" $(UBUNTUTEST)
################################################################################
#
# Developer targets
#
release: ./scripts/internal/cinit.release
./scripts/internal/cinit.release now
scripts/internal/cinit.release: ./scripts/internal/test-cmd.sh
./scripts/internal/test-cmd.sh
cinitconfconfdir=../cinit-conf/conf
sync-conf:
rsync --delete -av ./conf/ $(cinitconfconfdir)
cd $(cinitconfconfdir); git add .; git commit -m "sync with cinit/conf"
cinit-0.3pre15/NEXTTODO 0000664 0000000 0000000 00000002420 11256333254 0014530 0 ustar 00root root 0000000 0000000 --------------------------------------------------------------------------------
- Add service start/stop to cinit
cinit_svc_disable.c
--------------------------------------------------------------------------------
- svc_stop_wait()
=> calls svc_stop() and waits until the process
is finished
=> pay attention for child handler!
=> wait for that specific PID!
=> use global lock?
- answer_svc_stop(char *svc, int method)
=> is called by the IPC methods
=> checks whether the service exists
=> returns the status of the service (NOT_EXISTS or
the new one)
=> calls svc_stop_wait(), which returns
=> method =
o including needed_by
o including wanted_by
o including needed_by and wanted_by
o only the service
- cinit blocking while shutting down
=> not good!
=> only needed when being in ipc!
=> otherwise tree_stop() catches that again.
-
- Documentate off exit codes:
* 0: successfully stopped
* 1: internal error: service status unknown
* 2: ...?
Done for pre14:
- svc_stop()
=> stops an existing service
=> sets status
=> calls "off"
- svc_stop_deps() => takes care about dependencies
- Add comment about path_absolute in manpage of cmd => requires the directory
to be there.
cinit-0.3pre15/PLAN-2009 0000664 0000000 0000000 00000000653 11256333254 0014414 0 ustar 00root root 0000000 0000000 1. get the situation
2. fix the problems
3. release 0.3
--------------------------------------------------------------------------------
1.
- SIGCHLD not handled carefully
- service status changing not supported
- shutdown needs to be checked
- documentation is a mess
--------------------------------------------------------------------------------
2. began to cleanup child handler
- test on linux and freebsd
cinit-0.3pre15/README 0000664 0000000 0000000 00000006635 11256333254 0014235 0 ustar 00root root 0000000 0000000 --------------------------------------------------------------------------------
cinit, Nico Schottelius, 2005-04-28 [last change: 2005-05-07]
--------------------------------------------------------------------------------
Introduction
============
cinit is a fast init system with dependency features and
profile support. It was orientated on the design off Richard Gooch's
need [0] and Felix von Leitner's minit[1]. Minit does not support real
dependencies (you don't know whether the service you depend on really
started) and the need concept is somehow slow (as seen in gentoo).
In addition, minit needs libowfat and dietlibc, which may not be found
on every Unix system.
cinit main features:
- portability: it should run on every Unix
- true dependencies (soft and hard!)
- parallel execution
- highly customisable (see conf/*)
- profile support (specify what services to start depending on the profile)
Getting cinit
=============
This README is part of the source, so you should have it.
If not, goto the homepage [2] and download the tar archive
or get the lastest snapshot via git.
Pre-Configuring
===============
If you want to fine tune cinit parameters, add different path names,
change the DESTDIR, ... have a look at conf/*.
Installing
==========
You can install cinit parallel to any other init-system, it won't
kill other init's config nor /sbin/init, if it exists.
You only have to tell your kernel to execute /sbin/cinit instead
of /sbin/init.
Everybody do:
# make all install
This will create /sbin/cinit.
If /sbin/init does not exist, it will be linked to /sbin/cinit.
If it's the first time you operate with cinit, you can also do:
# make install-test
This will populate /etc/cinit with a testing configuration,
which is somehow minimalistic
(mounting root r/w, starting gettys, setting hostname).
Although this should work on most Linux systems, it's really
minimalistic. Please configure your cinit installation yourself,
see below how to do that.
After configuring you need to tell your kernel to boot cinit instead
of your current init system. How to do that depends on your system:
Linux/LILO and Linux/yaboot (ppc):
append="init=/sbin/cinit"
Linux/grub1 and Linux/grub2:
kernel init=/sbin/cinit
Configuring
===========
You'll have to configure /etc/cinit and add your existing services.
Please read doc/configuring.cinit for details.
Please read doc/FAO if there are still questions open.
Please join #cLinux on irc.freenode.org if there are still questions open.
There can be found some (currently only one) testing examples
below samples/ (some I do use for testing, beware if you use it:
It loads the dvorak keymapping at startup!).
There are currently no tools to merge your existing init-system
to cinit (like sysvinit-merge, bsd-merge or minit-merge) available.
If someone cares and tries to do that, I would be happy to include
the script(s).
Additionally I would be thankful for tar-balls containing a complete
replacement of $your_unix_init.
Author, Contact, Bug reports, etc.
==================================
Nico Schottelius (nico-cinit<>schottelius [[dot]] org) is the
author. Bug reports should be send to this address.
FIXME: Add mailing list here
The homepage of cinit is [2].
References:
===========
[0]: need: http://www.atnf.csiro.au/people/rgooch/linux/boot-scripts/
[1]: minit: http://www.fefe.de/minit/
[2]: cinit: http://linux.schottelius.org/cinit/
cinit-0.3pre15/ROADMAP 0000664 0000000 0000000 00000007670 11256333254 0014363 0 ustar 00root root 0000000 0000000 --------------------------------------------------------------------------------
THIS DOCUMENT SHOULD VANISH AS SOON AS EVERYTHING IS FINE
--------------------------------------------------------------------------------
Timeline
---------
* ~ End of October 2006: Reunderstand the code, manifest changes [DONE]
* ~ Mid of November 2006: Have a compile-able cinit [DONE]
* ~ End of November 2006: Have a testsystem booting cinit [DONE]
* ~ Mid of December 2006: Have production stable cinit
- Begin with migration scripts
- publish installable pre-releases
* ~ End of December 2006: Have some generic migration scripts
- Have (different) understanable documents
* ~ Mid of January 2007: Begin official release of cinit-0.3
Versions
---------
0.3:
~~~
code: Make cinit compile again :) [DONE]
code: double check to remove Linux specific source from general tree [DONE]
code: seperate ipc from the rest [DONE]
code: fix / check signal handlers [DONE]
code: cleanup makefile [DONE]
code: add porting code: add support for any unix in general [DONE]
code: stabilize code, remove experimenting parts
code: remove delay support, let off/off.params do that. [DONE]
code: add special directory (/etc/cinit/conf?) for non-services [DONE]
code: move production code to src/ [DONE]
end user doc: add warning for special binaries and hint for r/o only
amiga alike systems
doc: begin to merge old documents into new structure and move them
to the doc/ancient directory [DONE]
0.3.1:
devel doc: how to write merging scripts
devel doc: merging framework:
- minimal (do not look at the current configuration, build minimal)
- use current system (slowly, may use old scripts)
- rebuilt current system (recommened)
tools: general framework for merging
end user doc: merging old init to cinit
code: add porting code: add support for freebsd
code: better readable output:
-> starting
[ started once ]
[ respawning ]
[ failed ] (+ REASON!)
[ needs failed ] (which ones)
-> stopping
[ stopping ] (for dependencies)
[ stopped ] ?
[ not running ] ?
code: export profile information (CINIT_PROFILE)
end user doc: using different profiles in user space
end user doc: write examples for profiles:
o switch ssh known_hosts based on profile
o different proxy settings in browsers
- environment
- mozilla settings
o start samba (for lan)
o start samba (for company lan)
o use nis and nfs (company profile)
doc: continue to merge old documents into new structure and move them
to the doc/ancient directory
0.3.2:
end user doc: what to read to use cinit
end user doc: installing cinit
end user doc: configuring cinit
tools: writing cinit-config (graphical (dialog based?) configuration tool)
code: add porting code: add support for openbsd
code: add reverse dependency chain (or earlier?) [DONE]
code: better support for external tools
o neustarten
o mit herunterfahren
o mit herunterfahren und allen Diensten, die abhaengen
o ohne herunterfahren
o Statische Daten
o pid vom Daemon
o pid vom einmal ausgefuehrten Programm
doc: end to merge old documents into new structure and move them
to the doc/ancient directory
0.3.3:
devel doc: writing an init system
devel doc: the conf/-configuration system
code: check conf/ and perhaps rewrite b0rken english sentences
code / doc: add logging support for services -> use multilog?
code: add porting code: add support for netbsd
0.4:
first stable, tested, well documented version.
code: check for optimisation
other: compare with other init systems
0.4.x:
code: add porting code: add support for other unices
cinit-0.3pre15/TODO 0000664 0000000 0000000 00000021027 11256333254 0014035 0 ustar 00root root 0000000 0000000 svc_stop vs. svc_disable: coded tired?
--------------------------------------------------------------------------------
- define service status in one document, so repeatition stops!
--------------------------------------------------------------------------------
- add error handling to cinit.install.binary
--------------------------------------------------------------------------------
- add code do implement stopping / restarting with dependency tree
--------------------------------------------------------------------------------
# cinit.create.empty.service: can only be started from the bin directory
- Fix Switching services off !!
- Error codes when shutting down a service?
- Delay dokumentieren
- no_kill dokumentieren
- on.out, on.err, on.in?
-> reading/writing from/to files
- implement "no_kill" until cinit-0.2 or 0.3?
--------------------------------------------------------------------------------
- Source Logic issues
- remove FIXME entries (and what should be fixed, too)
--------------------------------------------------------------------------------
Helper scripts, rausgenommen aus Der Doku, muessen fuer
cinit-0.3 ueberprueft werden:
Configure help scripts
~~~~~~~~~~~~~~~~~~~~~~
cinit-conf later
Using prepared scripts
In the bin/ directory of this tarball you'll find at least:
cinit.add.dependency - add a dependency to a service
cinit.add.getty - add a new getty
cinit.create.empty.service - create an empty service
cinit.reboot - reboot in /bin/sh
cinit.remove.getty - remove a getty service
cinit.respawn.off - switch respawing off
cinit.respawn.on - switch respawing on
cinit.shutdown - shutdown in /bin/sh
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
Optimisations
-------------
- Configuring
* add scripts! see below
- define coding guidelines -> general, with url?
- Write manpages (use doc/* as base for that)
- Check Spell and Grammar in documentation
- write howto:
o Howto-cinit
o Howto-cinit-uml
tree_exec
~~~~~~~~~
- only check dependencies (=needs) after the basic run?
Documentation
-------------
developer
~~~~~~~~~
- ST_IN_LIST == startup marker, used to (NOT) insert services into startup
- dep_needs_wants_add is used to add dependencies of a service to the general
starter list
user
----
- do we really need swapoff? remove umount, swapoff!
* to services!
-> they have to do it!
- dependencies with leading '.' (dot) are ignored.
- about cinit-configuration structure
* cconfig
* svc/
* special/ (or however we called it)
- panic
- halt
- poweroff
- reboot
--------------------------------------------------------------------------------
FAQ
~~~
- DOKU: what happens when a service does not terminate....
und er als once drin ist
--> Wenn kein ReSPAWN und der Prozess beendet sich nicht,
dann haengt init!
- multuicall probleme -> busysbox --> GIBT ES NICHT!!
---> DOKU DAZU! mit links, doppelt links, aus test
---> erklaeren, dass es unproblematisch ist!
--------------------------------------------------------------------------------
csvc:
11:09 < folken23> telmich: oder service allready started.
--------------------------------------------------------------------------------
cinit:
11:09 < folken23> telmich: zsb. eine grund angabe warum ein dienst nicht gestartet
werden konnte.
11:09 < folken23> telmich: e.g. file nicht gefunden, service hat nicht 0
zurueckgeworfen.
---> errno in execute_sth!
Child handlin
~~~~~~~~~~~~~g
- free() everything before starting child
Later
~~~~~
- close(*>2) before forking / executing
-> close fds, clean environment, etc., ...
-> do we really need that?
-> yep, clean environment!
- logging service!
-> write output $somewhere, wait for syslog?
-> flush at the end of start-process?
-> perhaps pipe logging output to a program?
--------------------------------------------------------------------------------
- Doc
* main.text -> cleanup / remove / split
* config-dirs
* FAQ
* ideas
* meta.dependencies
- config/hints/meta depps
* optimising
- integrate into other
* README.text
- update
* replacing.init
- update / integrate
* special-services.text
- into configuring/hints?
* TODO
- into paths, if necessary
* updating.cinit
- update as soon as update is possible?
* using.rescue
- update as soon as update is possible?
* 'os-integration.text'
* 'daemons.backgrounding'
* There are some hints on how to migrate to cinit in general and also
some os specific help in the file 'migrating-init-systems.text',
- CODECHECK:
* what happens with the wants of the last services?
- are they added?
- are they added at the correct position?
- scripts
* `cinit.check.config` (doc/user/configuring.cinit.text)
-> circular depedencies!
- Doc.next:
- installing: report!
-> write report script.
- Doc later
* current-init-problems.text
- current-init-problems.text explains why cinit does not use nor recommends the use of shell scripts.
* special-services.text
- Begin documentation
* Check Makefile
* Integrate Makefile into main Makefile
* create manpage
* Write a small manual
- install
- configure
- boot (different OS)
* generate asciidoc!
- Doc way:
* installing
* configuring
- testconfig!
* booting
- different OS / bootloader
* debugging
- Shutdomn code:
* begin at init, then shutdown wants/needs, ...
- check that the new wants and need elements are nserted the other way round
* we go to next, elements must be put before us!
- replace cinit_ipc_logon with cinit_ipc_init...
* delay ipc code -> after start!
- Cleanup / create object lists
object-lists/
cinit
cservice
ccontrol
cinit.halt
cinit.reboot
cinit.shutdown (shell script?!?)
TODO.pre9:
Done:
- pfad korrigieren (home/..../ -> cinit.release)
- cg-add nicht aufrufen beim make all!
ser/nico/oeffentlich/computer/projekte/cinit/cinit-0.3pre8/doc'
FILE="size/`date +%Y-%m-%d-%H%M%S`"; ls -l src/cinit > $FILE; cat $FILE; \
cg-add $FILE
-rwx------ 1 nico nico 72601 2007-04-06 17:52 src/cinit
There is no GIT repository here (.git not found)
make: *** [sizecheck] Fehler 1
- setup VM for testing: qemu/kvm/virtualbox (no commercial bloaty)
-> uml!
- sleep when respawnig!
-> static delay of five seconds
do_reboot.c:
is ipc closed? -> check! => done!
- ignore msgrcv: Interrupted system call
Session terminated, killing shell...msgq-destroy: Invalid argument
msgq-destroy: Invalid argument
- do not print an error if /etc/cinit/conf/last is non-existent!
=> print it. Do not not print it, as this can aid debugging.
include locking via shm, remove test on pid1
=> not necessary imho currently
TODO.pre11:
Remove some debugging, re-introduce DEBUG() macro..
Fix doc:
make dist should cleanup cc / ld to sane values?
or do I experiement in tmp/*?
http://linux.schottelius.org/cinit/browse_source/current/doc/user/config-dirs
conf/c_halt
IPC:
* check msqg-code
* documentate the ipc functions: update devel/ipc.text
* check cinit_read_command() (devel/ipc.h)
do_reboot.c:
write cinit_svc_shutdown
- implement do_reboot()
* so not only booting with cinit works, but also the shutdown
- write libcinit for use in cmd()
- find out why gettimeofday() and time() do strange things when called in SIG_CHLD
=> bug opened in glibc, got to code testprogram
- write cinit.conf.check
* report broken links in needs/wants
* report circular dependencies
- pretty print, reporting is ugly!
Add handler for ctrl+alt+delete
* document in paths
* check whether there's an os-unspecific way to do that
cleanup bin/
- write sys-v-init-shutdown-wrapper
* shutdown
* halt
* reboot
* poweroff
- write manpages for
- *.kill
- cmd
install:
make install => does not overwrite critical targets
* cinit
* *.kill (see client/*)
* cmd
make force-install => overwrites /sbin/{halt,poweroff,reboot}?
=> with script that wraps cmd
make install-template:
* creates categories
make install-miniconf:
* creates categories
* creates one service starting a shell (depending on the OS!)
cinit-0.3pre15/TODO.doc 0000664 0000000 0000000 00000001036 11256333254 0014577 0 ustar 00root root 0000000 0000000 caveats
-------
- cinit will sleep after respawing if ...
a) the service did not terminate normally (!WIFEXITED(status))
b) the service did return a non-zero exit status
- cinit ignores the Keyboard request
- Currently there is no support to react on 'ctr+alt+del':
- cinit will start a little bit faster if you omit non needed
'wants' and 'needs' dirs as they need to be scanned if they
do not exist
- Dependencies beginning with a '.' (dot) are ignored.
So you can temporarily disable a dependency moving it to
want/.name
cinit-0.3pre15/bin/ 0000775 0000000 0000000 00000000000 11256333254 0014113 5 ustar 00root root 0000000 0000000 cinit-0.3pre15/bin/cinit.reboot.sh 0000775 0000000 0000000 00000000272 11256333254 0017052 0 ustar 00root root 0000000 0000000 #!/bin/sh
# Nico Schottelius
# reboot system
# 2005-06-09
usage()
{
echo "`basename $0`"
echo " Reboot the system:"
exit 1
}
if [ $# -ne 0 ]; then
usage
fi
kill -HUP 1
cinit-0.3pre15/bin/cinit.shutdown.sh 0000775 0000000 0000000 00000001130 11256333254 0017425 0 ustar 00root root 0000000 0000000 #!/bin/sh
# Nico Schottelius
# shutdown system
# TODO: use ccontrol!
# 2005-05-24 (Last changed: 2005-06-18)
usage()
{
echo "`basename $0` -[ohr]"
echo " Shutdown the system:"
echo " -p|--power-off: Power off"
echo " -h|--halt: Halt"
echo " -r|--reboot: Reboot"
echo " -s|--rescue: Rescue mode"
echo " "
exit 1
}
if [ $# -ne 1 ]; then
usage
fi
case $1 in
-r|--reboot) kill -HUP 1 ;;
-p|--power-off) kill -TERM 1 ;;
-h|--halt) kill -USR1 1 ;;
-s|--rescue) kill -USR2 1 ;;
*) usage ;;
esac
cinit-0.3pre15/bin/cinit.wait.for.daemon.sh 0000775 0000000 0000000 00000001171 11256333254 0020552 0 ustar 00root root 0000000 0000000 #!/bin/sh
# Nico Schottelius
# wait for daemon to terminate
# the pidfile is our first argument,
# the dameon the second and all others are for the daemon
# 2005-06-12 (Last Changed: 2005-06-17)
# how long to sleep before rechecking
SLEEP=5
if [ $# -lt 2 ]; then
echo "`basename $0` [daemon arguments]"
exit 1
fi
PIDFILE=$1; shift
DAEMON=$1; shift
# remove old pidfile
[ -e "$PIDFILE" ] && rm -f $PIDFILE
$DAEMON $@
PID=$(cat "$PIDFILE")
ISALIVE=$(ps ax | awk '{ print $1 }' | grep "^$PID\$")
while [ "$ISALIVE" ]; do
sleep ${SLEEP}
ISALIVE=$(ps ax | awk '{ print $1 }' | grep "^$PID\$")
done
cinit-0.3pre15/bugs/ 0000775 0000000 0000000 00000000000 11256333254 0014303 5 ustar 00root root 0000000 0000000 cinit-0.3pre15/bugs/issue-25822475f5d01c35eb9edd8d75c065c83032701b.yaml 0000664 0000000 0000000 00000001021 11256333254 0023524 0 ustar 00root root 0000000 0000000 --- !ditz.rubyforge.org,2008-03-06/issue
title: "Documentate: How to cross compile"
desc: |-
conf/os to destination os
conf/cc
conf/ld
conf/cflags
conf/ldflags
type: :task
component: documentation
release: future
reporter: Nico Schottelius
status: :unstarted
disposition:
creation_time: 2009-09-07 06:31:53.866741 Z
references: []
id: 25822475f5d01c35eb9edd8d75c065c83032701b
log_events:
- - 2009-09-07 06:31:54.990478 Z
- Nico Schottelius
- created
- ""
cinit-0.3pre15/bugs/project.yaml 0000664 0000000 0000000 00000001611 11256333254 0016634 0 ustar 00root root 0000000 0000000 --- !ditz.rubyforge.org,2008-03-06/project
name: cinit
version: "0.5"
components:
- !ditz.rubyforge.org,2008-03-06/component
name: cinit
- !ditz.rubyforge.org,2008-03-06/component
name: core
- !ditz.rubyforge.org,2008-03-06/component
name: user interface
- !ditz.rubyforge.org,2008-03-06/component
name: portability
- !ditz.rubyforge.org,2008-03-06/component
name: documentation
releases:
- !ditz.rubyforge.org,2008-03-06/release
name: "0.3"
status: :unreleased
release_time:
log_events:
- - 2009-09-07 06:28:02.974644 Z
- Nico Schottelius
- created
- The first cleaned up version
- !ditz.rubyforge.org,2008-03-06/release
name: future
status: :unreleased
release_time:
log_events:
- - 2009-09-07 06:29:14.264777 Z
- Nico Schottelius
- created
- All things to be fixed in the future.
cinit-0.3pre15/conf/ 0000775 0000000 0000000 00000000000 11256333254 0014270 5 ustar 00root root 0000000 0000000 cinit-0.3pre15/conf/.README 0000664 0000000 0000000 00000000452 11256333254 0015227 0 ustar 00root root 0000000 0000000 This is an example for a cinit and cinit-conf configuration.
The first line of a file contains the configuration value,
the rest of the file may contain a description.
The conf/ directory is shared by cinit and cinit-conf and may contain files that
are only relevant for one of the two projects.
cinit-0.3pre15/conf/c_confdir 0000664 0000000 0000000 00000000075 11256333254 0016143 0 ustar 00root root 0000000 0000000 conf
The directory below cinit_dir for cinit configuration.
cinit-0.3pre15/conf/c_delay 0000664 0000000 0000000 00000000161 11256333254 0015611 0 ustar 00root root 0000000 0000000 delay
Name of the file which contains the delay between sending SIGKILL after
SIGTERM for respawning processes.
cinit-0.3pre15/conf/c_desaster 0000664 0000000 0000000 00000000251 11256333254 0016325 0 ustar 00root root 0000000 0000000 /bin/sh
The path to a program, that we execute if nothing
else helps. We'll execute it, if the standard panic
action fails (as specified in cinit_dir/c_confdir/panic).
cinit-0.3pre15/conf/c_env 0000664 0000000 0000000 00000000220 11256333254 0015277 0 ustar 00root root 0000000 0000000 .env
The extension to c_on and c_off, which will contain the environment \n seperated.
For instance:
CLIENT_IP=192.168.23.42
ACCEPT_CONN=32
cinit-0.3pre15/conf/c_init 0000664 0000000 0000000 00000000044 11256333254 0015456 0 ustar 00root root 0000000 0000000 init
The name of the init service.
cinit-0.3pre15/conf/c_last 0000664 0000000 0000000 00000000343 11256333254 0015460 0 ustar 00root root 0000000 0000000 last
Name of the file below cinit_dir/c_confdir/ to execute right before
reboot/halt/poweroff.
This maybe a shellscript with the OS-specific umount procedure (like umount -a),
see doc/user/configuring.cinit for more details.
cinit-0.3pre15/conf/c_needs 0000664 0000000 0000000 00000000111 11256333254 0015604 0 ustar 00root root 0000000 0000000 needs
Name of the service sub-directory containing the needed services.
cinit-0.3pre15/conf/c_off 0000664 0000000 0000000 00000000073 11256333254 0015267 0 ustar 00root root 0000000 0000000 off
Name of the file we start, when stopping the service.
cinit-0.3pre15/conf/c_on 0000664 0000000 0000000 00000000072 11256333254 0015130 0 ustar 00root root 0000000 0000000 on
Name of the file we start, when starting the service.
cinit-0.3pre15/conf/c_panic 0000664 0000000 0000000 00000000244 11256333254 0015607 0 ustar 00root root 0000000 0000000 panic
Name of the file below cinit_dir/c_confdir/ to execute on panic.
This name .params (normally panic.params) will be passed as parameters/
argumunts to panic.
cinit-0.3pre15/conf/c_params 0000664 0000000 0000000 00000000132 11256333254 0015774 0 ustar 00root root 0000000 0000000 .params
The extension to c_on and c_off, which will contain the parameters \n seperated.
cinit-0.3pre15/conf/c_respawn 0000664 0000000 0000000 00000000125 11256333254 0016172 0 ustar 00root root 0000000 0000000 respawn
If this file exists in a service directory, cinit will respawn the service.
cinit-0.3pre15/conf/c_sock 0000664 0000000 0000000 00000000137 11256333254 0015455 0 ustar 00root root 0000000 0000000 coala
The name of the socket cinit will use (currently: below tmpdir,
see doc/ipc.thoughts).
cinit-0.3pre15/conf/c_tmp 0000664 0000000 0000000 00000000127 11256333254 0015315 0 ustar 00root root 0000000 0000000 tmp
The name of the temporary directory, where we'll mount tmpfs to create the socket
cinit-0.3pre15/conf/c_tmpfs 0000664 0000000 0000000 00000000141 11256333254 0015642 0 ustar 00root root 0000000 0000000 tmpfs
The name of the filesystem to use to mount a memory filesystem.
On Linux this is "tmpfs".
cinit-0.3pre15/conf/c_tmpmount 0000664 0000000 0000000 00000000232 11256333254 0016375 0 ustar 00root root 0000000 0000000 tmpfs
The name of the mount target, we'll mount with c_tmpfs on the c_tmp directory.
On Linux this can be anything, but we will use the default "tmpfs".
cinit-0.3pre15/conf/c_wants 0000664 0000000 0000000 00000000111 11256333254 0015642 0 ustar 00root root 0000000 0000000 wants
Name of the service sub-directory containing the wanted services.
cinit-0.3pre15/conf/cc 0000664 0000000 0000000 00000000034 11256333254 0014575 0 ustar 00root root 0000000 0000000 gcc
The c-compiler to use.
cinit-0.3pre15/conf/cflags 0000664 0000000 0000000 00000000340 11256333254 0015447 0 ustar 00root root 0000000 0000000 -pipe -W -Wall -Werror -Iinclude -g -D_XOPEN_SOURCE=600 -D_USE_POSIX
Standard flags to pass to (g)cc.
-D_XOPEN_SOURCE=600 must be used on glibc to select the right standard.
-D_USE_POSIX is needed for sigemptyset on glibc
cinit-0.3pre15/conf/cinit_dir 0000664 0000000 0000000 00000000106 11256333254 0016154 0 ustar 00root root 0000000 0000000 /etc/cinit
This is where all configuration for cinit will be stored.
cinit-0.3pre15/conf/cinitconfdir 0000664 0000000 0000000 00000000063 11256333254 0016665 0 ustar 00root root 0000000 0000000 conf
General cinit-configuration (below cinitdir)
cinit-0.3pre15/conf/destdir 0000664 0000000 0000000 00000000301 11256333254 0015643 0 ustar 00root root 0000000 0000000
The destination to install to. This is not used when running cinit,
but only for installing it. Normally the first line is blank.
cinit-conf uses this file for installing the configuration.
cinit-0.3pre15/conf/gettydir 0000664 0000000 0000000 00000000220 11256333254 0016040 0 ustar 00root root 0000000 0000000 getty
This is the subdirectry in which the scripts will create the gettys,
if you are using 'install-conf'. It's not used be cinit internally.
cinit-0.3pre15/conf/install_directory 0000664 0000000 0000000 00000000075 11256333254 0017747 0 ustar 00root root 0000000 0000000 -d
Parameter to pass to install_prog to create directories.
cinit-0.3pre15/conf/install_prog 0000664 0000000 0000000 00000000147 11256333254 0016712 0 ustar 00root root 0000000 0000000 /usr/bin/install
Program we use to install. install_directory contains parameter
to create directory.
cinit-0.3pre15/conf/ipc_method 0000664 0000000 0000000 00000000164 11256333254 0016327 0 ustar 00root root 0000000 0000000 msgq
The type of IPC (inter process communication) to use.
Valid values can be optained by issuing `ls src/ipc/`.
cinit-0.3pre15/conf/ld 0000664 0000000 0000000 00000000026 11256333254 0014610 0 ustar 00root root 0000000 0000000 gcc
Comment missing.
cinit-0.3pre15/conf/ldflags 0000664 0000000 0000000 00000000037 11256333254 0015627 0 ustar 00root root 0000000 0000000
No flags specified normally.
cinit-0.3pre15/conf/max_delay 0000664 0000000 0000000 00000000124 11256333254 0016153 0 ustar 00root root 0000000 0000000 30
Maximum number of seconds to sleep between retrying to start it
(respawn only).
cinit-0.3pre15/conf/max_deps 0000664 0000000 0000000 00000000212 11256333254 0016006 0 ustar 00root root 0000000 0000000 32
Maximum number of direct dependencies (in each wants and needs,
that way doubling this number) a service may have. The default is 32.
cinit-0.3pre15/conf/msgq_pathname 0000664 0000000 0000000 00000000123 11256333254 0017033 0 ustar 00root root 0000000 0000000 /bin/sh
Used to generate an unique identifier for the message queue.
See ftok(3).
cinit-0.3pre15/conf/msgq_to_clients 0000664 0000000 0000000 00000000153 11256333254 0017404 0 ustar 00root root 0000000 0000000 o
This is use in ftok to generate a key_t for the message queue use to write
to the clients. See ftok(3).
cinit-0.3pre15/conf/msgq_to_server 0000664 0000000 0000000 00000000152 11256333254 0017250 0 ustar 00root root 0000000 0000000 i
This is use in ftok to generate a key_t for the message queue use to write
to the server. See ftok(3).
cinit-0.3pre15/conf/os 0000664 0000000 0000000 00000000240 11256333254 0014630 0 ustar 00root root 0000000 0000000 linux
Select the operating system compiling for.
Current possibilities:
- linux
Currently Planned possibilities:
- freebsd
- openbsd
- netbsd
cinit-0.3pre15/conf/p_asciidoc 0000664 0000000 0000000 00000000166 11256333254 0016313 0 ustar 00root root 0000000 0000000 asciidoc
The binary on your system (with or without path) which does what I expect
asciidoc todo.
Default: asciidoc
cinit-0.3pre15/conf/p_docbooktoman 0000664 0000000 0000000 00000000174 11256333254 0017213 0 ustar 00root root 0000000 0000000 docbook2x-man
The binary on your system (with or without path) which converts
docbook to manpages.
Default: docbook2x-man
cinit-0.3pre15/conf/p_docbooktotexi 0000664 0000000 0000000 00000000175 11256333254 0017412 0 ustar 00root root 0000000 0000000 docbook2x-texi
The binary on your system (with or without path) which converts
docbook to texinfo.
Default: docbook2x-texi
cinit-0.3pre15/conf/prefix 0000664 0000000 0000000 00000000300 11256333254 0015501 0 ustar 00root root 0000000 0000000
Where to install cinit. Normally this will be /, but you can put it anywhere.
The subdirectory 'sbin' under this prefix must be readable by the kernel.
This is normally either empty or "/".
cinit-0.3pre15/conf/profile 0000664 0000000 0000000 00000000470 11256333254 0015654 0 ustar 00root root 0000000 0000000 cprofile:
The argument should be passed to cinit to recognize that
a profile will follow. "cprofile:" is the standard, as
the Linux kernel eats everything in the form 'var=parm'.
The old (pre cinit-0.1) option "cprofile=" should therefore
NOT be used.
Under Linux you tell it the bootloader like grub or LILO.
cinit-0.3pre15/conf/service_categories 0000664 0000000 0000000 00000000465 11256333254 0020065 0 ustar 00root root 0000000 0000000 getty init local-tuning local-services mount network remote-services
List of directories normally created below /etc/cinit/svc/ as
'pseudo-services'.
Btw, 'init' is the first service and has always to be there, but it does not really
fit into here, because it's a real one, compraed to the pseudo services.
cinit-0.3pre15/conf/sleep_before_kill 0000664 0000000 0000000 00000000347 11256333254 0017664 0 ustar 00root root 0000000 0000000 sleep_before_kill
The file that specifies how long to sleep after sending SIGTERM, before sending
SIGKILL to every process. If this file is non-existing the builtin value from
'sleep_kill'.
The file should be located below conf/
cinit-0.3pre15/conf/sleep_kill 0000664 0000000 0000000 00000000377 11256333254 0016345 0 ustar 00root root 0000000 0000000 2
Seconds to sleep after sending SIGTERM, before sending SIGKILL to every
process. 5 is a good working value, but makes me tired. Testing with
2 currently.
Note: This does NOT affect terminating services, they are shutdown by
their own 'off' functions.
cinit-0.3pre15/conf/sleep_kill_svc 0000664 0000000 0000000 00000000255 11256333254 0017213 0 ustar 00root root 0000000 0000000 1
Seconds to sleep after sending SIGTERM, before sending SIGKILL to
the service we are shutting down. This is only used for
bringing down respawning processes. Default: 1.
cinit-0.3pre15/conf/sleep_rerun 0000664 0000000 0000000 00000000137 11256333254 0016537 0 ustar 00root root 0000000 0000000 1
How many seconds to sleep before rechecking if the service was executed.
Used by run_svc().
cinit-0.3pre15/conf/sleep_svc 0000664 0000000 0000000 00000000101 11256333254 0016166 0 ustar 00root root 0000000 0000000 5
How many seconds to sleep before respawning a failed process.
cinit-0.3pre15/conf/sock_queue 0000664 0000000 0000000 00000000127 11256333254 0016356 0 ustar 00root root 0000000 0000000 32
Maximum process waiting in the socket queue. The default is much
more than enough.
cinit-0.3pre15/conf/strip 0000664 0000000 0000000 00000000110 11256333254 0015344 0 ustar 00root root 0000000 0000000 strip -R .comment -R .note
Strip out unecessary parts of the binaries.
cinit-0.3pre15/conf/svcdir 0000664 0000000 0000000 00000000074 11256333254 0015506 0 ustar 00root root 0000000 0000000 svc
Directory below /etc/cinit that contains the services.
cinit-0.3pre15/conf/version 0000664 0000000 0000000 00000000031 11256333254 0015672 0 ustar 00root root 0000000 0000000 "0.3pre15"
The version.
cinit-0.3pre15/conf2/ 0000775 0000000 0000000 00000000000 11256333254 0014352 5 ustar 00root root 0000000 0000000 cinit-0.3pre15/conf2/README 0000664 0000000 0000000 00000001717 11256333254 0015240 0 ustar 00root root 0000000 0000000 Migrate conf/ to general conf/-buildsystem (write documentation for it).
gpm2 may be an example for this!
conf/targets:
targets to make available in Makefile and their dependencies
abstract the build-process somehow, so one can create build-targets?
c-programs/ (includes cc / ld)
cinit (link to conf/object_listings cinit?)
conf/object_listings
lists of dependencies:
conf/object_listings/cinit contains all objects needed for cinit
conf/programs/
like cc, ld, install, ...
conf/built-options/
like --... in ./configure
conf/install/
options/
destdir (prefixed before everything)
prefix (standard prefix)
bin (relative to prefix, if not beginning with a /)
sbin (relative to prefix, if not beginning with a /)
lib (relative to prefix, if not beginning with a /)
targets/
cinit/
built-target (link to conf/targets/cinit)
destination (relative to
cinit-0.3pre15/contrib+tools/ 0000775 0000000 0000000 00000000000 11256333254 0016137 5 ustar 00root root 0000000 0000000 cinit-0.3pre15/contrib+tools/Makefile 0000664 0000000 0000000 00000002301 11256333254 0017573 0 ustar 00root root 0000000 0000000 #
# (c) 2005 Peter Portmann (pp at bluewin.ch)
# cinit/contrib+tools
#
# This script is written for the clinux-System and published
# under the terms of GPL 2.0
#
# Version: 0.2
# clean with a single command instead of two commands.
#
# ChangeLog:
# 0.1 initial version
#
# Todo:
#
# Features:
#
# compile/link options
#
# do not use DEBUG and OPTIMIZE at the same time!
#DEBUG=-DDEBUG
#OPTIMIZE=-Werror
DEBUG=-g -DDEBUG
#OPTIMIZE=-pipe -Os -Werror
# init should be static per default!
LDFLAGS=
# programs
CC=gcc $(DEBUG) $(OPTIMIZE) $(TIMEME)
CFLAGS=-Wall -I. -I../
LD=gcc
STRIP=strip -R .comment -R .note
INSTALL = install
prefix = /usr
bindir = $(prefix)/bin
# objects
CLIENT=cinit.graph.text.o
COMMUNICATION=error.o usage.o mini_printf.o
OBJ=$(CLIENT) $(COMMUNICATION)
#
PROGRAMS=cinit.graph.text
SCRIPTS=cconfig.graph.xml.rb \
make.cconfig.from.xml.rb \
cinit-vis.pl
# targets
all: $(PROGRAMS)
cinit.graph.text: $(OBJ)
$(LD) $(LDFLAGS) $(OBJ) -o $@
$(STRIP) $@
clean:
rm -f *.o $(PROGRAMS)
install: all
@echo '*** Installing contrib+tools ***'
$(INSTALL) -d -m755 $(DESTDIR)$(bindir)
for bin in $(SCRIPTS) $(PROGRAMS); do \
$(INSTALL) $$bin $(DESTDIR)/$(bindir); \
done
cinit-0.3pre15/contrib+tools/README 0000664 0000000 0000000 00000000663 11256333254 0017024 0 ustar 00root root 0000000 0000000 contrib+tools/
programs written by others and external tools not necessary
needed but (very) nice to have
cinit-vis.pl - draw an ascii graph of cinit configuration [perl]
cinit.graph.text - draw an ascii graph of cinit configuration [c]
cconfig.graph.xml.rb - creates a xml file from a cconfig [ruby]
make.cconfig.from.xml.rb - creates a cconfig from a xml file [ruby]
cinit-0.3pre15/contrib+tools/README.ruby 0000664 0000000 0000000 00000000416 11256333254 0020000 0 ustar 00root root 0000000 0000000 The ruby tools for general cconfig [0] are written by René Nussbaumer [1].
You can find the documentation for them at [2].
[0]: http://nico.schotteli.us/papers/linux/cconfig/
[1]: http://killerfox.forkbomb.ch/
[2]: http://killerfox.forkbomb.ch/articles/cconfig/tools
cinit-0.3pre15/contrib+tools/cconfig.graph.xml.rb 0000775 0000000 0000000 00000006675 11256333254 0022014 0 ustar 00root root 0000000 0000000 #!/usr/bin/env ruby
=begin
Writes an XML-Tree for a cconfig directory
Idea by Nico Schottelius aka telmich
Implemented and (C) by René Nussbaumer aka KillerFox
This script is written for the clinux-System and published
under the terms of GPL 2.0
Version: 0.3
ChangeLog:
Version 0.3 (René Nussbaumer):
* Added support for binary files
* Added sha1 checksum for binary files
Version 0.2 (René Nussbaumer):
* Changed checking order: symlink, directory, file. Because of
a logical bug -> directory follows symlink so, when a symlink
points to a directory no «link» element is created.
Version 0.1 (René Nussbaumer):
* Holy hack for directory scanning (needs to be optimized)
* Hack for rexml to print out «lost» tags. This rexml sux.
Todo:
* Optimize scanning.
* Use another xml library instead of rexml crap.
Problem: Produce dependencies -> no std-lib
Features:
* Create a flat (no deepnes without directory) and 1:1 image
of an cconfig directory
=end
require 'rexml/document'
require 'base64'
require 'digest/sha1'
require 'filemagic'
@version = '0.3'
def determineTarget(entry)
return 'external' if(!File.expand_path(entry).index(@initpath))
return 'link' if(FileTest.symlink?(entry))
return 'object' if(FileTest.directory?(entry))
return 'attribute' if(FileTest.file?(entry))
return 'unknown' # Should never be reached
end
def createTree(dir, parent)
dir.each { |entry|
next if(entry =~ /^(\.|\.\.)$/)
if(FileTest.symlink?(entry))
e = parent.add_element('link')
# Much fun with links
e.add_attributes( { 'name' => entry, 'target' => determineTarget(File.readlink(entry)) } )
e.add_text(File.readlink(entry))
elsif(FileTest.directory?(entry))
e = parent.add_element('object')
e.add_attribute('name', entry)
# Bad, that we need to change the directory every time.
oldPwd = Dir.pwd
Dir.chdir(entry)
createTree(Dir.new('.'), e)
Dir.chdir(oldPwd)
elsif(FileTest.file?(entry))
e = parent.add_element('attribute')
e.add_attribute('name', entry)
if(File.stat(entry).size?)
# Yeah, we got one WITH content! W00h00, let's party.
fm = FileMagic.new(FileMagic::MAGIC_MIME)
if(fm.file(entry) =~ /executable/)
e.add_attribute('type', 'binary')
text = File.new(entry).read
e.add_attribute('sha1', Digest::SHA1.hexdigest(text))
e.add_text(Base64.encode64(text))
else
e.add_text(File.new(entry).read)
end
fm.close()
end
end
}
end
if(!ARGV[0] || !FileTest.directory?(ARGV[0]))
puts 'You need to specify a directory'
Kernel.exit(-1)
end
doc = REXML::Document.new
e = doc.add_element('cconfig')
e.add_attribute('name', File.basename(ARGV[0]))
e.add_attribute('version', @version)
@initpath = File.expand_path(ARGV[0])
Dir.chdir(ARGV[0])
createTree(Dir.new('.'), doc.root)
out = ''
doc.write(out, 0, false, true)
REXML::XMLDecl.new('1.0', 'utf-8').write($stdout) # This should automatically printed by rexml. Damn bugs.
puts ''
puts out # Workaround for a buggy rexml
cinit-0.3pre15/contrib+tools/cinit-vis.pl 0000775 0000000 0000000 00000003112 11256333254 0020401 0 ustar 00root root 0000000 0000000 #!/usr/bin/perl -w
# (c) by Marcus Przyklink (downhill-clinux@burningchaos.org)
# written for cinit and published under GPL
# beautified a bit by Nico Schottelius
# optimized by René Nussbaumer
# Version: 0.1
use strict;
use warnings;
#
# Variables for location and output
#
# cinit-directory
my $path = "/etc/cinit/svc/";
# started profile
my $starting_point = "init";
# the spaces for each level (integer: amount of spaces)
my $space = 3;
# marker for need
my $need = "-->";
# marker for want
my $want = "==>";
#
# main function, recursively list the components of the cinit system
#
if (@ARGV) {
if( $ARGV[0] =~ /-(h|-help)/ ) {
print "Usage: " . __FILE__ . " without parameters for standard-use (check variables in file)\n";
print " Parameters:\n";
print " -h for this help\n";
print " profile-name for a profile\n";
exit(0);
}
else {
$starting_point = $ARGV[0];
}
}
#
# start first instance
#
sub get_deeper {
my ($point, $tmp_counter, $need_want) = splice @_;
print " " x ($space * $tmp_counter) . ($need_want ? $need : $want) . " " . $point . "\n";
opendir(DIR, "${path}${point}/needs") and
my @next_need = sort grep(!/^\./, readdir(DIR)) and
closedir(DIR);
opendir(DIR, "${path}${point}/wants") and
my @next_want = sort grep(!/^\./, readdir(DIR)) and
closedir(DIR);
for(@next_need) {
get_deeper($_, $tmp_counter + 1, 1);
}
for(@next_want) {
get_deeper($_, $tmp_counter + 1, 0);
}
}
#
# start first instance
#
get_deeper($starting_point, 0, 0);
#
# work done, go home
#
exit(0);
cinit-0.3pre15/contrib+tools/cinit.graph.text.c 0000664 0000000 0000000 00000012471 11256333254 0021501 0 ustar 00root root 0000000 0000000 /**
(c) 2005 Peter Portmann (pp at bluewin.ch)
cinit.graph.text.c
This script is written for the clinux-System and published
under the terms of GPL 2.0
Version: 0.2
ChangeLog:
Version 0.2 (Peter Portmann):
* Not assigned link destinies are marked by (!).
* Not readable directories are marked by "directory not readable".
Version 0.1 (Peter Portmann):
* Print of the directory structure of the contained files and links
without following the links.
Todo:
Features:
*/
//#include
#include
#include
#include
#include
#include
#include
#include
//#include "cinit.h"
#include "error.h"
#define FTW_F 1 /* file isn't a directory */
#define FTW_D 2 /* file is a directory */
#define FTW_DNR 3 /* not readable directory */
#define FTW_NS 4 /* unsuccesfully stat on this file */
#define MAX_CHAR 4096
/***********************************************************************
* cinit.graph.text - textual representation of the cinit directory
*/
#define CSERVICE_BANNER "cinit.graph.text - textual representatio of the cinit directory\n\n"
#define USAGE_TEXT "\n\nUsage:\n\ncinit.graph.text \n" \
"\tpath\t- cinit installationpath\n"
typedef int EACH_ENTRY(const char *, const struct stat *, int);
typedef enum { FALSE=0, TRUE=1 } bool;
static char dirpath[PATH_MAX];
static int depth = 0;
static long int filecount = 0;
static EACH_ENTRY each_entry;
static int pp_ftw(char *, EACH_ENTRY *);
static int each_getinfo(EACH_ENTRY *);
/***********************************************************************
* pp_ftw: file tree walk
*/
static int pp_ftw(char *filepath, EACH_ENTRY *function)
{
int n;
if(chdir(filepath) < 0) /* In angegebenen Pfad wechseln */
err_msg(FATAL_SYS, "can't change to %s", filepath);
if(getcwd(dirpath, PATH_MAX) == 0) /* Absoluten Pfadnamen ermitteln */
err_msg(FATAL_SYS, "error using getcwd for %s", filepath);
n = each_getinfo(function);
return(n);
}
/***********************************************************************
* each_getinfo: get more info for each file.
*/
static int each_getinfo(EACH_ENTRY *function)
{
struct stat statpuff;
struct dirent *direntz;
DIR *dirz;
int n;
char *zgr;
if(lstat(dirpath, &statpuff) < 0)
return(function(dirpath, &statpuff, FTW_NS)); /* Error on stat */
if(S_ISDIR(statpuff.st_mode) == 0)
return(function(dirpath, &statpuff, FTW_F)); /* no directory */
/* It's a directory.
* Call function() for it. After that handel each file in the directory. */
if((dirz = opendir(dirpath)) == NULL) { /* Directory not readable */
closedir(dirz);
return(function(dirpath, &statpuff, FTW_DNR));
}
if((n = function(dirpath, &statpuff, FTW_D)) != 0) /* return the directorydirpath */
return(n);
zgr = dirpath + strlen(dirpath); /* append slash to the dirpathname */
*zgr++ = '/';
*zgr = '\0';
while((direntz = readdir(dirz)) != NULL) {
/* ignor . and .. */
if(strcmp(direntz->d_name, ".") && strcmp(direntz->d_name, "..")) {
strcpy(zgr, direntz->d_name); /* append filename after slash */
depth++;
if(each_getinfo(function) != 0) { /* Recursion */
depth--;
break;
}
depth--;
}
}
*(zgr-1) = '\0'; /* deleting evrything after the slash */
if(closedir(dirz) < 0)
err_msg(WARNING, "closedir for %s failed", dirpath);
return(n);
}
/***********************************************************************
* each_entry: handling each file and build the graph step by step.
*/
static int each_entry(const char *filepath, const struct stat *statzgr, int filetype)
{
struct stat statpuff;
static bool erstemal=TRUE;
int i;
char link[MAX_CHAR];
filecount++;
if(!erstemal) {
for(i=1 ; i<=depth ; i++)
printf("%4c|", ' ');
printf("----%s", strrchr(filepath, '/')+1);
} else {
printf("%s", filepath);
erstemal = FALSE;
}
switch(filetype) {
case FTW_F:
switch(statzgr->st_mode & S_IFMT) {
case S_IFREG: break;
case S_IFCHR: printf(" c"); break;
case S_IFBLK: printf(" b"); break;
case S_IFIFO: printf(" f"); break;
case S_IFLNK:
printf(" -> ");
if(( i=readlink(filepath, link, MAX_CHAR)) != -1)
printf("%.*s", i, link);
if(stat(filepath, &statpuff) < 0)
printf(" (!)");
break;
case S_IFSOCK: printf(" s"); break;
default: printf(" ?"); break;
}
printf("\n");
break;
case FTW_D:
printf("/\n");
break;
case FTW_DNR:
printf("/ directory not readable\n");
break;
case FTW_NS:
err_msg(WARNING_SYS, "Error using 'stat' on file %s", filepath);
break;
default:
err_msg(FATAL_SYS, "Unknown Filetype (%d) by file %s", filetype, filepath);
break;
}
return(0);
}
/***********************************************************************
* main:
*/
int main(int argc, char *argv[])
{
if(argc != 2)
usage(CSERVICE_BANNER, USAGE_TEXT);
exit(pp_ftw(argv[1], each_entry));
}
cinit-0.3pre15/contrib+tools/cinit.h 0000664 0000000 0000000 00000000565 11256333254 0017424 0 ustar 00root root 0000000 0000000 /***********************************************************************
*
* 2007 Nico Schottelius (nico-cinit //@\\ schottelius.org)
*
* part of cLinux/cinit
*
* Dummy header file to intgrate mini_printf and usage
*/
#ifndef CINIT_DUMMY_HEADER
#define CINIT_DUMMY_HEADER
void usage(char *banner, char *text);
void mini_printf(char *str,int fd);
#endif
cinit-0.3pre15/contrib+tools/error.c 0000664 0000000 0000000 00000005707 11256333254 0017445 0 ustar 00root root 0000000 0000000 /**
(c) 2005 Peter Portmann (pp at bluewin.ch)
error.c
This script is written for the clinux-System and published
under the terms of GPL 2.0
Version: 0.1
ChangeLog:
Todo:
Features:
*/
#include "error.h"
#include
#include
#include
#include
#include
#include
#define MAX_CHAR 4096
int debug; /* Aufrufer von log_msg oder log_open muss debug setzen:
0, wenn interaktiv; 1, wenn Daemon-Prozess */
/*---- Lokale Routinen zur Abarbeitung der Argumentliste --------------------*/
static void msg_err(int sys_msg, const char *fmt, va_list az)
{
int fehler_nr = errno;
char puffer[MAX_CHAR];
vsprintf(puffer, fmt, az);
if (sys_msg)
sprintf(puffer+strlen(puffer), ": %s ", strerror(fehler_nr));
fflush(stdout); /* fuer Fall, dass stdout und stderr gleich sind */
fprintf(stderr, "%s\n", puffer);
fflush(NULL); /* alle Ausgabepuffer flushen */
return;
}
static void msg_log(int sys_msg, int prio, const char *fmt, va_list az)
{
int fehler_nr = errno;
char puffer[MAX_CHAR];
vsprintf(puffer, fmt, az);
if (sys_msg)
sprintf(puffer+strlen(puffer), ": %s ", strerror(fehler_nr));
if (debug) {
fflush(stdout); /* fuer Fall, dass stdout und stderr gleich sind */
fprintf(stderr, "%s\n", puffer);
fflush(NULL); /* alle Ausgabepuffer flushen */
} else {
strcat(puffer, "\n");
syslog(prio, puffer);
}
return;
}
/*---- Global aufrufbare Fehlerroutinen -------------------------------------*/
void err_msg(int kennung, const char *fmt, ...)
{
va_list az;
va_start(az, fmt);
switch (kennung) {
case WARNING:
case FATAL:
msg_err(0, fmt, az);
break;
case WARNING_SYS:
case FATAL_SYS:
case DUMP:
msg_err(1, fmt, az);
break;
default:
msg_err(1, "Falscher Aufruf von err_msg...", az);
exit(3);
}
va_end(az);
if (kennung==WARNING || kennung==WARNING_SYS)
return;
else if (kennung==DUMP)
abort(); /* core dump */
exit(1);
}
void log_msg(int kennung, const char *fmt, ...)
{
va_list az;
va_start(az, fmt);
switch (kennung) {
case WARNING:
case FATAL:
msg_log(0, LOG_ERR, fmt, az);
break;
case WARNING_SYS:
case FATAL_SYS:
msg_log(1, LOG_ERR, fmt, az);
break;
default:
msg_log(1, LOG_ERR, "Falscher Aufruf von log_msg...", az);
exit(3);
}
va_end(az);
if (kennung==WARNING || kennung==WARNING_SYS)
return;
exit(2);
}
/*---- log_open ---------------------------------------------------------------
initialisiert syslog() bei einem Daemon-Prozess */
void log_open(const char *kennung, int option, int facility)
{
if (debug==0)
openlog(kennung, option, facility);
}
cinit-0.3pre15/contrib+tools/error.h 0000664 0000000 0000000 00000000733 11256333254 0017444 0 ustar 00root root 0000000 0000000 #ifndef ERROR_H
#define ERROR_H
/**
(c) 2005 Peter Portmann (pp at bluewin.ch)
error.h
This script is written for the clinux-System and published
under the terms of GPL 2.0
Version: 0.1
ChangeLog:
Todo:
Features:
*/
#define WARNING 0
#define WARNING_SYS 1
#define FATAL 2
#define FATAL_SYS 3
#define DUMP 4
void log_msg(int kennung, const char *fmt, ...);
void err_msg(int kennung, const char *fmt, ...);
#endif
cinit-0.3pre15/contrib+tools/make.cconfig.from.xml.rb 0000775 0000000 0000000 00000014503 11256333254 0022557 0 ustar 00root root 0000000 0000000 #!/usr/bin/env ruby
=begin
Create a cconfig directory based on a xml input.
(C) 2005 by Ren Nussbaumer aka KillerFox
This script is written for the clinux-System and published
under the terms of GPL 2.0
Version: 0.3
ChangeLog:
Version 0.3 (Ren Nussbaumer):
* Added binary file support
* Added sha1 checksum for binary files
Version 0.2 (Ren Nussbaumer):
* Added some commandline options
* Added level so control the restrictivity of the program
* Added more intelligence to the program, to detect internal broken dependcies.
* Support debug-Levels.
* Print statistic at the end of the programs about warnings and errors.
Version 0.1 (Ren Nussbaumer):
* Initial
Todo:
* Use an rexml alternative
* Some cleanup
* Optimize
* Testing?
Features:
* Create a cconfig directory based on a xml
=end
require 'rexml/document'
require 'getoptlong'
require 'base64'
require 'digest/sha1'
@verbose = 0
@level = 1
@version = '0.3'
@warnings = 0
@errors = 0
@checklist = Array.new
def printMsg(prefix, msg)
puts '%-12s %s' % [prefix + ':', msg]
end
def error(msg, fatal = 0)
@errors += 1
fatal = 0 if(@level < 1)
fatal = 255 if(@level > 1 && !fatal)
printMsg(fatal != 0 ? 'PANIC' : 'ERROR', msg)
Kernel.exit(-fatal) if(fatal != 0)
end
def warn(msg)
error(msg, 1) if(@level > 1)
@warnings += 1
printMsg('WARNING', msg)
end
def info(msg)
printMsg('INFO', msg)
end
def debug(msg, verbosity = 1)
if(@verbose >= verbosity)
printMsg("DEBUG(#{verbosity})", msg)
end
end
def createObject(name)
error("#{name} already exists.", 1) if(FileTest.exists?(name))
begin
Dir.mkdir(name)
rescue
error("Could not create directory #{name}: #{$!}. Abort.", 7)
end
debug("Object #{File.expand_path(name)} has been created.", 4)
end
def createAttribute(name, content = nil)
warn("#{name} already exists. Overwrite.") if(FileTest.exists?(name))
begin
file = File.new(name, 'w')
file.print content if(content && !content.empty?)
file.close
debug("Attribute #{File.expand_path(name)} has been created", 4)
rescue
error("Could not create file #{name}: #{$!}. Skipped.")
end
end
def createLink(name, target, type)
warn("#{name} already exists. Overwrite.") if(FileTest.exists?(name))
error("Broken dependencies! Please take a look if #{target} exists on your system", 2) if(type == 'external' && !FileTest.exists?(target))
if(!FileTest.exists?(target) && type != 'external')
#info("Possible break. But maybe the target #{target} does not yet exists. Checking later.")
exptarget = File.expand_path(target)
@checklist << exptarget
debug("Adding #{target} to the list of internal dependcies to check.", 2)
end
begin
error('You\'ve a system which does not support symbolic links. Abort.', 3) if(File.symlink(target, name) != 0)
rescue
error("Could not create symlink #{name} => #{target}: #{$!}.", 3)
end
debug("Link #{File.expand_path(name)} has been created", 4)
end
def doWork(elm)
name = elm.name
attrname = elm.attributes['name']
error("XML Tag with missing name attribute!", 5) if(!attrname)
if(name =~ /(object|cconfig)/)
if(name == 'cconfig')
if(elm.attributes['version'])
info("Found a version string: #{elm.attributes['version']}")
warn("This XML is maybe incompatible with this programm. I'm a version #{@version} script. The XML is generated with a version #{elm.attributes['version']} script. Please update.") if(elm.attributes['version'] > @version)
end
end
createObject(attrname)
if(elm.has_elements?)
pwd = Dir.pwd
Dir.chdir(attrname)
elm.each_element { |e|
doWork(e)
}
Dir.chdir(pwd)
end
elsif(name == 'attribute')
text = nil
e = nil
text = e.value if((e = elm.get_text))
if(text && elm.attributes['type'] && elm.attributes['type'] == 'binary')
text = Base64.decode64(text)
if(Digest::SHA1.hexdigest(text) != elm.attributes['sha1'])
warn("SHA1 differs from file: #{Dir.pwd}#{attrname}")
end
end
createAttribute(attrname, text)
elsif(name == 'link')
error("link-Tag without content.", 6) if(!elm.has_text?)
error("link with missing target. Skipped.") if(!elm.attributes['target'])
createLink(attrname, elm.get_text.value, elm.attributes['target'])
end
end
puts "This is #{File.basename(__FILE__)} v#{@version} by Ren Nussbaumer"
puts
opts = GetoptLong.new(
['--verbose', '-v', GetoptLong::OPTIONAL_ARGUMENT],
['--level', '-l', GetoptLong::REQUIRED_ARGUMENT],
['--version', '-V', GetoptLong::NO_ARGUMENT]
)
opts.each { |arg,value|
case arg
when '--verbose'
@verbose += 1
value.each_byte { |x|
if(x.chr == 'v')
@verbose += 1
end
}
debug("Verbosity set to: #{@verbose}")
when '--level'
debug("Setting level to: #{value}", 3)
case value
when 'low'
@level = 0
when 'normal'
@level = 1
when 'paranoid'
@level = 2
else
warn('Unknown level: ' + value)
end
when '--version'
Kernel.exit(0)
else
warn("Unknown option #{arg}#{value && !value.empty? ? ('with value ' + value) : ''}")
end
}
if(!ARGV[0])
puts 'Need at least one argument'
puts "Usage: #{__FILE__} "
Kernel.exit(1)
end
filedesc = $stdin
if(ARGV[0] != '-')
filedesc = File.new(ARGV[0])
end
doc = REXML::Document.new filedesc
doWork(doc.root)
if(!@checklist.empty?)
info('Now checking all broken internal dependcies again')
broken = 0
@checklist.each { |path|
debug("Checking #{path}.", 2)
if(!FileTest.exists?(path))
broken += 1
warn("Broken dependcies. #{path} does not exist. Please fix.")
end
}
info('Looks good.') if(broken == 0)
info('Bad, bad.') if(broken > 0)
end
info("Successed. #{@warnings} warnings, #{@errors} errors")
cinit-0.3pre15/contrib+tools/mini_printf.c 0000777 0000000 0000000 00000000000 11256333254 0025714 2../src/generic/mini_printf.c ustar 00root root 0000000 0000000 cinit-0.3pre15/contrib+tools/usage.c 0000777 0000000 0000000 00000000000 11256333254 0023270 2../src/generic/usage.c ustar 00root root 0000000 0000000 cinit-0.3pre15/doc/ 0000775 0000000 0000000 00000000000 11256333254 0014110 5 ustar 00root root 0000000 0000000 cinit-0.3pre15/doc/.buildwarn 0000664 0000000 0000000 00000001057 11256333254 0016103 0 ustar 00root root 0000000 0000000
Welcome to the cinit
********************
Hints:
------
- Settings can be found in conf/* (also used for compiling)
- Cinit configuration is normally found in /etc/cinit
Documentation
-------------
The documentation can be found in doc/:
- doc/user/ contains documentation for users
- doc/devel/ contains documentation for developers
Please read doc/user/installing-cinit.text BEFORE installing.
Building cinit
--------------
"make all" - to build cinit
"make install" - to install cinit, documentation and core tools
cinit-0.3pre15/doc/Makefile 0000664 0000000 0000000 00000004775 11256333254 0015565 0 ustar 00root root 0000000 0000000 #
# Makefile stolen from ccollect
# Nico Schottelius, Fri Jan 13 12:13:08 CET 2006
#
A2X=a2x
ASCIIDOC=asciidoc
DOCBOOKTOTEXI=docbook2x-texi
DOCBOOKTOMAN=docbook2x-man
XSLTPROC=xsltproc
XSL=/usr/share/xml/docbook/stylesheet/nwalsh/html/docbook.xsl
#
# Asciidoc will be used to generate other formats later
#
MANDOCS = man/cinit.text man/halt.kill.text man/poweroff.kill.text \
man/reboot.kill.text man/cmd.text
USERDOCS = user/compiles.on.text user/configuring.cinit.text \
user/conf-system.text \
user/cross-compiling.text user/current-init-problems.text \
user/daemons.backgrounding.text user/dependencies.text \
user/example-directory-structure.text \
user/installing-cinit.text user/paths.text \
user/profiles.text user/README.text
DEVELDOCS = devel/codingguideline.text
DOCS = $(MANDOCS) $(USERDOCS) $(DEVELDOCS)
#
# Doku
#
HTMLDOCS = $(DOCS:.text=.html)
DBHTMLDOCS = $(DOCS:.text=.htm)
#TEXIDOCS = $(DOCS:.text=.texi)
MANPDOCS = $(MANDOCS:.text=.man)
DOCBDOCS = $(DOCS:.text=.docbook)
DOC_ALL = $(HTMLDOCS) $(DBHTMLDOCS) $(TEXIDOCS) $(MANPDOCS)
#
# End user targets
#
help:
@echo "----------- documentation make targets --------------"
@echo "documentation: generate HTML, Texinfo and manpage"
@echo "html: only generate HTML (via asciidoc/docbook/xsltproc)"
@echo "htm: only generate HTML (via asciidoc)"
@echo "info: only generate Texinfo"
@echo "man: only generate manpages"
@echo "pdf: only generate pdfs (requires: fop)"
install: $(DOC_ALL)
@echo "===> Copy " man/*.[0-9] "to the correct manpaths"
#
# Internal targets
#
html: $(HTMLDOCS)
htm: $(DBHTMLDOCS)
info: $(TEXIDOCS)
man: $(MANPDOCS)
documentation: $(DOC_ALL)
#
# Generic targets
#
# docbook gets .htm, asciidoc directly .html (or the other way round)
%.html: %.docbook
${XSLTPROC} -o $@ ${XSL} $<
%.htm: %.text
${ASCIIDOC} -n -o $@ $<
%.docbook: %.text
${ASCIIDOC} -n -b docbook -o $@ $<
%.texi: %.docbook
${DOCBOOKTOTEXI} --to-stdout $< > $@
%.mandocbook: %.text
${ASCIIDOC} -b docbook -d manpage -o $@ $<
#%.man: %.mandocbook
# ${DOCBOOKTOMAN} --to-stdout $< > $@
%.man: %.text
${A2X} -f manpage $<
%.pdf: %.text
${A2X} -f pdf $<
#
# Distribution
#
clean distclean:
rm -f $(DOC_ALL)
rm -f man/*.texi man/*.xml man/*.[0-9]
#
# Be nice with the users and generate documentation for them
#
dist: distclean documentation
cinit-0.3pre15/doc/README.text 0000664 0000000 0000000 00000002050 11256333254 0015750 0 ustar 00root root 0000000 0000000 cinit/doc
=========
Nico Schottelius
0.1, Initial Version from 2006-11-30
:Author Initials: NS
This directory contains the cinit documentation.
Files and directories in this directory
----------------------------------------
ancient
~~~~~~~
Old documents, only thought to irritate you.
They are not interesting for most people and may contain
obsoleted or wrong information.
braindumps
~~~~~~~~~~
Files I used to make the situation clear to myself.
They are not interesting for most people and may contain
obsoleted or wrong information.
devel
~~~~~
Developer related documents. Contains information for adding code,
for developing external tools to cinit or code guidelines for writing
patches to cinit.
logs
~~~~
Logfiles or raw data dumps.
Makefile
~~~~~~~~
The makefile used to generate the documentation.
man
~~~
Manpages.
README.text
~~~~~~~~~~~
This file
user
~~~~
The most important part: Documentation for users (aka sysadmins,
hackers, endusers?): Explains howto install, configure, use and
debug cinit.
cinit-0.3pre15/doc/ancient/ 0000775 0000000 0000000 00000000000 11256333254 0015531 5 ustar 00root root 0000000 0000000 cinit-0.3pre15/doc/ancient/Changelog 0000664 0000000 0000000 00000000634 11256333254 0017346 0 ustar 00root root 0000000 0000000 Mo Okt 3 00:19:40 CEST 2005
*Changelog can now be found in git database (cg-log)
Sun May 8 12:20:35 CEST 2005
*Changelog can now be found in monotone database (monotone log)
Sat Apr 30 15:53:53 CEST 2005
* add socket code
Tue Apr 26 15:29:53 CEST 2005
* removed is_cinit support, initial messaging framework
Mon Apr 18 14:07:50 CEST 2005
* added is_cinit -> recognize if you are cinit or a fork
cinit-0.3pre15/doc/ancient/README 0000664 0000000 0000000 00000000652 11256333254 0016414 0 ustar 00root root 0000000 0000000 Ancient
=======
Nico Schottelius
0.1, for cinit 0.3, Initial Version from 2006-06-02
These files may be incorrect, outdated, totally wrong or even trying
to take over world dominance.
Why are they still there?
-------------------------
Just because to document the early days of cinit. If you are
a software archaeologist in the year 2423, you'll be happy that
I saved those files.
cinit-0.3pre15/doc/ancient/TODO.lucky 0000664 0000000 0000000 00000002153 11256333254 0017350 0 ustar 00root root 0000000 0000000 18:18 hey, ich hatte gerade ein wenig lust mich mit cinit zu befassen, hier also mein
kleiner bug-report: in src/include fehlt cinit.h, (alles auf das aktuelle
tarball bezogen), ich hab's aus pre9 genommen, hatte ich noch da, da git nicht
wollte(Cannot get remote repository information.), ausserdem hast du _ statt -
in doc/man/cinit.text verwendet bei der email, das mag docbook nicht, die
beiden zeilen habe ich korrigiert, danch ging schon mal make all und auch make
ins
18:35 und warum installiert er die man pages nicht mit?
07:20 so, kleiner zwischenbericht, das argv problem bei lvm gibt es mit pre10 nicht
mehr, d.h. dass man auch kein shell-skript mehr braucht um lvm/luks-devices zu
mounten :)
07:20 soweit sieht eig. alles gut aus
07:21 wenn das so bleibt, dann werd' ich dauerhaft auf cinit umsteigen :)
07:21 und wenn sich die gelegenheit bietet, dann stell ich cinit auch mal in der
info-ag von unserer schule vor :)
cinit-0.3pre15/doc/ancient/caveats 0000664 0000000 0000000 00000004752 11256333254 0017112 0 ustar 00root root 0000000 0000000 --------------------------------------------------------------------------------
'Geheimnisse' in German,
Nico Schottelius, 2005-05-XX (Last Modified: 2005-06-11)
--------------------------------------------------------------------------------
- Dependencies beginning with a '.' (dot) are ignored.
So you can temporarily disable a dependency moving it to
want/.name
- Why is the name of the socket "coala"?
Well, coala could mean 'cinit object abstract layer access', but
perhaps it's a much simpler reason.
- cinit will start a little bit faster if you omit non needed
'wants' and 'needs' dirs as they need to be scanned if they
do not exist
- Currently there is no support to react on 'ctr+alt+del':
1. It is not handled to switch on / off
(Linux: See man 2 reboot and /proc/sys/kernel/ctrl-alt-del)
2. If the kernel handles it and sends signals to cinit
(SIGINT on Linux) they will be ignored.
There is no problem in implementing a handler for this signal,
the only reason why it is not there
(well, a template is in old/sig_special.c) is that nobody
could tell me what would be the most senseful thing to handle
ctrl-alt-del. If you can, I'll perhaps integrate it.
3. ctrl-alt-del is currently disabled under Linux within
the service local-tuning/ctrl-alt-del
- cinit ignores the Keyboard request
Same thing with 'ctr-alt-del': SIGWINCH is sent, but I don't
know what to do when recieving it.
- cinit does not care about its pid
nor does cinit care if it is already running
in serv/cinit.c is a line calling run_init_svc().
If you call that only if getpid() == 1, cinit will behave like sysvinit
and refuse to start if pid is not 1.
Currently cinit has no chance to control whether it's started or
not as /etc/cinit/tmp mounted again for every start.
- cinit will sleep after respawing if ...
a) the service did not terminate normally (!WIFEXITED(status))
b) the service did return a non-zero exit status
- sleeping before rechecking if a service is finished can be optimised
Currently run_svc() checks every SLEEP_RERUN seconds (default: 1),
if the service it should start was finished by another instance
of run_svc(). As run_svc() internally uses nanosleep() for sleeping,
one could modify run_svc to use conf/sleep_rerun as a nanoseconds
value. This would add most likely much often checking, but would
result in faster results from run_svc.
What's the best value for SLEEP_RERUN is currently unknown.
cinit-0.3pre15/doc/ancient/cinit-doc/ 0000775 0000000 0000000 00000000000 11256333254 0017402 5 ustar 00root root 0000000 0000000 cinit-0.3pre15/doc/ancient/cinit-doc/author 0000664 0000000 0000000 00000000067 11256333254 0020632 0 ustar 00root root 0000000 0000000 Nico Schottelius
cinit-0.3pre15/doc/ancient/cinit-doc/availability 0000664 0000000 0000000 00000000043 11256333254 0021774 0 ustar 00root root 0000000 0000000 cinit is currently Linux-specific.
cinit-0.3pre15/doc/ancient/cinit-doc/examples 0000664 0000000 0000000 00000000057 11256333254 0021145 0 ustar 00root root 0000000 0000000 See http://linux.schottelius.org/cinit/#config
cinit-0.3pre15/doc/ancient/cinit-doc/files 0000664 0000000 0000000 00000000330 11256333254 0020423 0 ustar 00root root 0000000 0000000 /sbin/cinit - the init system
/sbin/cservice - control cinit
/sbin/cinit.reboot (/sbin/reboot if non-existent before)
/sbin/cinit.shutdown (/sbin/shutdown if non-existent before)
/etc/cinit - configuration directory
cinit-0.3pre15/doc/ancient/cinit-doc/long_description 0000664 0000000 0000000 00000000544 11256333254 0022672 0 ustar 00root root 0000000 0000000 cinit is a fast executing, small and simple init with support for profiles. It
minds dependencies (hard and soft, 'needs' and 'wants') and executes processes
in parallel. And it has a simple configuration, which makes many shell-scripts
unecessary (but you still could use them if you really want), which leads to
better performance and less memory using.
cinit-0.3pre15/doc/ancient/cinit-doc/meta/ 0000775 0000000 0000000 00000000000 11256333254 0020330 5 ustar 00root root 0000000 0000000 cinit-0.3pre15/doc/ancient/cinit-doc/meta/date 0000664 0000000 0000000 00000000013 11256333254 0021162 0 ustar 00root root 0000000 0000000 2005-08-21
cinit-0.3pre15/doc/ancient/cinit-doc/meta/man_section 0000664 0000000 0000000 00000000002 11256333254 0022542 0 ustar 00root root 0000000 0000000 8
cinit-0.3pre15/doc/ancient/cinit-doc/meta/name 0000664 0000000 0000000 00000000006 11256333254 0021167 0 ustar 00root root 0000000 0000000 cinit
cinit-0.3pre15/doc/ancient/cinit-doc/meta/short_description 0000664 0000000 0000000 00000000073 11256333254 0024015 0 ustar 00root root 0000000 0000000 fast executing, small and simple init with profile-support
cinit-0.3pre15/doc/ancient/cinit-doc/parameters 0000664 0000000 0000000 00000000026 11256333254 0021466 0 ustar 00root root 0000000 0000000 cprofile:
cinit-0.3pre15/doc/ancient/cinit-doc/path 0000664 0000000 0000000 00000000014 11256333254 0020254 0 ustar 00root root 0000000 0000000 /sbin/cinit
cinit-0.3pre15/doc/ancient/cinit-doc/see also 0000664 0000000 0000000 00000000044 11256333254 0021016 0 ustar 00root root 0000000 0000000 http://linux.schottelius.org/cinit/
cinit-0.3pre15/doc/ancient/cinit-doc/synopsis 0000664 0000000 0000000 00000000015 11256333254 0021210 0 ustar 00root root 0000000 0000000 /sbin/cinit
cinit-0.3pre15/doc/ancient/cinit.commands 0000664 0000000 0000000 00000005440 11256333254 0020365 0 ustar 00root root 0000000 0000000 --------------------------------------------------------------------------------
cinit commands,
Nico Schottelius 2005-04-28 (Last Modified: 2005-06-11)
--------------------------------------------------------------------------------
cinit allows communication through a socket (see ipc.thoughs for reasons).
Sockets allow to find out the accessing uid, gid and pid (using SO_PEERCRED as
socketoption).
The communication-protocol is binary, the implementation can be found
in comm/* mostly (clients use begin_msg() and server sigio() additonally).
--------------------------------------------------------------------------------
Protocol overview
--------------------------------------------------------------------------------
Any communication begins with a command. A command is a one byte
unsigned char. Depending on the command, the communication has its own
semantics.
Commands are: (values can be found in cinit.h)
CMD_START_SVC: I want to start a service.
CMD_CHG_STATUS: I want to change the status of a service.
CMD_STOP_SVC: Please shutdown a service.
CMD_RESCUE: Kill everything, and spawn a sulogin shell.
CMD_UPDATE: Hot-reboot system and reload cinit.
CMD_HALT: Halt the system
CMD_REBOOT: Reboot the system
CMD_POWEROFF: Power-off the system
--------------------------------------------------------------------------------
Detailled command-listing
--------------------------------------------------------------------------------
CMD_START_SVC
1. int len; /* length of service name, including \0 */
2. char *svc; /* name of the service, absolute pathname */
cinit returns:
a) status of service
b) fail
CMD_CHG_STATUS: I want to change the status of a service.
0. int len;
1. char *svc;
2. char status; /* status:
once: started successfully the service once.
fail: tried to start once, but the service exit ungracefully
respawn: I am on it, as soon it exists I'll restart! */
2. pid_t pid /* the pid of the service, if started once
or the pid of the service watcher, if respawning */
cinit returns: MSG_OK|MSG_FAIL (char)
CMD_STOP_SVC: Please shutdown a service and its dependencies.
1. int len; /* length of service name, including \0 */
2. char *svc; /* name of the service, absolute pathname */
cinit returns: Status of service (should be ST_OFF)
The following commands do not return anything nor do they need any parameter:
CMD_RESCUE: Kill everything, and spawn a sulogin shell. Irreversible.
CMD_HALT: Halt the system.
CMD_REBOOT: Reboot the system.
CMD_POWEROFF: Power-off the system.
CMD_UPDATE: Update cinit, hot-reboot the system.
cinit-0.3pre15/doc/ancient/cservice-doc/ 0000775 0000000 0000000 00000000000 11256333254 0020077 5 ustar 00root root 0000000 0000000 cinit-0.3pre15/doc/ancient/cservice-doc/author 0000664 0000000 0000000 00000000067 11256333254 0021327 0 ustar 00root root 0000000 0000000 Nico Schottelius
cinit-0.3pre15/doc/ancient/cservice-doc/long_description 0000664 0000000 0000000 00000000072 11256333254 0023363 0 ustar 00root root 0000000 0000000 cservice controls cinit. Please use cservice -h for help.
cinit-0.3pre15/doc/ancient/cservice-doc/meta/ 0000775 0000000 0000000 00000000000 11256333254 0021025 5 ustar 00root root 0000000 0000000 cinit-0.3pre15/doc/ancient/cservice-doc/meta/date 0000664 0000000 0000000 00000000013 11256333254 0021657 0 ustar 00root root 0000000 0000000 2005-08-21
cinit-0.3pre15/doc/ancient/cservice-doc/meta/man_section 0000664 0000000 0000000 00000000002 11256333254 0023237 0 ustar 00root root 0000000 0000000 8
cinit-0.3pre15/doc/ancient/cservice-doc/meta/name 0000664 0000000 0000000 00000000011 11256333254 0021660 0 ustar 00root root 0000000 0000000 cservice
cinit-0.3pre15/doc/ancient/cservice-doc/meta/short_description 0000664 0000000 0000000 00000000073 11256333254 0024512 0 ustar 00root root 0000000 0000000 fast executing, small and simple init with profile-support
cinit-0.3pre15/doc/ancient/cservice-doc/parameters 0000664 0000000 0000000 00000000022 11256333254 0022157 0 ustar 00root root 0000000 0000000 [-eaphru] [thilo]
cinit-0.3pre15/doc/ancient/cservice-doc/path 0000664 0000000 0000000 00000000017 11256333254 0020754 0 ustar 00root root 0000000 0000000 /sbin/cservice
cinit-0.3pre15/doc/ancient/cservice-doc/see also 0000664 0000000 0000000 00000000044 11256333254 0021513 0 ustar 00root root 0000000 0000000 http://linux.schottelius.org/cinit/
cinit-0.3pre15/doc/ancient/cservice-doc/synopsis 0000664 0000000 0000000 00000000015 11256333254 0021705 0 ustar 00root root 0000000 0000000 /sbin/cinit
cinit-0.3pre15/doc/ancient/extern/ 0000775 0000000 0000000 00000000000 11256333254 0017036 5 ustar 00root root 0000000 0000000 cinit-0.3pre15/doc/ancient/extern/README 0000664 0000000 0000000 00000000104 11256333254 0017711 0 ustar 00root root 0000000 0000000 doc/extern/
Some things related to cinit from the outside world.
cinit-0.3pre15/doc/ancient/extern/ipc.thoughts 0000664 0000000 0000000 00000005062 11256333254 0021403 0 ustar 00root root 0000000 0000000 --------------------------------------------------------------------------------
Thoughts about different UNIX-IPC,
Nico Schottelius, 2005-04-28 (Last Modified: 2005-06-11)
--------------------------------------------------------------------------------
Howto cinit communicates with
a) cinit-forks
b) any other program
a) cinit-forks
a.1) shared memory
Access could generally be done with shared memory. The problem with
that is, that -lrt is required, which implicits -lpthread, which
makes linking staticly problematic (at least for glibc).
a.2) pipes
A maximum of ~510 pipes could be used ( (1024-3)/2 ),
1024 is the maximum opened file deskriptors,
minus 3 (stdin/stdout/stderr) already opened, divided
by two, because two fds needed per client.
Pipes cannot be used easily through forks of forks.
a.3) fifos
FIFOs are easy to use, but you would need to create two FIFOs
for _every_ service, as with only two FIFOs we cannot reliable
detect, _who_ is writting to us currently and who wants to read.
The same limit as above is true for fifo, too: A maximum of ~510
services.
a.4) system-v-ipc
No documentation found nor tested.
a.5) sockets
Are indeed a very clean way. There's only one problem:
bind() fails on read-only mounted devices:
- The socket either does not exists and cannot be created
- or the socket exists, but bind() refuses to reuse it
(error: Address already in use)
Imho bind() should even honour the socket-option SO_REUSEADDR,
which allows to re-use a socket, if there's no other program bound to.
As far as I can see, SO_REUSEADDR is only honoured, if socket is of
type PF_INET (we use PF_UNIX) and POSIX does only specify how to
check for support, but not that sockets have to be able to use
SO_REUSEADDR (see posix.aardvark.bug.report).
That way, we are forced to mount a temporarily filesystem on
/etc/cinit/tmp and create the socket below this directory. This is not
the clean and easy solution one would wish. Still, sockets
seem to be the cleanest and most reliable way to have IPC for
this situation.
See socket(2), bind(2), listen(2), accept(2), socket(7) and unix(7)
for help.
b) any other program
What you can do is to tell cinit to
- reboot,
- halt,
- poweroff,
- update itself (hot-reboot)
- and to start a rescue mode (see using.rescue).
Simple send cinit a signal, what to do:
HUP: reboot
USR1: halt
USR2: rescue
TERM: poweroff
CONT: update
See signal(2) and signal(7) for help and serv/sig_reboot.c for implementation.
--------------------------------------------------------------------------------
cinit-0.3pre15/doc/ancient/extern/ipc.usenet.posting 0000664 0000000 0000000 00000003036 11256333254 0022522 0 ustar 00root root 0000000 0000000 From: Nico Schottelius
Subject: Unix IPC, socket/AF_UNIX; bind on r/o devices?
Date: 09 May 2005 09:51:27 GMT
To: comp.unix.programmer
Hello!
Situation:
- everything mounted readonly (as when starting the system)
- one process with n children, which may have n children (recursive)
- all the children and children of children should be able to talk to the
first parent
Problem:
- Using bind() will fail, because
a) socket cannot created
b) the existing socket cannot be reused
Other possibilities not working:
- shared memory is not an option, as one need
-lrt, which needs -lpthread, which is problematic to link statically
- pipes: handling the pipes from parent to child of child of child
would be hard to program
- socketpair: should be the same problematic as it's with pipes
- fifos: one would have to create the fifos before and two fifos
for each child; possible, but very unelegant; and one would have
to memorize, which child is connected to which fifo; again possible,
but somehow unelegant
- signaling: one could implement communication with some kind of
morse code with signals, but that won't be a good solution
Questions:
- Is there any way, case b) (socket already existing) can be solved in
a way that I tell bind() to use an existing socket?
- What would be the best solution to talk bidirectional to clients
in this scenario?
I appreciate any hint, as I really like the socket mechanism and would
like to keep it.
Thanks in advance,
Nico
cinit-0.3pre15/doc/ancient/extern/linux.kernel.eats.arguments 0000664 0000000 0000000 00000002447 11256333254 0024345 0 ustar 00root root 0000000 0000000 --------------------------------------------------------------------------------
Linux, the kernel, eats arguments
Nico Schottelius 2005-06-17 (Last Modified: 2005-06-17)
--------------------------------------------------------------------------------
If you specify
variable=value
to the Linux kernel, the argument will NOT be passed to cinit.
Here's the relevant code block from init/main.c of the Linux kernel:
-------------------------------------------------------------------------------
From init(void * unused) the function run_init_process(char *init_filename)
is called, which passes argv_init (char * argv_init[MAX_INIT_ARGS+2]) to init.
First init_setup(char *str) resets all elements of the argv_init to NULL.
The function unknown_bootoption(char *param, char *val) fills the
argv_init array, but only with parameters, which have no value
(val).
The function parse_args calls unknown_bootoption with the unknown options.
-------------------------------------------------------------------------------
This way the profile support in all cinit versions below cinit-0.1 will
only work if you change conf/profile, because "cprofile=value" will
not be given to cinit, because it's not treated as a command line option.
The original value "cprofile=" is replaced by "cprofile:" as of cinit-0.1.
cinit-0.3pre15/doc/ancient/extern/posix.aardvark.bug.report 0000664 0000000 0000000 00000003317 11256333254 0024007 0 ustar 00root root 0000000 0000000 To: austin-review-l__AT__opengroup.org
From: nico-posix__AT__schottelius.org
Subject: Bug in TC2-d6 bind - bind a name to a socket
Reply-To: austin-group-l__AT__opengroup.org
Bug report from : Nico Schottelius , cLinux
(Note that the reply-to line automatically redirects
to austin-group-l__AT__opengroup.org for further discussion on bug reports)
@ page 1 line 0 section bind - bind a name to a socket objection {-1}
Problem:
bind should 'assign a name to a socket', but in particular environments it will fail, where it could succeed.
Long Description:
When opening a new socket, with type PF_UNIX
(sock = socket(PF_UNIX,SOCK_STREAM,0);) and one sets
the socket option SO_REUSEADDR
(setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, &tmp, sizeof(tmp))),
bind does not honour this setting.
It is reported on irc channels, that SO_REUSEADDR is only supported on
PF_INET sockets and that's what I would claim a bug.
If a socket exists in the filesystem and no process is bound to
it, bind wail fail anyway.
This is especially problematic, when one is in an environment,
which is pre-startup (like beeing init) and one wants to use
sockets, but everything is mounted read-only.
So, if bind() would honour the option, it would be able
to bind() to a socket, which exists (as creating one on a
read-only filesystem is not possible).
Action:
Proposal:
Add better specification to either socket(7) or bind(2), which
explains the behaviour of bind, when this option is set
or even better: Specify, that bind should take care of this bit,
also when using PF_UNIX.
In general the socket(7) manpage should explain more in detail
or at least reference other documents (unix(7)?), which explain what the
option for a specific protocol does.
cinit-0.3pre15/doc/ancient/fun-testing 0000664 0000000 0000000 00000000373 11256333254 0017722 0 ustar 00root root 0000000 0000000 kind tot 17 ...
Read path: /
Read path: e
Read path: t
Read path: c
Read path: /
Read path: c
Read path: i
Read path: n
Read path: i
Read path: t
Read path: /
Read path: t
Read path: e
Read path: s
Read path: t
Read path: s
Read path: v
Read path: c
cinit-0.3pre15/doc/ancient/how_it_works_internally 0000664 0000000 0000000 00000001501 11256333254 0022430 0 ustar 00root root 0000000 0000000 The following is a very simple process structure of cinit internals:
cinit-main starts
\
|-> execute run_init_svc()
| \ run_svc(CINIT_INIT);
| | check status <-------------------\
| | set status = temp |
| \ check dependencies |
| | fork(run_svc()) for every WANT |
| | run_svc() for every NEED /
| / check if respawning { do .. while(repawn?)
| \ yes: (remember: run_svc _must_ return!)
| | msg_change_status(respawn)
| | add watcher_signal handler to stop! (SIGTERM)
| | fork(exec_svc) <--|
| | waitpid(fork) | while(1) { ... }
| \ sleep(WAIT_SECS) ---/
| | no: fork(exec_svc)
| \ waitpid(fork) -> yes, wait!
| | msg_change_status
| /
| /
| -> while(1)
| - listen to signals
| - listen on socket
cinit-0.3pre15/doc/ancient/init-idea-first 0000664 0000000 0000000 00000001270 11256333254 0020444 0 ustar 00root root 0000000 0000000 - restarting/respawning
touch respawn
- dependencies
a needs started b
- clean multiply dependencies
- start & stop dependencies
start_depends
stop_depends
- parallel executation
- start and stop commands
start -> link
start_param -> parameters, like minit
stop -> link
stop_param -> parameters, like minit
if no stop command is available, try to kill the pid we started at stop
/startup/
start_depends=gettys
/shutdown/
stop_depends=power_off
gettys/
start_depends=getty/1
start_depends=getty/2
start_depends=getty/3
start_depends=getty/4 ...
getty/1/
start=/sbin/fgetty
respawn
power_off/
stop_depend=umount
umount/
stop_depend=
cinit-0.3pre15/doc/ancient/porting.to.other.os 0000664 0000000 0000000 00000001757 11256333254 0021331 0 ustar 00root root 0000000 0000000 --------------------------------------------------------------------------------
Porting cinit to other operating systems,
Nico Schottelius, 2005-06-02
--------------------------------------------------------------------------------
cinit is currently Linux-specific.
It currently does not compile / work on other Unices, because
we use O_ASYNC flag of open(2) which is _not_ a standard.
This way we can act very elegant on incoming connections by our
forks. If somebody finds a at least as elegant solution
to act on incoming data which is more portable, I would
be happy to recieve a diff -u.
Additionally we currently do mount a temporarily filesystem
on /etc/cinit/tmp, which allows us to create a socket, where
nothing is mounted r/w yet.
If a Unix has some kind of tmpfs, this can easily be changed
to the appropriate value in conf/*tmp*.
The O_ASYNC thing will perhaps become a compile option to cinit
(via conf/socket_function for instance), so that using standard
mechanism will be possible.
cinit-0.3pre15/doc/ancient/removing.zombies 0000664 0000000 0000000 00000004426 11256333254 0020757 0 ustar 00root root 0000000 0000000 --------------------------------------------------------------------------------
Removing Zombies,
Nico Schottelius 2005-06-15 (Last Modified: 2005-06-15)
--------------------------------------------------------------------------------
First of all, the definition of a zombie:
''Defunct ("zombie") process, terminated but not reaped by its parent.''
[Excerpt from ps(1)]
''In the case of a terminated child, performing a wait allows the system to
release the resources associated with the child; if a wait is not performed,
then terminated the child remains in a "zombie" state (see NOTES below).
[...]
NOTES
A child that terminates, but has not been waited for becomes a "zom-
bie". The kernel maintains a minimal set of information about the
zombie process (PID, termination status, resource usage information)
in order to allow the parent to later perform a wait to obtain
information about the child. As long as a zombie is not removed
from the system via a wait, it will consume a slot in the kernel
process table, and if this table fills, it will not be possible to
create further processes. If a parent process terminates, then its
"zombie" children (if any) are adopted by init(8), which automati-
cally performs a wait to remove the zombies.''
[Excerpt from waitpid(2)]
So you can see, that if some process misbehaves and forgets about
its children, we, cinit, will adopt it. In the first versions of
cinit (cinit-0.0.1 <-> cinit-0.0.7) we ignored SIGCHLD. This way
the zombies stayed in the system. Since cinit-0.0.8 we have
sig_chld(), which removes the zombies.
So far so good. Now let's remove this feature. Yes, you heard right.
If cinit does not catch the zombies they will stay in the system.
Yes, that's ugly. And that's how it should be. You should see, which
software is broken and should contact the authors to fix it.
To restore the 'old' behaviour of cinit, change
generic/set_signals.c (ignore SIGCHLD)
Makefile: remove serv/sig_child.c from modules list
cinit in general will keep the behaviour of reaping the vestiges,
which broken software left behind (as it is cleaner for the system to
deallocate unused ressources).
cinit-0.3pre15/doc/ancient/security 0000664 0000000 0000000 00000002515 11256333254 0017326 0 ustar 00root root 0000000 0000000 --------------------------------------------------------------------------------
security,
Nico Schottelius 2005-06-13 (Last Modified: 2005-06-14)
--------------------------------------------------------------------------------
A little note about cinit security and how to exploit it:
cinit trusts its socket, /etc/cinit/tmp/coala. If somebody not
authorised has access to it, your system is taken over.
Through this socket anybody with write access can:
- shutdown, restart and power-off the host
- spawn a local unprotected shell
- execute anything as the user cinit runs (most likely root)
Currently cinit does not care very much about the socket permissions.
On my system this creates a socket with srwxr-x-rx permissions, which
isi suitable for normal operation, which will not accept connect()
by others than root.
But you can also loosen the security and allow people from a specfic group
to control your system:
ei # chmod 770 /etc/cinit/tmp/coala
ei # chown root:cinit /etc/cinit/tmp/coala
Now everybody in the cinit group can control your system.
Please think twice before doing that, as you read above, anyone from
the cinit group may start a root shell on the initial console then!
For extra parnoid settings you can do the following:
ei # chmod 700 /etc/cinit/tmp/coala
ei # chown root:root /etc/cinit/tmp/coala
cinit-0.3pre15/doc/ancient/socket.poll_vs_o_async 0000664 0000000 0000000 00000002437 11256333254 0022142 0 ustar 00root root 0000000 0000000 --------------------------------------------------------------------------------
Socket: poll(2) vs. O_ASYNC,
Nico Schottelius 2005-06-22 (Last Modified: 2005-06-22)
--------------------------------------------------------------------------------
0. General problem
1. O_ASYNC
2. poll(2)
0. General problem
cinit has to react, as soon as there's data on the socket.
1. O_ASYNC
When you open a socket with O_ASYNC (or specify it with fcntl(2)) under
Linux, your process recieves the SIGIO signal from the kernel, as soon
as data is available.
The problem is the handling of signals seems not to be serialised:
The function, which is called on the SIGIO signal (called sigio() here)
calls other functions. Those functions way recieve SIGIO while working,
so the first data stream is not yet finished, though the next
stream is beeing read.
This gives very nice race-conditions, which are very nice to debug.
2. poll(2)
poll(2) is a standard Unix-call (XPG4-UNIX), which waits a specific
timeout (or infinite time if you specify a value less that zero) for
the socket (or the fd in general) to be in a state where
data is available to read (in fact poll can do much more, but we are
not interested only in POLLIN and POLLPRI).
While poll(2) seems to be a very bit slower than sigio it works reliable.
cinit-0.3pre15/doc/ancient/thoughts.closed 0000664 0000000 0000000 00000004156 11256333254 0020577 0 ustar 00root root 0000000 0000000 --------------------------------------------------------------------------------
Closed thoughts,
Nico Schottelius, 2005-05-XX (Last Modified: 2005-06-14)
--------------------------------------------------------------------------------
1. using SIDs (service IDs) to communicated with external processes
This was a very bad idea: The external program could exploit us by
specifying an arbitary big SID (as the SID is simply the index
of our service array).
2. using function pointers to handle messages
Seems like it works fine. We have handlers for each
message (do_*), which are called by client and server.
The function pointer is simply to read or write, dependending
if it is the client or the server. This way we don't need
to rewrite communications parts.
3. Using different storage
First all services were saved in a service array of the size
MAX_SVC. This has been replaced by a double-linked list.
Have a look at serv/list.c.
4. Using sockets for IPC (between cinit forks)
Works very fine, though we have to mount a temporarily fs before.
5. Removing the maximum number of direct dependencies
Is not planned, as it looks like the current number (32, see
conf/max_deps) seems to be much more than needed. And if
one really needs more, simply increase conf/max_deps.
6. Using a directory params with 1,2,3,4 for argv
This would make substituting a single argument easier, but only
if you know which one you have to change. This would add
an additional dirent(), which would not replace the current read(), but
add more open() and close()s. As this does not seem to make live
easier for system administrators, this is not implemented.
If you really like it, hack client/exec_svc.c
7. Using TCP/IP sockets
This would be a very small change in the code, but would allow
to control cinit over network. Since there is no authentication,
this would be highly insecure. On the other hand, cinit
could control the parallel start of many hosts, if they
should become 'one' computer at the end. As this is not needed
currently, it's not implemented.
cinit-0.3pre15/doc/braindumps/ 0000775 0000000 0000000 00000000000 11256333254 0016254 5 ustar 00root root 0000000 0000000 cinit-0.3pre15/doc/braindumps/README.text 0000664 0000000 0000000 00000000162 11256333254 0020116 0 ustar 00root root 0000000 0000000 DO NOT READ CONTENT IN THIS DIRECTORY.
(or at least do not blame me, if you get really confused after reading it)
cinit-0.3pre15/doc/braindumps/circular-dependencies.text 0000664 0000000 0000000 00000002456 11256333254 0023421 0 ustar 00root root 0000000 0000000 What todo with circular dependencies?
a needs b
b needs a
- try to start them?
status a: is_starting
status b: not_set
a wants b, so a service starter for b starts
status a: is_starting, waiting for b
status b: is_starting
service starter for b sees that a is needed
service starter for b sees that a is already being started
service starter for b begins to execute b
status a: is_starting, waiting for b
status b: is_starting, executing "on"
service starter b finishes
status a: is_starting, waiting for b
status b: FAILED | RESPAWN | ONCE
service a continues
b successful: execute on
b failed: register / print that we do not start, because
b failed
-> this would only catch possible deadlocks, if the dependency
tree / status check is done dynamically
-> in case of pre-building the dep-tree this situation must
be concerned:
- start both a and b?
- or stop due to circular dependency?
- Abort on detection of a circular dependency
* possible without pre-calculating?
- perhaps only with direct communication possible?
* pre calculate
- do not start that services?
cinit-0.3pre15/doc/braindumps/converting-debian 0000664 0000000 0000000 00000001140 11256333254 0021571 0 ustar 00root root 0000000 0000000 # If you would like to automatically convert a debian system, you could
# use this script as a start point
#
# how it could look like
#
# create cinit base configuration
# analyse enabled services
level=$(awk -F: '/^id/ { print $2 }' /etc/inittab)
rcdir="/etc/rc${level}.d/"
initdir=/etc/init.d
cd "$rcdir"
for svc in *; do
if [ -d "${debian_map_dir}/${svc}" ]; then
echo "Adding $svc"
else
fi
done
# Also add existing services in /etc/init.d
for ...
if [ ! -e $rcdir/$svc ]
if [ -d "${debian_map_dir}/${svc}" ]; then
echo "Adding, but not enabling"
fi
fi
done
cinit-0.3pre15/doc/braindumps/converting-general 0000664 0000000 0000000 00000000201 11256333254 0021761 0 ustar 00root root 0000000 0000000 kern=$(uname -s)
case "${kern}" in
$known_kern)
$scriptdir/$kern
;;
*)
echo "Unknown system"
;;
esac
cinit-0.3pre15/doc/braindumps/creating-new-configurations 0000664 0000000 0000000 00000000241 11256333254 0023607 0 ustar 00root root 0000000 0000000 scripts/create_baseconfig.sh # create base
scripts/cinit.install.standard.dirs # create common categories
- create fsck
- set hostname
- create getty(s)
cinit-0.3pre15/doc/braindumps/messages.text 0000664 0000000 0000000 00000000243 11256333254 0020770 0 ustar 00root root 0000000 0000000 This document describes the messages used between cinit and its
"clients" (i.e. ccontrol, cservice, cinit.halt, ...):
Signal messages
---------------
As signals
cinit-0.3pre15/doc/braindumps/possible_service_pre_calculation.text 0000664 0000000 0000000 00000001367 11256333254 0025755 0 ustar 00root root 0000000 0000000 - start at
* create a new service entry (if not exists) <---
* reads needs |
- follow dependencies ------------------------
* only if service does not yet exist! |
* read wants |
- follow dependencies ------------------------
* only if service does not yet exist!
* create
- needed by entry in dependencies
- needs entry in service
- wanted by entry in dependencies
- wants entry in service
* record
- (on,off)(,.env,.params)?
- alternatively put that code into service starter
* add services without further needs into a special
"begin" structure to be reused at fireing of the services?
cinit-0.3pre15/doc/braindumps/possible_service_status.text 0000664 0000000 0000000 00000001033 11256333254 0024122 0 ustar 00root root 0000000 0000000
- NOT_SET: this service has not yet been initialized
- RESPAWNING: happily respawning
- RESPAWN_DELAY: waiting delay before restarting
* HINT: using alarm()?
- senseful for single process service watcher
* HINT: using nanosleep()?
- senseful for per service process watcher
- NEED_FAILED
* add a (somehow terminated) list of services that failed?
* use global status to checkout which services failed?
- WANT_FAILED?
* NOT NECESSARY, it is a simple want, we do not need it.
cinit-0.3pre15/doc/braindumps/registering_needs_wants.text 0000664 0000000 0000000 00000001670 11256333254 0024102 0 ustar 00root root 0000000 0000000 Each service has a list of services it
- needs
- is needed by
- wants
- is wanted by
Each entry is a service pointer.
The simplest list could look like this:
service a:
needs:
b f g NULL
So the needs pointer is NULL terminated:
needs = realloc(count_links)
-> how to get the count?
0x02
0x
Better: A double linked list (like the main service list)?
Could look like:
service a:
needs:
*service
*next
*prev
This design could also be used for wants.
On the other hand, we've to register us at the needed/wanted service:
service b:
needed_by:
*service
*next
*prev
So each service needs four pointers:
needs
needed_by
wants
wanted_by
And on each request both lists have to be modified!
Example:
Service "a" adds "b" as needed:
- add "a" needs "b"
- add "b" needed_by "a"
cinit-0.3pre15/doc/braindumps/root-vm-testing 0000664 0000000 0000000 00000000430 11256333254 0021252 0 ustar 00root root 0000000 0000000 [19:33] denkbrett:root% cat uml-mount.sh
SDIR=$(dirname $0)
DDIR=$(dirname $0)/root
sudo mount "$SDIR/Debian-3.0r0.ext2" "$DDIR" -o loop,acl
denkbrett# tar cfj ~nico/projekte/cinit/conf-vm-2007-03-05.tar.bz2 cinit
denkbrett# chown -R nico cinit
denkbrett# chown nico ../sbin
cinit-0.3pre15/doc/braindumps/shutdown.text 0000664 0000000 0000000 00000005044 11256333254 0021040 0 ustar 00root root 0000000 0000000 cinit - braindumps - shutdown
=============================
Nico Schottelius
v0.1, for cinit-0.3, 2007-01-11
:Author Initials: NS
Just some braindumps. Do not read.
Introduction
------------
Shutting down the system.
When?
-----
- reboot
- halt
- power off
- further needed?
How / What?
------------
- Stop services in the correct order
* reuse the service tree / needs / needed_by!
* call off, if existent
* if respawning, send SIGTERM?
- not if off is existent?
* give some variables to off?
- $RESPAWN_PID: if respawning
- send SIGTERM to other apps?
* or put that into special? special/post_svc_shutdown
- call special/{halt,poweroff,reboot}
* no, implemented that directly into cinit!
- implement timely controlled shutdown:
* cinit.shutdown forks (?) itself and waits, then sends a signal
to cinit to initiate the shutdown process
* create mappers for target OS
- Linux
- {free,net,open}bsd
- others may contribute theirself
- also implement poweroff
* kill -TERM 1
- also implement reboot
* kill -HUP 1
- also implement halt
* kill -USR1 1
The implementation
-----------------
x shutdown is initiated
x disable communication (nobody can influence us anymore)
x install special signal handler?
- no. we do not care about zombies anymore, we are gone soon anyway
- simply reset to the default
- begin to shutdown services
* where to start?
* begin shutdown at the end of the tree, viewing/sorting it by the 'needed_by'
-> where to begin sort?
-> worst implementation: scan all services (easy for now)
-> result: list of services, that noone needs :-)
* stop those services and step above
- stop a service, as soon as noone needs it anymore
* check all needed_by links
* more or less the inverted gen_svc_tree
- how to shutdown a service
* if existing, call off
- if off does not exist:
* if respawn: send sigterm to the process
* also implement sigkill at this stage?
- think we can delay it to the end
- otherwise users can use off!
- implement environment for off ($cinit_respawn_pid, $cinit_service_name)
- do *NOT* care about the return value, we can't do anything for it
anymore anyway
- after all services are shutdown, kill all remaining services
* SIGTERM
* wait(defined_time_in_seconds)
* SIGKILL
- call the last command
* to cleanup the system
- umount -a (if needed)
- swapoff (if needed)
- sync (if needed)
- switch off
cinit-0.3pre15/doc/braindumps/sizes 0000664 0000000 0000000 00000000274 11256333254 0017337 0 ustar 00root root 0000000 0000000 sysvinit:
root 1 0.0 0.0 1944 648 ? Ss 02:12 0:00 init [2]
cinit-0.3pre8-glibc-linux:
compiler 25323 0.0 0.0 1564 392 pts/2 S+ 20:22 0:00 ./cinit
cinit-0.3pre15/doc/changes/ 0000775 0000000 0000000 00000000000 11256333254 0015520 5 ustar 00root root 0000000 0000000 cinit-0.3pre15/doc/changes/0.3pre15 0000664 0000000 0000000 00000000153 11256333254 0016617 0 ustar 00root root 0000000 0000000 Released: 2009-09-23
Changes:
* Changed child handling (no function calls in sig_child handler anymore)
cinit-0.3pre15/doc/changes/00-before-0.3pre15 0000664 0000000 0000000 00000010224 11256333254 0020274 0 ustar 00root root 0000000 0000000 cinit-0.3pre14: 2008-03-17
- Added test-suite for cmd
- Added support to shutdown services in cinit and cmd
(without needs and wants)
- Added linux-sysvinit wrapper for shutdown (See
scripts/wrapper/linux-sysvinit/shutdown)
- Rewrote most parts of cmd (to make it more beautiful)
- Changed license to GPL 3.0
cinit-0.3pre13: 2007-09-26
- Added -V (get cmd version), -h (help), -p (get pid) to cmd
- Cleaned up namemsage in msgq.h
- Added global service lock
- Splitted of svc.h to svc.h, svc-intern.h and svc-messages.h
- Prepared logic splitoff from cinit_ipc_listen()
- Fixed bug: fork() has a general race condition
(see src/test/fork-latency.c) through use of global lock
cinit-0.3pre12: 2007-09-06
- Added DESTDIR support
- Added support to get service status via cmd: cmd -s
* also supports relative paths to CINIT_DIR ("/etc/cinit")
- Fixed git clone problem: hooks are needed for dumb git
- Fixed bug: We did not wait for services to finsh, which we depend on being
ran once.
cinit-0.3pre11: 2007-09-01
- Added basic communication:
* client binary "cmd" with argument -v returns cinit-version
- Updated {halt,reboot,poweroff}.kill
cinit-0.3pre10:
- Fixed make install target
- Added halt.kill, poweroff.kill and reboot.kill (including manpages!)
- Fixed invalid comparision in core/cinit.c
- Be verbose: Print what we execute
- Updated documentation
cinit-0.3pre9: 2007-05-15
- Implemented sleeping before respawn (static delay)
- Report broken links on execution, but ignore empty services
- Cleaned up message queue error reporting
cinit-0.3pre8: 2007-04-06
- Updated and merged documentation: Codingstyle and Codingguide
- Cleaned sigaction-code (fixes segfault on glibc)
- Cleaned object listings
- Added notifications at shutdown
- Fixed status check
cinit-0.3pre7: 2007-02-17
- Many code cleanups
- Fixed glibc problem with sigaction (for details view src/core/set_signals.c)
- Added general shutdown support (will *NOT* yet stop services,
but still stop your system)
cinit-0.3pre6:
- Many code cleanups
- Added user documentation and cleaned up documentation in general
cinit-0.3pre5:
- Finished new SIGCHLD handler
- First cleanups for real release.
- This version is the first 0.3pre version that can handle respawn!
cinit-0.3pre4:
- Re-implemented execution of services.
- This version is the first 0.3pre version that COULD bootup your system!
cinit-0.3pre3:
- Finished execution all services via the reversed service tree.
cinit-0.3pre2:
- Finished generation of the dependency tree.
cinit-0.3pre1:
- cinit should now compile on mostly all unices
- introduced much new code
- THIS IS A DEVELOPER RELEASE, NOT USABLE IN PRODUCTION ENVIRONMENTS.
cinit-0.2.1: (Bugfix release)
- Fixed problem in contrib+tools/Makefile when installing
- added many new scripts to convert sys-v-init, which are still early beta
(see bin/cinit.merge.sysvinit-debian-sid)
cinit-0.2:
- Much more verbose error reporting
- You can now also disable 'once ran' services,
- You can restart services with csevice -r
- Online speech in German is available
- C_DELAY support - variable delay for sending SIGKILL after SIGTERM
- First /etc/csys configuration example (wasserstoff) is available
- a Mailing list was created
- Added tools to analyze cinit configuration
(cinit-vis.pl, cinit.graph.text.c)
- Added tools to import and export configuration to XML
(make.cconfig.from.xml.rb,cconfig.graph.xml.rb)
- Removed unecessary signalling
- Added many helper scripts to install services (cinit.install.service*)
- Fixed many small bugs in old helper scripts (cinit.add.getty, cinit.get-conf, ...)
- Added ccontrol, which allows to control cinit
- Added update (-u) via ccontrol
- Stripped cservice, which now "only" controls services
- Removed swapoff from cinit code, should be handled by off
- Much better error and processing descriptions
- A bit more verbose reporting
- Restructured run_svc, now with better error detection
- Removed Kernel panic, when halting system
cinit-0.3pre15/doc/devel/ 0000775 0000000 0000000 00000000000 11256333254 0015207 5 ustar 00root root 0000000 0000000 cinit-0.3pre15/doc/devel/Doxyfile 0000664 0000000 0000000 00000026101 11256333254 0016715 0 ustar 00root root 0000000 0000000 # Doxyfile 1.5.6
#---------------------------------------------------------------------------
# Project related configuration options
#---------------------------------------------------------------------------
DOXYFILE_ENCODING = UTF-8
PROJECT_NAME = cinit
PROJECT_NUMBER = 0.3pre15
OUTPUT_DIRECTORY = /home/user/nico/oeffentlich/computer/projekte/cinit/doxygen
CREATE_SUBDIRS = NO
OUTPUT_LANGUAGE = English
BRIEF_MEMBER_DESC = YES
REPEAT_BRIEF = YES
ABBREVIATE_BRIEF = "The $name class" \
"The $name widget" \
"The $name file" \
is \
provides \
specifies \
contains \
represents \
a \
an \
the
ALWAYS_DETAILED_SEC = NO
INLINE_INHERITED_MEMB = NO
FULL_PATH_NAMES = YES
STRIP_FROM_PATH = /home/user/nico/oeffentlich/computer/projekte/cinit/cinit/src
STRIP_FROM_INC_PATH =
SHORT_NAMES = NO
JAVADOC_AUTOBRIEF = NO
QT_AUTOBRIEF = NO
MULTILINE_CPP_IS_BRIEF = NO
DETAILS_AT_TOP = NO
INHERIT_DOCS = YES
SEPARATE_MEMBER_PAGES = NO
TAB_SIZE = 3
ALIASES =
OPTIMIZE_OUTPUT_FOR_C = YES
OPTIMIZE_OUTPUT_JAVA = NO
OPTIMIZE_FOR_FORTRAN = NO
OPTIMIZE_OUTPUT_VHDL = NO
BUILTIN_STL_SUPPORT = NO
CPP_CLI_SUPPORT = NO
SIP_SUPPORT = NO
IDL_PROPERTY_SUPPORT = YES
DISTRIBUTE_GROUP_DOC = NO
SUBGROUPING = YES
TYPEDEF_HIDES_STRUCT = NO
#---------------------------------------------------------------------------
# Build related configuration options
#---------------------------------------------------------------------------
EXTRACT_ALL = YES
EXTRACT_PRIVATE = YES
EXTRACT_STATIC = YES
EXTRACT_LOCAL_CLASSES = YES
EXTRACT_LOCAL_METHODS = NO
EXTRACT_ANON_NSPACES = NO
HIDE_UNDOC_MEMBERS = NO
HIDE_UNDOC_CLASSES = NO
HIDE_FRIEND_COMPOUNDS = NO
HIDE_IN_BODY_DOCS = NO
INTERNAL_DOCS = NO
CASE_SENSE_NAMES = YES
HIDE_SCOPE_NAMES = NO
SHOW_INCLUDE_FILES = YES
INLINE_INFO = YES
SORT_MEMBER_DOCS = YES
SORT_BRIEF_DOCS = NO
SORT_GROUP_NAMES = NO
SORT_BY_SCOPE_NAME = NO
GENERATE_TODOLIST = YES
GENERATE_TESTLIST = YES
GENERATE_BUGLIST = YES
GENERATE_DEPRECATEDLIST= YES
ENABLED_SECTIONS =
MAX_INITIALIZER_LINES = 30
SHOW_USED_FILES = YES
SHOW_DIRECTORIES = NO
SHOW_FILES = YES
SHOW_NAMESPACES = YES
FILE_VERSION_FILTER =
#---------------------------------------------------------------------------
# configuration options related to warning and progress messages
#---------------------------------------------------------------------------
QUIET = NO
WARNINGS = YES
WARN_IF_UNDOCUMENTED = YES
WARN_IF_DOC_ERROR = YES
WARN_NO_PARAMDOC = NO
WARN_FORMAT = "$file:$line: $text"
WARN_LOGFILE =
#---------------------------------------------------------------------------
# configuration options related to the input files
#---------------------------------------------------------------------------
INPUT = /home/user/nico/oeffentlich/computer/projekte/cinit/cinit/src
INPUT_ENCODING = UTF-8
FILE_PATTERNS = *.c \
*.cc \
*.cxx \
*.cpp \
*.c++ \
*.d \
*.java \
*.ii \
*.ixx \
*.ipp \
*.i++ \
*.inl \
*.h \
*.hh \
*.hxx \
*.hpp \
*.h++ \
*.idl \
*.odl \
*.cs \
*.php \
*.php3 \
*.inc \
*.m \
*.mm \
*.dox \
*.py \
*.f90 \
*.f \
*.vhd \
*.vhdl \
*.C \
*.CC \
*.C++ \
*.II \
*.I++ \
*.H \
*.HH \
*.H++ \
*.CS \
*.PHP \
*.PHP3 \
*.M \
*.MM \
*.PY \
*.F90 \
*.F \
*.VHD \
*.VHDL
RECURSIVE = YES
EXCLUDE = /home/user/nico/oeffentlich/computer/projekte/cinit/cinit/src/ancient/ \
/home/user/nico/oeffentlich/computer/projekte/cinit/cinit/src/test/
EXCLUDE_SYMLINKS = NO
EXCLUDE_PATTERNS =
EXCLUDE_SYMBOLS =
EXAMPLE_PATH =
EXAMPLE_PATTERNS = *
EXAMPLE_RECURSIVE = NO
IMAGE_PATH =
INPUT_FILTER =
FILTER_PATTERNS =
FILTER_SOURCE_FILES = NO
#---------------------------------------------------------------------------
# configuration options related to source browsing
#---------------------------------------------------------------------------
SOURCE_BROWSER = YES
INLINE_SOURCES = NO
STRIP_CODE_COMMENTS = YES
REFERENCED_BY_RELATION = YES
REFERENCES_RELATION = YES
REFERENCES_LINK_SOURCE = YES
USE_HTAGS = NO
VERBATIM_HEADERS = YES
#---------------------------------------------------------------------------
# configuration options related to the alphabetical class index
#---------------------------------------------------------------------------
ALPHABETICAL_INDEX = NO
COLS_IN_ALPHA_INDEX = 5
IGNORE_PREFIX =
#---------------------------------------------------------------------------
# configuration options related to the HTML output
#---------------------------------------------------------------------------
GENERATE_HTML = YES
HTML_OUTPUT = html
HTML_FILE_EXTENSION = .html
HTML_HEADER =
HTML_FOOTER =
HTML_STYLESHEET =
HTML_ALIGN_MEMBERS = YES
GENERATE_HTMLHELP = NO
GENERATE_DOCSET = NO
DOCSET_FEEDNAME = "Doxygen generated docs"
DOCSET_BUNDLE_ID = org.doxygen.Project
HTML_DYNAMIC_SECTIONS = NO
CHM_FILE =
HHC_LOCATION =
GENERATE_CHI = NO
CHM_INDEX_ENCODING =
BINARY_TOC = NO
TOC_EXPAND = NO
DISABLE_INDEX = NO
ENUM_VALUES_PER_LINE = 4
GENERATE_TREEVIEW = NONE
TREEVIEW_WIDTH = 250
FORMULA_FONTSIZE = 10
#---------------------------------------------------------------------------
# configuration options related to the LaTeX output
#---------------------------------------------------------------------------
GENERATE_LATEX = YES
LATEX_OUTPUT = latex
LATEX_CMD_NAME = latex
MAKEINDEX_CMD_NAME = makeindex
COMPACT_LATEX = NO
PAPER_TYPE = a4wide
EXTRA_PACKAGES =
LATEX_HEADER =
PDF_HYPERLINKS = YES
USE_PDFLATEX = YES
LATEX_BATCHMODE = NO
LATEX_HIDE_INDICES = NO
#---------------------------------------------------------------------------
# configuration options related to the RTF output
#---------------------------------------------------------------------------
GENERATE_RTF = NO
RTF_OUTPUT = rtf
COMPACT_RTF = NO
RTF_HYPERLINKS = NO
RTF_STYLESHEET_FILE =
RTF_EXTENSIONS_FILE =
#---------------------------------------------------------------------------
# configuration options related to the man page output
#---------------------------------------------------------------------------
GENERATE_MAN = YES
MAN_OUTPUT = man
MAN_EXTENSION = .3
MAN_LINKS = NO
#---------------------------------------------------------------------------
# configuration options related to the XML output
#---------------------------------------------------------------------------
GENERATE_XML = NO
XML_OUTPUT = xml
XML_SCHEMA =
XML_DTD =
XML_PROGRAMLISTING = YES
#---------------------------------------------------------------------------
# configuration options for the AutoGen Definitions output
#---------------------------------------------------------------------------
GENERATE_AUTOGEN_DEF = NO
#---------------------------------------------------------------------------
# configuration options related to the Perl module output
#---------------------------------------------------------------------------
GENERATE_PERLMOD = NO
PERLMOD_LATEX = NO
PERLMOD_PRETTY = YES
PERLMOD_MAKEVAR_PREFIX =
#---------------------------------------------------------------------------
# Configuration options related to the preprocessor
#---------------------------------------------------------------------------
ENABLE_PREPROCESSING = YES
MACRO_EXPANSION = NO
EXPAND_ONLY_PREDEF = NO
SEARCH_INCLUDES = YES
INCLUDE_PATH =
INCLUDE_FILE_PATTERNS =
PREDEFINED =
EXPAND_AS_DEFINED =
SKIP_FUNCTION_MACROS = YES
#---------------------------------------------------------------------------
# Configuration::additions related to external references
#---------------------------------------------------------------------------
TAGFILES =
GENERATE_TAGFILE =
ALLEXTERNALS = NO
EXTERNAL_GROUPS = YES
PERL_PATH = /usr/bin/perl
#---------------------------------------------------------------------------
# Configuration options related to the dot tool
#---------------------------------------------------------------------------
CLASS_DIAGRAMS = NO
MSCGEN_PATH =
HIDE_UNDOC_RELATIONS = YES
HAVE_DOT = YES
DOT_FONTNAME = FreeSans
DOT_FONTPATH =
CLASS_GRAPH = YES
COLLABORATION_GRAPH = YES
GROUP_GRAPHS = YES
UML_LOOK = NO
TEMPLATE_RELATIONS = NO
INCLUDE_GRAPH = YES
INCLUDED_BY_GRAPH = YES
CALL_GRAPH = NO
CALLER_GRAPH = NO
GRAPHICAL_HIERARCHY = YES
DIRECTORY_GRAPH = YES
DOT_IMAGE_FORMAT = png
DOT_PATH =
DOTFILE_DIRS =
DOT_GRAPH_MAX_NODES = 50
MAX_DOT_GRAPH_DEPTH = 1000
DOT_TRANSPARENT = YES
DOT_MULTI_TARGETS = NO
GENERATE_LEGEND = YES
DOT_CLEANUP = YES
#---------------------------------------------------------------------------
# Configuration::additions related to the search engine
#---------------------------------------------------------------------------
SEARCHENGINE = NO
cinit-0.3pre15/doc/devel/README.text 0000664 0000000 0000000 00000000617 11256333254 0017056 0 ustar 00root root 0000000 0000000 cinit/doc/devel
===============
Nico Schottelius
0.1, Initial Version from 2006-07-09
:Author Initials: NS
This directory contains cinit development documents.
Introduction
------------
This file describes the related documents in the current directory.
Who should read those documents?
--------------------------------
(cinit-)developers.
Content
-------
cinit-0.3pre15/doc/devel/cinit-0.4.text 0000664 0000000 0000000 00000005243 11256333254 0017526 0 ustar 00root root 0000000 0000000 cinit 0.4 - Redesign of cinit
============================================
Nico Schottelius
0.4.0, for cinit 0.4, Initial Version from 2006-03-11
:Author Initials: NS
cinit 0.2 ran fine and the general project of developing a
parallel executing init system is finished.
With cinit 0.4 there are new aims to reach.
Introduction
------------
. AIMS
- portability: no Linux-dependency anymore
- cleaner signal handling
- better documentation so more people can use it
Current problems
----------------
Temporary filesystem and socket problematic
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The mount(2) system call is os-specific.
The temporary fs is os-specific.
Signal handlers are not clean
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Race conditions when multiple signals arrive
Reboot code is os specific
~~~~~~~~~~~~~~~~~~~~~~~~~~
serv/sig_reboot.c contains umount, remount hard coded.
Solutions
---------
Temporary filesystem and socket problematic
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Remove
- the mount call
- do not create an initial socket
Wait until we recieve a signal, then we create a socket
under the configured socket directory (see `conf/sockdir`).
Signal handlers are not clean
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Reboot code is os specific
~~~~~~~~~~~~~~~~~~~~~~~~~~
Misc
~~~~
- Configuration
/etc/cinit/config/
init -> link to initial service
pre_boot
pre_boot_args
post_boot
post_boot_args
/etc/cinit/services/
/etc/cinit/profiles/
links to the starting services
cinit - Internals
=================
Nico Schottelius
0.1 for cinit-0.3, Initial version: So Feb 19 10:25:46 CET 2006
:Author Initials: NS
Introduction
------------
This document describes the internals of cinit. It is thought
to be read by developers.
Child handler code in cinit-0.3
-------------------------------
In cinit versions <= cinit-0.2.1 the respawning services where
handled by an extra child handler, which was a fork of cinit. This
had some problems:
- We allocated more memory than necessary, unecessary parts of
cinit were copied
- The SIG_CHILD-handler was not written very clean, in some versions
it was completly missing.
. So in `cinit-0.3` we changed it the following way:
- no extra child handlers
- handle everything in the SIG_CHILD handling function
- when sig_child is recieved do:
- check against respawn list
- if it is a respawning service, [do the following in a seperate fork?]
check whether it successfully stoped
- if yes: restart immediatly
- if no: sleep $sleep_time and then restart
cinit-0.3pre15/doc/devel/cinit-status-translation.dia 0000664 0000000 0000000 00000011742 11256333254 0022656 0 ustar 00root root 0000000 0000000 ]msF_RUQyr-'ަvvNGD.!˺ں~P;Aa%aH5Ds~?t5i6{sF>$q6Igo~/o_y2^|b6WonO_?<<<.M{4O^_<Ư
볷L"wӫ"U<:gg,|o~bg˼^ΞkUĿ46\./{{SCR$lfǕn*ׇNWW0[kڲƏIg]6?>5A<.үWKˮ'`>ls8[rX*uY!ڻi $ !nvqZg{gd E)1a,YCX٥3Bwb0O8̋
ͧqa~Y+w7;|=zufŶķm6wجyK84ɗ_&Io~%cTST\]ujNzn3#E\n?h2-yUqگu
;7K
Ke0(.s.,\,⪳G|,Ã `2"q1H6v!m5IE'rM՞,m
mv7N;6^|r >vcX|I,Vaq,!o-;:\P!̩qҰ}j0OǛIvu0wCB.3Z3ւ`0^v|IFRL
X]gY^\Z)/;G}[ʌ?+v;wxȞaExE yu}t+<jf.}oWsi/(fڬI
."8;xOr6+/=Xn٤d翾96ϒtd3Xá/l$4XFňbIAkͬ-ڌk-~MtlaZ]!T,\|bp-!2j^P$V
+D"*I9'.?"7͠ZM@ݐә9]KPn|Kxn!ִJ(|MX8.:;1fL!8q~:.~=eaCE[(xVQP"Fll6N\AQuio `Aq0v(Af
({9&Dr"R̦% O81w⤛rHs>◥{c2q[{7*AbHJ};G!Y%zJ(::Ru^Bŷdld2{ɎtI=_=V5PP>M4+*6OzC]0TRVֺ"
MEuE-*۠<HuֱJЊMPpPls~eٞL@1U9oS|{H=Wf/)VuEHU<'nԁ[̞laxD0
[@iPP$2>V&0G3l!l]xn8#;",ή)MɵZda ^pJSz\F.5Nlvmޚ;)EqxXWbfQb؈8Z!%ka~Ԋ0e=x[˿?t)Ev 0s+HčGD$)ZG u+㮵=֍SCp#\ﲐ;ހzBNjey[kW80XfA{1Dlu2z2c0֔^thfd`TmW5O0!e͙="HrH_
.5^Fj&H,+Ƀ/Ѡ:Lǎz옢jHys.;FK6J@֘irGzeWNJC.BH@7Z[&q_F:Ǡ_D1:8ؐu9L-H12s7c eK0b? ` -#;+ A ڪ JQcG
mҚCGsTJo@9L#>2YԜYQ3#_BX~kA+FL0/K8sY9Y9jp
w|
07H:)Pp@CST$Ҭji%n2c)r[㦻BgaR~u%
0K% kSM!'nځ[Z:
?9