add cinit-0.3pre15

Signed-off-by: Nico Schottelius <nico@ikn.schottelius.org>
This commit is contained in:
Nico Schottelius 2009-09-23 08:01:33 +02:00
parent 36de902919
commit 440caeb555
1013 changed files with 99995 additions and 0 deletions

Binary file not shown.

View file

@ -0,0 +1,4 @@
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?

View file

@ -0,0 +1,4 @@
--- !ditz.rubyforge.org,2008-03-06/config
name: Nico Schottelius
email: nico@ikn.schottelius.org
issue_dir: bugs

View file

@ -0,0 +1,31 @@
*.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

View file

@ -0,0 +1,674 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
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.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
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 <http://www.gnu.org/licenses/>.
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:
<program> Copyright (C) <year> <name of author>
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
<http://www.gnu.org/licenses/>.
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
<http://www.gnu.org/philosophy/why-not-lgpl.html>.

View file

@ -0,0 +1,25 @@
--------------------------------------------------------------------------------
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)

View file

@ -0,0 +1,128 @@
#
# 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"

View file

@ -0,0 +1,42 @@
--------------------------------------------------------------------------------
- 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.

View file

@ -0,0 +1,12 @@
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

View file

@ -0,0 +1,106 @@
--------------------------------------------------------------------------------
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 <normal kernel specification> 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<<at>>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/

View file

@ -0,0 +1,115 @@
--------------------------------------------------------------------------------
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

View file

@ -0,0 +1,277 @@
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!)

View file

@ -0,0 +1,16 @@
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

View file

@ -0,0 +1,18 @@
#!/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

View file

@ -0,0 +1,30 @@
#!/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

View file

@ -0,0 +1,31 @@
#!/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` <pidfile> <daemon> [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

View file

@ -0,0 +1,23 @@
--- !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 <nico@ikn.schottelius.org>
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 <nico@ikn.schottelius.org>
- created
- ""

View file

@ -0,0 +1,33 @@
--- !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 <nico@ikn.schottelius.org>
- 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 <nico@ikn.schottelius.org>
- created
- All things to be fixed in the future.

View file

@ -0,0 +1,7 @@
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.

View file

@ -0,0 +1,3 @@
conf
The directory below cinit_dir for cinit configuration.

View file

@ -0,0 +1,4 @@
delay
Name of the file which contains the delay between sending SIGKILL after
SIGTERM for respawning processes.

View file

@ -0,0 +1,5 @@
/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).

View file

@ -0,0 +1,9 @@
.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

View file

@ -0,0 +1,3 @@
init
The name of the init service.

View file

@ -0,0 +1,7 @@
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.

View file

@ -0,0 +1,3 @@
needs
Name of the service sub-directory containing the needed services.

View file

@ -0,0 +1,3 @@
off
Name of the file we start, when stopping the service.

View file

@ -0,0 +1,3 @@
on
Name of the file we start, when starting the service.

View file

@ -0,0 +1,5 @@
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.

View file

@ -0,0 +1,3 @@
.params
The extension to c_on and c_off, which will contain the parameters \n seperated.

View file

@ -0,0 +1,3 @@
respawn
If this file exists in a service directory, cinit will respawn the service.

View file

@ -0,0 +1,4 @@
coala
The name of the socket cinit will use (currently: below tmpdir,
see doc/ipc.thoughts).

View file

@ -0,0 +1,3 @@
tmp
The name of the temporary directory, where we'll mount tmpfs to create the socket

View file

@ -0,0 +1,4 @@
tmpfs
The name of the filesystem to use to mount a memory filesystem.
On Linux this is "tmpfs".

View file

@ -0,0 +1,4 @@
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".

View file

@ -0,0 +1,3 @@
wants
Name of the service sub-directory containing the wanted services.

View file

@ -0,0 +1,3 @@
gcc
The c-compiler to use.

View file

@ -0,0 +1,6 @@
-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

View file

@ -0,0 +1,3 @@
/etc/cinit
This is where all configuration for cinit will be stored.

View file

@ -0,0 +1,3 @@
conf
General cinit-configuration (below cinitdir)

View file

@ -0,0 +1,6 @@
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.

View file

@ -0,0 +1,4 @@
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.

View file

@ -0,0 +1,3 @@
-d
Parameter to pass to install_prog to create directories.

View file

@ -0,0 +1,4 @@
/usr/bin/install
Program we use to install. install_directory contains parameter
to create directory.

View file

@ -0,0 +1,5 @@
msgq
The type of IPC (inter process communication) to use.
Valid values can be optained by issuing `ls src/ipc/`.

View file

@ -0,0 +1,3 @@
gcc
Comment missing.

View file

@ -0,0 +1,3 @@
No flags specified normally.

View file

@ -0,0 +1,4 @@
30
Maximum number of seconds to sleep between retrying to start it
(respawn only).

View file

@ -0,0 +1,4 @@
32
Maximum number of direct dependencies (in each wants and needs,
that way doubling this number) a service may have. The default is 32.

View file

@ -0,0 +1,4 @@
/bin/sh
Used to generate an unique identifier for the message queue.
See ftok(3).

View file

@ -0,0 +1,4 @@
o
This is use in ftok to generate a key_t for the message queue use to write
to the clients. See ftok(3).

View file

@ -0,0 +1,4 @@
i
This is use in ftok to generate a key_t for the message queue use to write
to the server. See ftok(3).

View file

@ -0,0 +1,14 @@
linux
Select the operating system compiling for.
Current possibilities:
- linux
Currently Planned possibilities:
- freebsd
- openbsd
- netbsd

View file

@ -0,0 +1,6 @@
asciidoc
The binary on your system (with or without path) which does what I expect
asciidoc todo.
Default: asciidoc

View file

@ -0,0 +1,6 @@
docbook2x-man
The binary on your system (with or without path) which converts
docbook to manpages.
Default: docbook2x-man

View file

@ -0,0 +1,6 @@
docbook2x-texi
The binary on your system (with or without path) which converts
docbook to texinfo.
Default: docbook2x-texi

View file

@ -0,0 +1,5 @@
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 "/".

View file

@ -0,0 +1,9 @@
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.

View file

@ -0,0 +1,7 @@
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.

View file

@ -0,0 +1,7 @@
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/

View file

@ -0,0 +1,8 @@
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.

View file

@ -0,0 +1,5 @@
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.

View file

@ -0,0 +1,4 @@
1
How many seconds to sleep before rechecking if the service was executed.
Used by run_svc().

View file

@ -0,0 +1,3 @@
5
How many seconds to sleep before respawning a failed process.

View file

@ -0,0 +1,4 @@
32
Maximum process waiting in the socket queue. The default is much
more than enough.

View file

@ -0,0 +1,3 @@
strip -R .comment -R .note
Strip out unecessary parts of the binaries.

View file

@ -0,0 +1,3 @@
svc
Directory below /etc/cinit that contains the services.

View file

@ -0,0 +1,3 @@
"0.3pre15"
The version.

View file

@ -0,0 +1,33 @@
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/
<name>
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

View file

@ -0,0 +1,70 @@
#
# (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

View file

@ -0,0 +1,11 @@
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]

View file

@ -0,0 +1,7 @@
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

View file

@ -0,0 +1,117 @@
#!/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

View file

@ -0,0 +1,72 @@
#!/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);

View file

@ -0,0 +1,200 @@
/**
(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 <sys/types.h>
#include <sys/stat.h>
#include <dirent.h>
#include <limits.h>
#include <string.h>
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
//#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 <path>\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));
}

View file

@ -0,0 +1,17 @@
/***********************************************************************
*
* 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

View file

@ -0,0 +1,124 @@
/**
(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 <errno.h>
#include <stdio.h>
#include <stdarg.h>
#include <syslog.h>
#include <string.h>
#include <stdlib.h>
#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);
}

View file

@ -0,0 +1,29 @@
#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

View file

@ -0,0 +1,227 @@
#!/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__} <xml 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")

View file

@ -0,0 +1 @@
../src/generic/mini_printf.c

View file

@ -0,0 +1 @@
../src/generic/usage.c

View file

@ -0,0 +1,24 @@
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

View file

@ -0,0 +1,107 @@
#
# 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

View file

@ -0,0 +1,57 @@
cinit/doc
=========
Nico Schottelius <nico-cinit__@__schottelius.org>
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.

View file

@ -0,0 +1,10 @@
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

View file

@ -0,0 +1,16 @@
Ancient
=======
Nico Schottelius <nico-linux-cinit__@__schottelius.org>
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.

View file

@ -0,0 +1,16 @@
18:18 <Lucky_> 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 <Lucky_> und warum installiert er die man pages nicht mit?
07:20 <Lucky_> 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 <Lucky_> soweit sieht eig. alles gut aus
07:21 <Lucky_> wenn das so bleibt, dann werd' ich dauerhaft auf cinit umsteigen :)
07:21 <Lucky_> und wenn sich die gelegenheit bietet, dann stell ich cinit auch mal in der
info-ag von unserer schule vor :)

View file

@ -0,0 +1,58 @@
--------------------------------------------------------------------------------
'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.

View file

@ -0,0 +1 @@
Nico Schottelius <nico-linux-cinit // schottelius.org>

View file

@ -0,0 +1 @@
cinit is currently Linux-specific.

View file

@ -0,0 +1 @@
See http://linux.schottelius.org/cinit/#config

View file

@ -0,0 +1,5 @@
/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

View file

@ -0,0 +1,5 @@
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.

View file

@ -0,0 +1 @@
2005-08-21

View file

@ -0,0 +1 @@
fast executing, small and simple init with profile-support

View file

@ -0,0 +1 @@
cprofile:<theprofile>

View file

@ -0,0 +1 @@
/sbin/cinit

View file

@ -0,0 +1 @@
http://linux.schottelius.org/cinit/

Some files were not shown because too many files have changed in this diff Show more