Showing preview only (1,805K chars total). Download the full file or copy to clipboard to get everything.
Repository: slicer69/sysvinit
Branch: main
Commit: 2da36cf51d48
Files: 82
Total size: 1.7 MB
Directory structure:
gitextract_nrp8io5d/
├── .gitignore
├── COPYING
├── COPYRIGHT
├── Makefile
├── README
├── contrib/
│ ├── alexander.viro
│ ├── migrate-svn-git
│ ├── notify-pam-dead.patch
│ ├── sysd2v.sh
│ └── zefram-patches
├── doc/
│ ├── Changelog
│ ├── Install
│ ├── Propaganda
│ ├── bootlogd.README
│ ├── initctl
│ └── initscript.sample
├── man/
│ ├── Makefile
│ ├── bootlogd.8
│ ├── fstab-decode.8
│ ├── halt.8
│ ├── init.8
│ ├── initctl.5
│ ├── initscript.5
│ ├── inittab.5
│ ├── killall5.8
│ ├── last.1
│ ├── lastb.1
│ ├── logsave.8
│ ├── mesg.1
│ ├── mountpoint.1
│ ├── pidof.8
│ ├── po/
│ │ ├── de.po
│ │ ├── es.po
│ │ ├── fi.po
│ │ ├── fr.po
│ │ ├── hu.po
│ │ ├── id.po
│ │ ├── pl.po
│ │ ├── po4a.cfg
│ │ ├── pt.po
│ │ └── sysvinit-man.pot
│ ├── poweroff.8
│ ├── readbootlog.1
│ ├── reboot.8
│ ├── runlevel.8
│ ├── shutdown.8
│ ├── sulogin.8
│ ├── telinit.8
│ ├── utmpdump.1
│ └── wall.1
└── src/
├── .gitignore
├── Makefile
├── bootlogd.c
├── bootlogd.h
├── consoles.c
├── consoles.h
├── dowall.c
├── fstab-decode.c
├── halt.c
├── hddown.c
├── ifdown.c
├── init.c
├── init.h
├── initreq.h
├── killall5.c
├── last.c
├── logsave.c
├── mesg.c
├── mountpoint.c
├── oldutmp.h
├── paths.h
├── readbootlog.c
├── reboot.h
├── runlevel.c
├── runlevellog.c
├── runlevellog.h
├── set.h
├── shutdown.c
├── sulogin.c
├── utmp.c
├── utmpdump.c
└── wall.c
================================================
FILE CONTENTS
================================================
================================================
FILE: .gitignore
================================================
*.o
*.tar.*
================================================
FILE: COPYING
================================================
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Lesser General Public License instead.) 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
this service 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 make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. 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.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute 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 and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
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
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the 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 a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, 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.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE 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.
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
convey 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 2 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, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision 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, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This 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.
================================================
FILE: COPYRIGHT
================================================
Sysvinit is Copyright (C) 1991-2004 Miquel van Smoorenburg
Updated Copyright (C) 2018 Jesse Smith
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 2 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, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
On Debian GNU/Linux systems, the complete text of the GNU General
Public License can be found in `/usr/share/common-licenses/GPL-2'.
Send patches to sysvinit-devel@nongnu.org
================================================
FILE: Makefile
================================================
PACKAGE=sysvinit
VERSION=$(shell sed -rn '1s/.*[[:blank:]]\((.*)\)[[:blank:]].*/\1/p' doc/Changelog)
all install clean distclean:
@rm -f $(PACKAGE)-$(VERSION).tar.xz $(PACKAGE)-$(VERSION).tar.xz.sig
$(MAKE) VERSION=$(VERSION) -C man $@
$(MAKE) VERSION=$(VERSION) -C src $@
GITLOGIN=$(shell git remote -v | head -n 1 | cut -f 1 -d '@' | sed 's/origin\t//g')
override TMP:=$(shell mktemp -du $(VERSION).XXXXXXXX)
override TARBALL:=$(TMP)/$(PACKAGE)-$(VERSION).tar.xz
override SFTPBATCH:=$(TMP)/$(VERSION)-sftpbatch
SOURCES=contrib COPYING COPYRIGHT doc Makefile man README src
dist: $(TARBALL).sig
@cp $(TARBALL) .
@cp $(TARBALL).sig .
@echo "tarball $(PACKAGE)-$(VERSION).tar.xz ready"
rm -rf $(TMP)
upload: $(SFTPBATCH)
echo @sftp -b $< $(GITLOGIN)@dl.sv.nongnu.org:/releases/$(PACKAGE)
rm -rf $(TMP)
$(SFTPBATCH): $(TARBALL).sig
@echo progress > $@
@echo put $(TARBALL) >> $@
@echo chmod 664 $(notdir $(TARBALL)) >> $@
@echo put $(TARBALL).sig >> $@
@echo chmod 664 $(notdir $(TARBALL)).sig >> $@
@echo rm $(PACKAGE)-latest.tar.bz2 >> $@
@echo symlink $(notdir $(TARBALL)) $(PACKAGE)-latest.tar.bz2 >> $@
@echo quit >> $@
$(TARBALL).sig: $(TARBALL)
@gpg -q -ba --use-agent -o $@ $<
$(TARBALL): $(TMP)/$(PACKAGE)-$(VERSION)
@tar --exclude=.git --owner=nobody --group=nogroup -cJf $@ -C $(TMP) $(PACKAGE)-$(VERSION)
$(TMP)/$(PACKAGE)-$(VERSION): distclean
@mkdir -p $(TMP)/$(PACKAGE)-$(VERSION)
@cp -R $(SOURCES) $(TMP)/$(PACKAGE)-$(VERSION)/
@chmod -R a+r,u+w,og-w $@
@find $@ -type d | xargs -r chmod a+rx,u+w,og-w
================================================
FILE: README
================================================
# README for SysV init
## Please note this project has migrated to CodeBerg: https://codeberg.org/thejessesmith/sysvinit
SysV init is a classic initialization program (PID 1) for GNU/Linux and
other UNIX/POSIX systems. It is designed to be small, simple and to
stay out of the way.
Init is the parent (or grandparent) of all other processes on the
system. It kicks off the starting of other system services and
can act as a parent process to services which no longer have an
active parent process.
SysV init uses the concept of runlevels. A runlevel is a configuration of the
system which allows only a selected group of processes to exist.
The processes spawned by init for each of these runlevels are defined in the
/etc/inittab file. Init can be in one of eight runlevels. The runlevel is
changed by the administrator running the telinit command which selects
which runlevel we want to use.
More information on init, runlevels and switching between them can be found
in the init manual page. (See "man init".)
contrib Unofficial stuff, add-on programs
doc Documentation
man Manual pages
src Source code
For instructions on building and installing SysV init, please
see the "doc/Install" file.
SysV init releases are signed with one of two keys, depending on the build machine.
These keys are public keys A573ED5E687A40F89D30E6BE2A72EB41906F8E49
and 5A2DC686CDC5D6087D88C198351F75FA45D53656.
Both of these keys can be fetched from the Savannah mirror at:
https://download.savannah.nongnu.org/releases/sysvinit/
The keys are also available on the public key server https://keys.openpgp.org/
================================================
FILE: contrib/alexander.viro
================================================
I proposed moving some stuff to a separate file, such as the
re-exec routines. Alexander wrote:
According to Alexander Viro <viro@math.psu.edu>:
> As for the code separation - I think it's nice. Actually, read_inittab()
> with get_part() and newFamily are also pretty separatable. Another good
> set is any(), spawn(), startup(), spawn_emerg() and start_if_needed().
> BTW, fail_check();process_signals(); is equivalent to process_signal();
> fail_check();. I think that swapping them (in main loop) would be a good
> idea - then we can move fail_check() into start_if_needed(). And one more
> - I'ld propose to move start_if_needed to the beginning of the main loop,
> as in
> foo();
> while(1) { bar();foo();
> #if 0
> baz();
> #endif
> }
> to
> while(1) { foo();bar();
> #if 0
> baz();
> #endif
> }
>
>
> What do you think about it?
================================================
FILE: contrib/migrate-svn-git
================================================
#!/bin/sh
#
# Script to migrate sysvinit project source code from subversion to git.
# Used february 2018.
authorsmap=$(tempfile)
cat > $authorsmap <<EOF
pere = Petter Reinholdtsen <pere@hungry.com>
wfink = Werner Fink <werner@suse.de>
EOF
for p in sysvinit startpar insserv; do
git svn clone http://svn.savannah.nongnu.org/svn/sysvinit/$p \
--authors-file=$authorsmap \
--no-metadata \
--tags=tags \
--trunk=trunk \
--prefix=$p/ \
$p-git
(
cd $p-git
for tag in `git branch -r | grep "tags/" | sed "s/ $p\/tags\///"`; do
git tag -a -m"Converting SVN tags" $tag refs/remotes/$p/tags/$tag
done
if [ "sysvinit" = "$p" ]; then
remote=$p.git
else
remote=sysvinit/$p.git
fi
git remote add origin ssh://git.savannah.gnu.org:/srv/git/$remote
)
done
rm $authorsmap
================================================
FILE: contrib/notify-pam-dead.patch
================================================
Index: src/init.sample
===================================================================
--- src/init.sample (revision 0)
+++ src/init.sample (revision 0)
@@ -0,0 +1,9 @@
+#%PAM-1.0
+#
+# The PAM configuration file for /sbin/init
+# Used for updating the lastlog logging file
+#
+auth sufficient pam_rootok.so
+account include common-account
+session include common-session
+session requisite pam_lastlog.so silent
Index: src/init.c
===================================================================
--- src/init.c (revision 56)
+++ src/init.c (working copy)
@@ -76,6 +76,10 @@
#include "reboot.h"
#include "set.h"
+#ifdef USE_PAM
+extern void notify_pam_dead_session(const char *id);
+#endif
+
#ifndef SIGPWR
# define SIGPWR SIGUSR2
#endif
@@ -1129,6 +1133,9 @@
}
dup(f);
dup(f);
+#ifdef USE_PAM
+ notify_pam_dead_session(ch->id);
+#endif
}
/*
@@ -1548,6 +1555,9 @@
INITDBG(L_VB, "Updating utmp for pid %d [id %s]",
ch->pid, ch->id);
ch->flags &= ~RUNNING;
+#ifdef USE_PAM
+ notify_pam_dead_session(ch->id);
+#endif
if (ch->process[0] != '+')
write_utmp_wtmp("", ch->id, ch->pid, DEAD_PROCESS, NULL);
}
@@ -2009,6 +2019,9 @@
if (ch->flags & ZOMBIE) {
INITDBG(L_VB, "Child died, PID= %d", ch->pid);
ch->flags &= ~(RUNNING|ZOMBIE|WAITING);
+#ifdef USE_PAM
+ notify_pam_dead_session(ch->id);
+#endif
if (ch->process[0] != '+')
write_utmp_wtmp("", ch->id, ch->pid, DEAD_PROCESS, NULL);
}
@@ -2453,6 +2466,9 @@
if (ch->flags & ZOMBIE) {
INITDBG(L_VB, "Child died, PID= %d", ch->pid);
ch->flags &= ~(RUNNING|ZOMBIE|WAITING);
+#ifdef USE_PAM
+ notify_pam_dead_session(ch->id);
+#endif
if (ch->process[0] != '+')
write_utmp_wtmp("", ch->id, ch->pid, DEAD_PROCESS, NULL);
}
Index: src/utmp.c
===================================================================
--- src/utmp.c (revision 51)
+++ src/utmp.c (working copy)
@@ -34,10 +34,18 @@
#include <string.h>
#include <utmp.h>
+#if defined(USE_PAM) && defined(INIT_MAIN)
+# include <security/pam_appl.h>
+# include <security/pam_misc.h>
+#endif
+
#include "init.h"
#include "initreq.h"
#include "paths.h"
+#ifndef _PATH_DEV
+# define _PATH_DEV "/dev/"
+#endif
#if defined(__GLIBC__)
# if (__GLIBC__ == 2) && (__GLIBC_MINOR__ == 0) && defined(__powerpc__)
@@ -127,9 +135,9 @@
strncpy(utmp.ut_name, user, sizeof(utmp.ut_name));
strncpy(utmp.ut_id , id , sizeof(utmp.ut_id ));
strncpy(utmp.ut_line, line, sizeof(utmp.ut_line));
-
- /* Put the OS version in place of the hostname */
- if (uname(&uname_buf) == 0)
+
+ /* Put the OS version in place of the hostname */
+ if (uname(&uname_buf) == 0)
strncpy(utmp.ut_host, uname_buf.release, sizeof(utmp.ut_host));
#if HAVE_UPDWTMP
@@ -262,3 +270,75 @@
write_wtmp(user, id, pid, type, line && line[0] ? line : oldline);
}
+#if defined(USE_PAM) && defined(INIT_MAIN)
+static pam_handle_t *pamh = NULL;
+# ifdef __GNUC__
+static int
+null_conv(int num_msg, const struct pam_message **msgm,
+ struct pam_response **response __attribute__((unused)),
+ void *appdata_ptr __attribute__((unused)))
+# else
+static int
+null_conv(int num_msg, const struct pam_message **msgm,
+ struct pam_response **response, void *appdata_ptr)
+# endif
+{
+ int i;
+ for (i = 0; i < num_msg; i++) {
+ const struct pam_message *msg = msgm[i];
+ if (msg == (const struct pam_message*)0)
+ continue;
+ if (msg->msg == (char*)0)
+ continue;
+ switch (msg->msg_style) {
+ case PAM_ERROR_MSG:
+ case PAM_TEXT_INFO:
+ initlog(L_VB, "pam_message %s", msg->msg);
+ default:
+ break;
+ }
+ }
+ return 0;
+}
+static const struct pam_conv conv = { null_conv, NULL };
+# define PAM_FAIL_CHECK(func, args...) \
+ { \
+ if ((pam_ret = (func)(args)) != PAM_SUCCESS) { \
+ initlog(L_VB, "%s", pam_strerror(pamh, pam_ret)); \
+ goto pam_error; \
+ } \
+ }
+
+void notify_pam_dead_session(const char *id)
+{
+ struct utmp *oldut, ut;
+
+ setutent();
+
+ memset(&ut, 0, sizeof(ut));
+ ut.ut_type = DEAD_PROCESS;
+ strncpy(ut.ut_id, id, sizeof(ut.ut_id));
+
+ if ((oldut = getutid(&ut)) && (oldut->ut_type == USER_PROCESS)) {
+ int pam_ret;
+ char tty[UT_LINESIZE+ strlen(_PATH_DEV) + 1];
+
+ if (strncmp(oldut->ut_line, _PATH_DEV, strlen(_PATH_DEV)))
+ snprintf(tty, sizeof(tty), _PATH_DEV "%.*s",
+ UT_LINESIZE, oldut->ut_line);
+ else
+ snprintf(tty, sizeof(tty), "%.*s",
+ UT_LINESIZE, oldut->ut_line);
+
+ PAM_FAIL_CHECK(pam_start, "init", oldut->ut_user, &conv, &pamh);
+ PAM_FAIL_CHECK(pam_set_item, pamh, PAM_TTY, tty);
+ PAM_FAIL_CHECK(pam_set_item, pamh, PAM_RHOST, oldut->ut_host);
+ PAM_FAIL_CHECK(pam_close_session, pamh, PAM_SILENT);
+ pam_error:
+ pam_end(pamh, pam_ret);
+ }
+
+ endutent();
+}
+#endif /* USE_PAM && INIT_MAIN */
+
Index: src/Makefile
===================================================================
--- src/Makefile (revision 58)
+++ src/Makefile (working copy)
@@ -8,7 +8,7 @@
# Version: @(#)Makefile 2.85-13 23-Mar-2004 miquels@cistron.nl
#
-CPPFLAGS =
+CPPFLAGS = -DUSE_PAM
CFLAGS ?= -ansi -O2 -fomit-frame-pointer
override CFLAGS += -W -Wall -D_GNU_SOURCE
STATIC =
@@ -79,6 +79,13 @@
endif
# Additional libs for GNU libc.
+ifneq ($(findstring -DUSE_PAM,$(CPPFLAGS)),)
+ INITLIBS += -lpam
+ PAMDOTD = /etc/pam.d
+ PAMINIT = $(PAMDOTD)/init
+endif
+
+# Additional libs for GNU libc.
ifneq ($(wildcard /usr/lib*/libcrypt.a),)
SULOGINLIBS += -lcrypt
endif
@@ -153,6 +160,11 @@
$(STRIP) $$i ; \
$(INSTALL_EXEC) $$i $(ROOT)/usr/bin/ ; \
done
+ifneq ($(findstring -DUSE_PAM,$(CPPFLAGS)),)
+ $(INSTALL_DIR) $(ROOT)$(PAMDOTD)
+ test -s $(ROOT)$(PAMINIT) || \
+ $(INSTALL_DATA) init.sample $(ROOT)$(PAMINIT)
+endif
# $(INSTALL_DIR) $(ROOT)/etc/
# $(INSTALL_EXEC) initscript.sample $(ROOT)/etc/
ln -sf halt $(ROOT)/sbin/reboot
================================================
FILE: contrib/sysd2v.sh
================================================
#!/bin/sh
# sysd2v v0.3 -- systemd unit to sysvinit script converter
# Copyright (C) 2019 Trek http://www.trek.eu.org/devel/sysd2v
# distributed under the terms of the GNU General Public License 3
nl="
"
# read a systemd unit file and set variables named ini_{section}_{key}
# usage: read_unit filename instance
# filename service unit configuration file, '-' to read from stdin
# instance instance name for template units
read_unit()
{
filename=$1
instance=$2
if [ "$filename" != - ]
then
inifile_unit_name=${filename##*/}
inifile_unit_name=${inifile_unit_name%.*}
fi
rm_comm='/^[#;]/d'
concat=':l; /\\$/ { N; s/[[:space:]]*\\\n/ /; tl }'
subst_inst="s/%[Ii]/$instance/g"
unit=$(
cat "$filename" |
sed "$rm_comm" |
sed "$concat;$subst_inst"
)
section_list=$(
printf %s "$unit" |
sed -n 's/^\[\([[:alnum:]]\+\)\].*/\1/p'
)
oldifs=$IFS
IFS=$nl
for section in $section_list
do
get_sect='/^\['"$section"'\]/,/^\[.\+\]/'
key_list=$(
printf %s "$unit" |
sed -n "$get_sect"'s/^\([[:alnum:]]\+\)[[:space:]]*=.*/\1/p' |
sort -u
)
for key in $key_list
do
val=$(
printf %s "$unit" |
sed -n "$get_sect"'s/^'"$key"'[[:space:]]*=[[:space:]]*\(.*\)/\1/p'
)
var=$(
echo "${section}_$key" |
tr '[:upper:]' '[:lower:]'
)
eval ini_$var=\$val
[ -n "$debug" ] && echo "ini_$var=$val" >&2
done
done
IFS=$oldifs
}
# read a systemd configuration value and write its prefix to stdout
# usage: get_prefix val
# val systemd configuration value
get_prefix () { printf %s "$1" | sed -n 's/^\([-@:+!|]*\).*/\1/p'; }
# read a boolean value and returns true or false
# usage: is_true val
# val boolean value
is_true () { case "$1" in 1|[Oo][Nn]|[Tt]*|[Yy]*) true;; *) false; esac }
# read systemd services list and write LSB facilities to stdout
# usage: get_provides services
# services list of service units
get_provides ()
{
lst=
for dep in $1
do
lst=${lst:+$lst }${dep%.service}
done
printf %s "$lst"
}
# read systemd units list and write LSB facilities to stdout
# usage: get_depends dependencies [ignores]
# dependencies list of required units
# ignores facilities to ignore
get_depends ()
{
lst=
for dep in $1
do
d=
case $dep in
local-fs-pre.target) d=mountkernfs;;
time-sync.target) d=\$time;;
systemd-modules-load.service) d=kmod;;
local-fs.target|network-pre.target) d=\$local_fs;;
systemd-sysctl.service) d=procps;;
network.target|network-online.target|systemd-networkd.service)
d=\$network;;
nss-lookup.target) d=\$named;;
rpcbind.target|remote-fs-pre.target) d=\$portmap;;
remote-fs.target|sysinit.target|basic.target) d=\$remote_fs;;
syslog.service) d=\$syslog;;
boot-complete.target|multi-user.target|default.target) d=\$all;;
*.service) d=${dep%.service};;
*) echo "WARNING: unsupported target '$dep'" >&2
esac
ign=${2:+$2 }$lst
[ -z "$ign" -o -n "${ign%%*"$d"*}" ] &&
lst=${lst:+$lst }$d
done
printf %s "$lst"
}
# read LSB facilities list and write runlevel to stdout
# usage: get_runlevel facilities
# facilities list of required facilities
get_runlevel ()
{
case $1 in
*\$remote_fs*) echo 2 3 4 5;;
*) echo S
esac
}
# write a list of environment files to be executed
# usage: write_env list
# list files separated by newlines, with prefix (-)
write_env ()
{
oldifs=$IFS
IFS=$nl
for env in $1
do
pre=$(get_prefix "$env")
noerr=
[ -n "$pre" -a -z "${pre%%*-*}" ] && noerr="[ -r ${env#$pre} ] && "
printf '%s\n' "$noerr. ${env#$pre}"
done
IFS=$oldifs
}
# write an environment variable containing paths
# usage: write_path name prefix list
# name name of the environment variable
# prefix path prefix to append directories
# list paths separated by spaces or newlines
write_path ()
{
lst=
for dir in $3
do
lst=${lst:+$lst:}$2/$dir
done
[ -z "$3" ] || printf '%s=%s\n' $1 $lst
}
# write a list of directories to be created
# usage: write_install prefix list [user [group [mode]]]
# prefix path prefix to append directories
# list paths separated by spaces or newlines
# user user ownership
# group group ownership
# mode permission mode
write_install ()
{
for dir in $2
do
printf ' install -d %s%s/%s || return 2\n' \
"${3:+-o $3 }${4:+-g $4 }${5:+-m $5 }" "$1" "$dir"
done
}
# write a list of commands applying systemd executable prefixes
# usage: write_commands list [run [runpriv]]
# list commands separated by newlines, with prefixes (-@:+!)
# run command line to run each command (nice, chrt, ...)
# runpriv command line to set privileges (runuser, ...)
write_commands ()
{
oldifs=$IFS
IFS=$nl
for cmd in $1
do
pre=$(get_prefix "$cmd")
beg=$3
end=' || return 2'
if [ -n "$pre" ]
then
[ -z "${pre%%*-*}" ] && end=
[ -z "${pre%%*[+!]*}" ] && beg=
[ -z "${pre%%*[@:]*}" ] &&
echo "WARNING: unsupported exec prefix '$pre'" >&2
fi
printf ' %s\n' "$2$beg${cmd#$pre}$end"
done
IFS=$oldifs
}
# read a list of commands separated by newlines and write an override function
# usage: write_function name [commands]
# name function name (start_cmd, stop_cmd, ...)
# commands list of commands, read from stdin if omitted
write_function ()
{
lst=${2-$(cat)}
[ -n "$lst" ] || return
[ "$lst" = : ] && printf "do_${1}_override () :\n\n" && return
end=' true\n'
[ -z "${lst%%*|| return [0-9]}" -o -z "${lst%%*|| return \$?}" ] && end=
printf "do_${1}_override ()\n{\n%s\n$end}\n\n" "$lst"
}
# write an init-d-script file starting from the ini_* vars (see read_unit)
# usage: write_init servicename instance
# servicename name of the service provided
# instance instance name for template units
write_init ()
{
name=$1
instance=$2
if [ "${name%@}" != "$name" ]
then
name=$name$instance
fi
daemon_pre=$(get_prefix "$ini_service_execstart")
daemon=${ini_service_execstart#$daemon_pre}
if [ "${daemon%%[[:space:]]*}" != "$daemon" ]
then
daemon_args=${daemon#*[[:space:]]}
daemon=${daemon%%[[:space:]]*}
fi
pidfile=$ini_service_pidfile
if [ -n "$ini_service_user" ]
then
start_args="--user $ini_service_user"
[ -n "$daemon_pre" -a -z "${daemon_pre%%*[+!]*}" ] ||
start_args="$start_args --chuid $ini_service_user"
stop_args="--user $ini_service_user"
runprivstart="runuser -u $ini_service_user -- "
is_true "$ini_service_permissionsstartonly" || runpriv=$runprivstart
fi
cls=$ini_service_ioschedulingclass
pri=$ini_service_ioschedulingpriority
[ -n "$cls$pri" ] &&
start_args="$start_args --iosched ${cls:-best-effort}${pri:+:$pri}" &&
run="ionice ${cls:+-c $cls }${pri:+-n $pri }"
pol=$ini_service_cpuschedulingpolicy
pri=$ini_service_cpuschedulingpriority
[ -n "$pol$pri" ] &&
start_args="$start_args --procsched ${pol:-other}${pri:+:$pri}" &&
run="${run}chrt ${pol:+--$pol }${pri:-0} "
[ -n "$ini_service_nice" ] &&
start_args="$start_args --nicelevel $ini_service_nice" &&
run="${run}nice -n $ini_service_nice "
pre=$(get_prefix "$ini_service_workingdirectory")
workdir=${ini_service_workingdirectory#$pre}
[ "$workdir" = '~' ] && workdir=\~$ini_service_user
[ -n "$workdir" ] &&
start_args="$start_args --chdir $workdir" &&
chdir="${pre}cd $workdir"
if [ -z "${service_type:=$ini_service_type}" ]
then
if [ -n "$ini_service_busname" ]
then
service_type=dbus
elif [ -n "$ini_service_execstart" ]
then
service_type=simple
else
service_type=oneshot
fi
fi
if [ "$service_type" != forking ]
then
start_args="$start_args --background"
[ -z "$pidfile" -a "$ini_service_killmode" != none ] &&
start_args="$start_args --make-pidfile" &&
pidfile="/var/run/$name-sysd2v.pid"
fi
if [ "$service_type" = notify ]
then
start_args="$start_args --notify-await"
timeout=${ini_service_timeoutstartsec:-$ini_service_timeoutsec}
timeout=${timeout%s}
[ -n "${timeout#60}" ] &&
start_args="$start_args --notify-timeout $timeout"
[ -n "$timeout" -a -z "${timeout%%*[^0-9]*}" ] &&
echo "WARNING: unsupported timeout '$timeout'" >&2
elif [ "$service_type" = dbus ]
then
: TODO
fi
signal=${ini_service_killsignal#SIG}
timeout=${ini_service_timeoutstopsec:-$ini_service_timeoutsec}
timeout=${timeout%s}
[ -n "${signal#TERM}" -o -n "${timeout#90}" ] &&
stop_args="$stop_args --retry=${signal:-TERM}/${timeout:-90}/KILL/5"
limitnofile=$ini_service_limitnofile
[ "$limitnofile" = infinity ] && limitnofile=unlimited
need_install=$ini_service_runtimedirectory
need_install=$need_install$ini_service_statedirectory
need_install=$need_install$ini_service_cachedirectory
need_install=$need_install$ini_service_logsdirectory
need_install=$need_install$ini_service_configurationdirectory
need_do_start=$ini_service_execstartpre$ini_service_execstartpost
need_do_start=$need_do_start$need_install
execstop=$ini_service_execstop
if [ "$service_type" != oneshot ]
then
[ "$pidfile" = "/var/run/${daemon##*/}.pid" ] && unset pidfile
[ "$name" = "${daemon##*/}" ] && unset name
[ -n "$daemon_args" -a -z "${daemon_args%%*[\"\\]*}" ] &&
echo "WARNING: DAEMON_ARGS needs to be escaped" >&2
errcheck=' || return $?'
if [ -n "$daemon_pre" ]
then
[ -z "${daemon_pre%%*-*}" ] && errcheck=
[ -z "${daemon_pre%%*[@:]*}" ] &&
echo "WARNING: unsupported exec prefix '$daemon_pre'" >&2
fi
# TODO: test if already running before start (pretest="+do_status_cmd")
[ -n "$need_do_start" -o -z "$errcheck" ] &&
execstart="-+do_start_cmd$errcheck"
errcheck=' || return $?'
[ -n "$execstop" ] && errcheck=
[ -n "$execstop$ini_service_execstoppost" -a \
"$ini_service_killmode" != none ] &&
killstop="-do_stop_cmd$errcheck"
[ -n "$timeout" -a -z "${timeout%%*[^0-9]*}" ] &&
echo "WARNING: unsupported timeout '$timeout'" >&2
else
daemon=none
pidfile=none
: ${name:=SERVICE_NAME}
unset daemon_args start_args stop_args
execstart=$ini_service_execstart
runstart=$run
fi
need_do_start=$need_do_start$execstart
start_args=${start_args# }
stop_args=${stop_args# }
aliases=$(get_provides "$ini_install_alias")
[ -z "$ini_unit_defaultdependencies" ] ||
is_true "$ini_unit_defaultdependencies" &&
defdep=sysinit.target
req_start=$(get_depends "$ini_unit_requires $defdep")
should_start=$(get_depends "$ini_unit_wants $ini_unit_after" "$req_start")
default_start=$(get_runlevel "$req_start $should_start")
[ "$default_start" = S ] && default_stop='0 6' || default_stop='0 1 6'
[ -z "$execstop$ini_service_execstoppost" ] &&
[ "$service_type" = oneshot -o "$ini_service_killmode" = none ] &&
default_stop=
[ "$default_start" = S ] && ignore=\$remote_fs
start_before=$(get_depends "$ini_unit_requiredby $ini_install_wantedby
$ini_unit_before" "$req_start $should_start \$all $ignore")
cat <<EOF
#!/bin/sh
# Generated by sysd2v v0.3 -- http://www.trek.eu.org/devel/sysd2v
# kFreeBSD do not accept scripts as interpreters, using #!/bin/sh and sourcing.
if [ true != "\$INIT_D_SCRIPT_SOURCED" ] ; then
set "\$0" "\$@"; INIT_D_SCRIPT_SOURCED=true . /lib/init/init-d-script
fi
### BEGIN INIT INFO
# Provides: ${name:-${daemon##*/}}${aliases:+ $aliases}
# Required-Start: $req_start
# Required-Stop: ${default_stop:+$req_start}
${should_start:+# Should-Start: $should_start
${default_stop:+# Should-Stop: $should_start
}}${start_before:+# X-Start-Before: $start_before
${default_stop:+# X-Stop-After: $start_before
}}# Default-Start: $default_start
# Default-Stop: $default_stop
# Description: ${ini_unit_description:-SERVICE_DESCRIPTION}
### END INIT INFO
EOF
if [ -n "$ini_service_environment$ini_service_environmentfile$need_install" ]
then
echo set -a
write_path RUNTIME_DIRECTORY /run "$ini_service_runtimedirectory"
write_path STATE_DIRECTORY /var/lib "$ini_service_statedirectory"
write_path CACHE_DIRECTORY /var/cache "$ini_service_cachedirectory"
write_path LOGS_DIRECTORY /var/log "$ini_service_logsdirectory"
write_path CONFIGURATION_DIRECTORY /etc \
"$ini_service_configurationdirectory"
printf '%s' "${ini_service_environment:+$ini_service_environment$nl}"
write_env "$ini_service_environmentfile"
printf 'set +a\n\n'
fi
cat <<EOF
${name:+DESC=\"$name\"
}DAEMON=$daemon
${daemon_args:+DAEMON_ARGS=\"$daemon_args\"
}${pidfile:+PIDFILE=$pidfile
}${start_args:+START_ARGS=\"$start_args\"
}${stop_args:+STOP_ARGS=\"$stop_args\"
}${limitnofile:+ulimit -n $limitnofile
}${ini_service_umask:+umask $ini_service_umask
}
EOF
if [ -n "$need_do_start" ]
then
{
write_install /run "$ini_service_runtimedirectory" \
"$ini_service_user" "$ini_service_group" \
"$ini_service_runtimedirectorymode"
write_install /var/lib "$ini_service_statedirectory" \
"$ini_service_user" "$ini_service_group" \
"$ini_service_statedirectorymode"
write_install /var/cache "$ini_service_cachedirectory" \
"$ini_service_user" "$ini_service_group" \
"$ini_service_cachedirectorymode"
write_install /var/log "$ini_service_logsdirectory" \
"$ini_service_user" "$ini_service_group" \
"$ini_service_logsdirectorymode"
write_install /etc "$ini_service_configurationdirectory" '' '' \
"$ini_service_configurationdirectorymode"
write_commands "$chdir"
write_commands "$ini_service_execstartpre" "$run" "$runpriv"
write_commands "$execstart" "$runstart" "$runprivstart"
write_commands "$ini_service_execstartpost" "$run" "$runpriv"
} | write_function start_cmd
else
[ "$service_type" = oneshot ] && write_function start :
fi
if [ -n "$execstop$ini_service_execstoppost" ]
then
{
write_commands "$chdir"
write_commands "$execstop" "$run" "$runpriv"
write_commands "$killstop"
write_commands "$ini_service_execstoppost" "$run" "$runpriv"
} | write_function stop_cmd
else
[ "$service_type" = oneshot -o "$ini_service_killmode" = none ] &&
write_function stop :
fi
if [ "$ini_service_execreload" = '/bin/kill -HUP $MAINPID' -a \
-z "$run$runpriv" ]
then
printf 'alias do_reload=do_reload_sigusr1\n\n'
elif [ -n "$ini_service_execreload" ]
then
{
write_commands "$chdir"
write_commands "$ini_service_execreload" "$run" "$runpriv"
} | write_function reload_cmd
cat <<"EOF"
do_reload ()
{
log_daemon_msg "Reloading $DESC configuration files" "$NAME"
MAINPID=$(cat $PIDFILE)
do_reload_cmd_override
log_end_msg $?
}
EOF
fi
[ "$service_type" = oneshot ] && write_function status :
}
# parse command line
while getopts di:n: opt
do
case $opt in
d) debug=1;;
i) instance=$OPTARG;;
n) name=$OPTARG;;
?) printf "Usage: %s [-d] [-i instance] [-n servicename] [filename]\n" \
"$0"
exit 2;;
esac
done
: ${instance=INSTANCE_NAME}
shift $(($OPTIND - 1))
# convert unit file
read_unit "${1:--}" "$instance"
write_init "${name-$inifile_unit_name}" "$instance"
================================================
FILE: contrib/zefram-patches
================================================
Date: Mon, 14 Apr 1997 15:39:08 +0100 (BST)
From: Zefram <zefram@dcs.warwick.ac.uk>
Message-Id: <25042.199704141439@stone.dcs.warwick.ac.uk>
Subject: SysVinit patch
To: miquels@drinkel.cistron.nl
Hi. Enclosed is a patch for SysVinit that I am finding tiresome to
keep updating; you might like to fold it into your official releases.
It does the following:
* shutdown: use /etc/shutdown.allow if an option -s is given instead
of testing for a controlling tty. The tty check was inflexible and
unreliable.
* sulogin(8): refer to inittab(5) instead of inittab(4).
* sulogin: use libc passwd/shadow functions instead of home-grown ones
(there's just no point in using the special version).
* shutdown/sulogin: don't rely on the username "root" -- it's the UID
that counts.
-zefram
begin 644 initdiffs.gz
M'XL(``IG43,"`^T[:U/;R+*?E5_1>&L3&\G&#Y[FD%H")/%9)U"8G-0](44)
M>62KD"6M1K+7)YO_?KM[1K)DFP"[V:T]=2^5`FFFIZ??W=.C##W7A;H3@YS+
MJ1=X2;W=V#W8DN,T&8:SH+%?GC`+,\\V-S?O76:\CCWX9QI`:QO_=3N[W68;
M6@<'N\_J]?K].(T!+CF.8FAUH-WI-G>Z.QU:MD>;%7]X\U;+:NT!OP(T7L&6
MO/6"'!N-7;Z"3W!=3^BY=PE2./#YV48^'M^-`\?%(9J&Q)L(7M3#R9D=!UXP
MJD^$E/9(*)CKRM>O7YD#M34^U?_0UO*I>Z\3P^Z!M;>MQ$"DX>M^*R--_!KY
M-DHZC.>0H0L#2,8"G'`RL8,A^%X@<,!.8.;Y/MP*I#5((`G!]GU$D4H1R\:"
M!),>OGSY`E"7]-*[@&OWU75=7KL7^'X6R#36"&U>#'::C,/8DV)(6$E(0%)B
M*M`4$C$!3X(?CD8(X04-Q'(UQA'\%X3Q!,F8$Z(AS,8BH,TR.>..!.0@!,[>
MSFF.[`K'J_LU"_'PBI,D]NO'?E(_%3[!1S%*0@P;``,A%!7"2;R0</>.'0=G
MX20,DCCT%4^WP@]GX(8Q3$+DS0M<(HM6-)0X2"Z0RR53)DNF1V^$!N`C$:,E
MP/:^WJJ;.U9K8=?(TLG59;]^W+^JGY[UB64;:=`\6,2U$PLD)AB!'8`=17$8
MQ9Z="$`UHMJ]@+'TMD3B;)%T$OL6L324C"?"#J32EIB*>!ZB,<S&(8QME--X
M+CT4+M@L$T2#Q"O3"63H"[@3\]O0CH>H@4#IM:!2YA"N0B)URA:%^UGH`DL*
MI+7.6#AW+!I4B.<R(\IH_H.*92,J6@B:,.(A4D.7MYQZ<9(BH9HPV8">>[^A
MN'$X*9@*T>0EB@99(((0NQZRF0DOUQNB"6<:)RD"N2,'Z3'_`7E6A#J2C`&)
M1H(#&[V/*&=),]:9EXP5A"<38B028>23X2C?B46)872F)2ZAJAGI;4WM>"M.
M@ZTTF41(5ZT!YX$_)[[<A9A"*9:E*DD,:-9Q&"::GWQ/BX1"(0'1H$TY@CSF
M'`F.9^C*V23,8B]13J3C"UF^C*!%?P-767`FN2XZ]"H-^9;D)BJZMJU6>SL+
M8O_O`FM=@#1+;O![7"`W/H10D1L11131K/^[OE"2+QLWBF+5]%6X^%.,?_A`
M.>;<6SHYWRK''.,J%7"<CJBN:C6[.[O=UL'#Y9CSM'+LP&H5RA!\V\D<-
M`\L%E,`P1"$D,"(GBL-T-`;:&&ZY)""QAFDLA3\57''H=4Z7/,3!Y$U.X:.K
M#^>`*J8BJ9!,<_B$\KG$S81OSS%Y)S.!ECCHO;DZNWP'5//@\\^]?I]3.A%`
M:5POQG43^PY=F*J8A1/*=4ZH]N1?*%V"ZQKOO%]2I'2*2P>3$,N%X#:-1Q9,
M>%S^-(R]X$[X#0<M/<8"(O`5DG42W6M:>[M9(3`-/2(!C:Q:P]<OM,S%,!<D
M;E4F0Q''%%F,R@<"Z5XGD(L&/M7OXK$;.)_Q20GG,Q<I\$F7FIGY?KX.*HC7
MJ%PGA*!^UP7^&8;!BP10\%2*96@M="=\)12-I76Q7A>+6\PL8+L)2B[7U!+P
M6`./;7\M*%G37LO:R^OM[R`)^=\IBK5&LF_M=Q9^MX?E?^YX.>(@IW[9_ZXK
M7`95V`=QG,5$[(%KRV290$?CR?QQU0V7%JSWQ4S6Y(MW%$BE-PILGQ>;B\52
M[_9XARSOCM+A'%?A&KR">6243B@/4];'O6TZ%VU`E6J$ZTJ`>:Q2PT6(I'9(
M1H7')R^IMOAE_=FKO;MOM?<*XF^CS[;1:;/(AT1A:/.&08A$PA$T#_-1+</2
M6(26S0.F'D#I$=\YT.M>_PPVW4B].6,[ADV2.R>33YWVY\+$;>I^:K7W<6@M
MZ?O;5J=SD(47XI!^8U1RHGF5<-[X6+7X%E1:2A[/ZCB_M<FG)DRF,X%V.D6=
M4!*FPY)/*D6;G7BD2]C<X@4(64V<D4BB41Q5FS78.(+LK0;/G_,+\HTO1T?0
MPA%>1C]5-T+.W3`2075P>MSOGW]$:N)*C9&\_]#OU]#[ZT28@72]#]=28A&E
M,X%2+-;_'/85C8:GY*NP7&)Z@34U3@8\&V/%4G61:EE%"5N`(K8P_M04+89!
M#)/HFY^)H1<_O(#??H/"P'7PHL:$>D$J#O,E'KR$3FMY!C-459(4$,$A;,KH
M$&1DFC46ZR;-9!CY1;-A+$S",TW<EM0Z3".BJ\807YEOWO8?T&G7H+#B<X['
M=7RLE%`-O"@7\PP=V+_+0TBIY**BT?6HKY"74JJ#4!+?!HW=A'>D_RH&'C:)
M-$'?K*Y3KK&PND1W!G1O@<LS/*]S4?BODVP79BU-ZB_3Y":91X)0?AB<7=Y<
M7)Z?G`T&RV*6.GVP0BM;0S'=^E%6+-`HJ$=26ZA*)G:B0)_+I(8";*Y3*((U
M9'(3(S)X#LU?7[\^4=;?_+6YW5Q:DG%Y24F"V/-G]ES"^<\ECL@Y)U'&&`F`
M_`&75-AYFID)&EJ\IJG(,6XQHM^IYZ_?D"F55VCJ.K3F6Y,1*A\!92ZDMJ+!
MX#C:I-J*Z-Q`0@.BM`B42U/1_>'JYOWQN[-![]]GN>NL$EZD7!DM_Q+!4%M+
MP3`U-VP7,UMFO.1>3H1I_$5?+4:9D_/W@_/^&4IUMA)EJ#S,ZPPW0ICK^)&U
M?>,Z5DDEPU+R*\V8D6<;S26%9&0.5-2]T)9.&4T=U91/T;1RJJJC_`AGJYCJ
M'(L2WA3I='[!JB=PYTEWU/6ZFK&S\]<U53N!(?$`YHRK#C-*66Q_SVH?M%46
M6Y<\.GMMJ[/?7N2]3GL'!_(C.RN+_RP2"<<_(AVIPN=#-:_UBUG?<&P\E;V0
M+[HJR7#BFX1#05S2O)$GPY9:D"UF'HRA<.W43[KZU=`58C:M@0WU^E6G/!,X
MU>*&IV'6"DSQ5#<GIPA&#;6WRF)Z>PI9CTI,)EOE1_&">X99*B>.+)#A@U7-
M)B'`DT7IY*O/NPU0D6(8"LD5':X/J27I<%VJ?C($O^!!V7/G%J%@&7LJQ#AT
M@D9HW#X-T*ZG:$2TD^TX81HDFO<L.YH/9T?S@>QH/CT[FO=F1_/W94?SP>QH
MDG68#V5'LYP=V8[^8'8TGYP=U:Y/RX[FT[*C^>CL:#XJ.V90&X.;WN#D[:7.
MDN05M75P3\BB]TMC35XSGY#7S#^2U\SEO&86\YJI0F5F<\6\EIO4M_*:N9K7
MS"?E-?.[Y#5S-:^9H!E;Y#7-I8Z[.J]Q1*%S3^BNG"95J6ZK)J'.=<NL#4XO
M>J=KHB\&>5?B&4OS].,0#?8Y[H-TW-=F2[E!N>;2,YM8UV3+YOC*<R`B@%WJ
ML37;W>W._3VV?-636FS[>8L-H#%X"Z=G@Y/+WL55[_R]ND?4>/&%+#^8AG>E
MB['J?HU:M7PK5NA3CT)NR%*[%Z6/HF93(Y=\1J=C[47#D"\*551#E\IZZ]1U
MU4WUZG9-M5QQOYZZ74%KE2$U<F-/<$=9_(IY,.%.LJ8V)TGEI<B6?%6HN]/4
MJ0?7MT>(A,V!)JB7,@GY8A.J8F1!O]<_K_$MY86Z0V!191>T?T=1[?PM1/6`
M*SCW&:[S#5=PC(](U#]3']K;T-KIMMK=SNZ#KN`8[T+M"MO01`=J=EO?<(7V
M-E:HA;[+MM5I9OK^P0L</\7"\1^N$R1^8_RR-*B;34NCT6Q(0V81<&QC%%H&
MY+Y"*%>PSN66%SJ+[5RXN7GS_L--O_?J\OCR?VYNX.41[*XOISO6=C-S[!^P
MD*4[^9.W9R<_WZ#=&JV5T7>G.SR*YX-LXN)X,/AX:E2X."/#F`TKA>G!V^/3
M\X]Z6C%6*:!]U7L_>(NSZC,&FGF6M9?^A2&?+L>/H/)3]8>:UA>T&GO0VJ^C
MFNND6G@W'30JA^HP@,HXN/_P0"5A>]%Y^JHVV]JD(\^F,1#TX0`639Y]Z^>7
M3U/;3X7Z(B#A$-]@:#K8<3M8BJ2JR-W$I98F'5?1J?1+=ORC=QJ-D1E\II.6
M/@YOJ3:^\4:H&SPZ5+-[S<)XJ/Q7=?LI"6$5D#IZ>@B;6)P1>#3CQ,T=Z0T\
M4R54CB_!HI$=TN2BC;>`9)*IEOK4WMG]O#(CRU.*0>X#4JIC^K'8-UY3.S7$
MHE&&$P'Z3,37;?9P2AW'A@+<(B1D\]'LAF[D2+W<23@L3&BJ<:HT/!).*&ET
MD$88_3Y@""S-#ST2<&6K-"C'PO=74*59P[.`?3%$H\OY7MEYEO"/%@D?80TD
M)\:B3L'4&*L18^T<!YC[2?;ZZ$<3*+(-+3(LR%GAGHKUN=ZI[F@H*):7/F<S
M,7S$(9U8@$K19YR-,CFZ9\,EHP)E&7>Q%-E116R-X8Q%$<M<@'D$.^J9#/MY
M21T6V904$0XC/CK.*\@J.4)M:>[!J2)^UNM]Z(N`J.#'@+'*RX!4+M8R+H_8
MW-6;KH<W2#\;Y;/51EE=/1411.#$\RC!3).K"\,#>K4WU("8\"A:N'B81:$I
M,RAJD[03+5O0TD42%HZ2BV"5PMWL8XD`57B_E65<Z)CC#:LE#:*A+!EER86O
MBB:HBA/"P3?Z=`G-<=#6P"J4Y_`6<*61%+U<M_27C*BB+6"EGN9$<8]_K95.
M.59J:A\IH16/DD]P*?FG^]23K;*H-YGP-P1*'I:&(UY0/Q;??7U_FU3:RWSQ
MFXK/+71CO8G^+HT_<G_@S9><8%$(<"H^EG?,6U&L#7@?)OKKPMP5@E`MT,F.
M[W,I`^)1>286GQ#*.R]2+8%A&M,IDRKC+*EOZ(J!+J.8SOQJV=`97)=]$/KD
M9,G\4,TM$C2M^]3:58U-A0T91,.F"1ZD"SWO4*<?+=?*&V^Z7&[PEX8V3HN`
M,G9V'YDOJ9)4J&^COU*LG_(2Q2F:G1TG:53K@E[FNGXJQZ1!E(J^R:.OK-I[
M5FL_OZI<DOZ?7`BAKK(XL(1D:5A&-"C7Q<DGE3IJP_75SF)NN>!9S-Q;\RQ`
MRF7/8GRI\EE,%(N?PDYKZI^(B2+CG.&B:O,1D?G$I@\5N-EHPX?>*30S$;,2
ME5$5XW*FDE*)!`]GVSRU%D)8'E'J+]=DO;\BZ97W5G</S47"D[E$980&D9-*
MQE$0[GK17A0=]4=9"H`E1+R?\"4?8[(X*QE$1C?X%Q/<NBU4`JL,RFP^?CN5
M\4H2H"YW<>/#0@#^6\9?]<Y\_961^$?YK3AL@1;T=XW&:_L;!WM6IYEW^PP5
M<`V4CX/"&6/$LV!W6Z'$>D8$TVKE[?F[,R113;:4.61S_?,WU):N9!?&*P!T
M`;`T6T`]>'O6[^.P3'51K^:U"ZL.S+;5WLG_Y\%W)+AHX_>1O0KS:.+7-F3V
M]ZW.P4XN_3Q,K76*0MA1]6RK6*UR<5NH*PJA.[^_5)!K8A8&+?CM-X;(OL[!
MPI=C<35:L*TC[,J`^BI`W;1J[FF7FN[3=':LSO9"94_D<HFQ<@C5+?B_G*__
)!9>7)7O2-```
`
end
================================================
FILE: doc/Changelog
================================================
sysvinit (3.15) released; urgency=low
* Patched manual page for runlevel command. This cleans up formatting and whitespace.
Patch provided by Bjarni Ingi Gislason.
* Fixed formatting in init manual page to indicate runlevel arguments
to telinit are not optional.
sysvinit (3.14) released; urgency=medium
* Re-introduced DESTDIR flag in src/Makefile to assist building on Arch.
* Fixed typo in init.8 manual page.
* Expand process length in inittab to allow a command line 253 characters
(up from 127). Expand child process structure to accomidate 253
and some buffer room for newline/NULL.
* Clear buffer when reading long lines from inittab, avoids garbage left
over from old lines with long commands or comments.
* Drop lines which are too long from inttab conf and log warning rather
than truncate.
sysvinit (3.13) released; urgency=low
* Adjusted manual page install location. Patch provided
by Mark Hindley.
sysvinit (3.12) released; urgency=low
* There were instances of the ctime() function being called in multiple files without
checking the return value (can be NULL) and without checking the length of the
returned information. While there _should_ never be a case where ctime() fails
assuming success and length of returned string isn't ideal (or future-proof).
We now check the return value of ctime() in bootlogd, dowall, last, logsave, and
shutdown. Where no valid value is returned we supply a dummy value (usually a
space in place of the expected time stamp). We also no longer assume returned string
is at least 11-16 characters.
* Re-commit flexible Makefile for GoboLinux.
* Make sure pty.h and sys/sysmacros.h are included when building bootlogd on
systems with glibc.
* Fixed typos and syntax in manual page for init.8.
Edits provided by : Bjarni Ingi Gislason.
* Allow setting of location of the /usr directory in src/Makefile.
This is handled by the usrdir variable.
* Make sure src/Makefile uses sysconfdir (/etc by default) when installing
configuration files.
* Fix typos and syntax in pidof manual page.
sysvinit (3.11) released; urgency=low
* Some escape characters were included in the inittab manual page, but not displayed
by the "man" command because they were not (ironically) properly escaped. This has been
fixed.
* Enabled chaining commands together in the inittab file. This allows the admin
to run commands like "task1 && task2" or "task2 || task2" from the inittab file.
* Fix typoes in halt manual page. Fixes provided by Bjarni Ingi Gislason.
* Fix typos/markdown in fstab-decode manual page.
Patch provided by Bjarni Ingi Gislason.
sysvinit (3.10) released; urgency=low
* When the user executes "machinectl stop", systemd sends SIGRTMIN+4 to PID 1
in the container, and expects that to initiate a graceful shutdown (power-off).
SysV init now catches this signal and initiates a shutdown (shutdown -hP now).
- floppym provided patch to accomplish this.
* Fix issue in bootlogd which could cause the service to enter an endless loop
(and use too much CPU) when it is able to open a device for writing, but not actually
able to write to it. This resulted in bootlogd closing and re-opening the device over
and over. Now bootlogd should simply fail gracefully when it cannot write to an open
file/device.
* Fix formatting in shutdown.8 manual page. Cleaned up whitespace and special characters.
sysvinit (3.09) released; urgency=low
* Patch for man/Makefile to fix the clean recipe.
Provided by Lucas Nussabaum and Mark Hindley
* On Linux systems, allow reboot command to pass a message
to the system firmware during the restart. This is
accomplished with the -m flag.
* Patch from kraj which allows hddown to compile
when musl is the C library.
sysvinit (3.08) released; urgency=low
* floppym provided patch which causes the halt command
to call "shutdown -h -H" instead of "shutdown -h" when
halt is invoked without parameters. This forces the shutdown
command to set the INIT_HALT variable and assume, unless other
conditions apply, that the "halt" call really wants to halt the
machine and INIT_HALT should be set. In other words we
assume halt wants to halt unless told otherwise.
Addresses downstream Gentoo bug ID 911257.
* Applied a patch from floppm which adds kexec option to the halt command.
* Updated halt documentation and help output to display parameters in
alphabetical order.
sysvinit (3.07) released; urgency=low
* Fixed killall5 so that processes in the omit list are
not sent any signals, including SIGSTOP.
* Fixed usage message for killall5 to be more accurate.
* pidof was not returning PIDs of programs which were launched
using a symbolic link. (ie /tmp/sleep when /tmp/sleep links to /usr/bin/sleep).
This is now fixed as we check both the realpath and symbolic path for processes.
In other words, "pidof /tmp/sleep" and "pidof /usr/bin/sleep" will return
the same PIDs when /tmp/sleep is a symbolic link to /usr/bin/sleep.
* Fixed memory initialization error in pidof. Fix provided by Markus Fischer.
* Accepted patch from Mark Hindley which avoids clearing realpath information
in pidof when trying to find matching executables.
sysvinit (3.06) released; urgency=low
* Mark Hindley fixed typo in es.po
* Mark Hindley cleaned up translation code in src/Makefile.
* Drop sulogin from Debian build. Removed libcrypt-dev dependency.
* Fixed pt translation pages which were failing due to mis-matched
open/close tags.
* Makefile now respects ROOT prefix when setting up pidof-to-killall5
symbolic link.
* Removed redundant translation files from man directory.
* Makefile now respects DESTDIR. User can specify either ROOT= or DESTDIR=
to set install prefix.
sysvinit (3.05) released; urgency=low
* Helge Kreutzmann provided updated Makefile for
translation of manual pages. This has been added
to the man directory.
* Added sys/sysmacros.h include in mountpoint.c to fix
compiler errors on systems where major/minor macros were not defined.
* Applied patches from Mark Hindley to clean up man page
Makefile, translations and installs of new man pages.
* Remove reliance on linux/fs.h as it conflicts with glibc 2.36.
Patch provided by lucascars.
sysvinit (3.04) released; urgency=low
* Mark Hindley supplied patch to make bootlogd compile
on GNU Hurd systems. Was missing major/minor macro.
sysvinit (3.03) released; urgency=low
* Fixed formatting in init.8 man page.
Patch provided by Mark Hindley.
* Fixed compile error on GNU Hurd and musl-base systems. Due to missing MAX_PATH definition.
Error reported by Mark Hindly.
sysvinit (3.02) released; urgency=low
* Added q and Q flags to synopsis in shutdown manual page.
* Applied fixes for markup and spacing in manual pages.
Patch provided by Mario Blattermann.
* Added translation framework (po4a) from Mario Blttermann.
* Added Makefile for man/ directory. Will handle translations
and substitutions.
* Applied new translations for multiple languages from Mario Blattermann.
* Added ability to use "@" symbol in command named in the inittab file. This
treats commands as literal and does not launch a shell to interpret them.
* Updated inittab manual page to include overview of symbols which trigger
a shell interpretor and how to disable them using the @ symbol.
* Introduced change which adds error checking in bootlogd when performing
chdir(). - Provided by Alexander Vickberg
* Add check for console using TIOCGDEV on Linux systems in bootlogd to
make finding console more robust. - Provided by Alexander Vickberg
sysvinit (3.01) released; urgency=low
* Default to showing processes in the uninterruptable state (D).
The -z flag no longer affects whether processes in D state are shown.
The -z flag does still toggle whether zombie (Z) processes are shown.
* Removed unnecessary check which is always true from init tab parsing.
sysvinit (3.00) released; urgency=low
* Applied patch from Matthias Schiffer which allows bootlogd to read from
a wider range of consoles. The console name is already passed in from the
kernel command line using "console=". We no longer filter out names as strictly
but do now check to confirm the "console=" device points to a valid TTY.
sysvinit (2.99) released; urgency=low
* Fixed typos and missing underlines in shutdown manual page.
Corrections provided by Helge Kreutzmann.
sysvinit (2.98) released; urgency=low
* Fixed time parsing in shutdown when there is a + in front of a 0 time offset.
Commands with a positive time offset (+1) would work but +0 fails.
This has been corrected by Arkadiusz Miskiewicz.
sysvinit (2.97) released; urgency=low
* Check $(ROOT) filesystem for libcrypt instead of a hardcoded path to /usr.
Added logsave and readbootlog to list of files git ignores.
- Patches provided by Petr Ovtchenkov.
* Code clean-up and making sure we avoid freeing unused memory.
Patch provided by David Hoyer.
* Added shell script from Trek which converts systemd unit files
into init.d style scripts.
* Added patch from Didier Gaudin which allows init to load configuration
data from files stored in /etc/inittab.d/
* Added patch from William Shipley which allows shutdown time to be specified
in the format +hh:mm. This is in addition to the existing formats such as
hh:mm, +m, and "now".
* Fixed typos in manual pages. Submitted by Helge Kreutzmann.
sysvinit (2.96) released; urgency=low
[ Jesse Smith ]
* Added -z command line parameter to pidof which tells pidof to
try to find processes in uninterruptible (D) or zombie (Z) states.
This can cause pidof to hang, but produces a more complete process
list.
Closes Savannah bug #56534
* Reformatted init code to make if/while logic more clear.
* Cleaned up some output from readbootlog.
* Added -e flag to bootlogd. When -e is used, data saved
to the boot log file does not have escape characters
removed. This means colour and cursor movement codes
stay in the log file. The may then look nicer when
read with "less -R', but may appear cluttered or
out of alignment when viewed with other, plain-text tools.
When -e is not used, escape characters are removed/filtered.
Closes Debian bug #672361.
* Make sure src/Makefile cleans up all executable files
when parent Makefile calls "make clean".
sysvinit (2.95) released; urgency=low
[ Jesse Smith ]
* Fixed various typos and control codes in manual pages.
Patch provided by Bjarni Ingi Gislason.
* Dropped "-f" format flag for pidof command as it
could be used to print information from memory or crash
pidof. Replaced flag with "-d" which allows for a custom
separator to be used between listed PIDs.
Patch supplied by KatolaZ.
* Updated manual page to describe -h and its modifiers (-H and -P)
in more detail. Should close Debian bug #374039.
* Use millisecond delays in init so that shutdown
can happen without a near-full-second delay after
all processes have terminated. Replaced do_sleep()
with do_msleep(), provided by Serge Belyshev.
* Replaced hardwired sleep constants in init.c with
defined constants for easy updating in the future.
* Accepted patch from Luc Gommans which explains why zombie and
deep sleep processes (Z and D) may be hidden from pidof.
* Removed link instruction against sepol library from src/Makefile.
This has no change to the resulting binary, just makes the
Makefile cleaner.
sysvinit (2.94) released; urgency=low
[ Jesse Smith ]
* When the halt command is called with the -p flag (or as poweroff)
the command now passes the "-h -P" flags to shutdown. This
in turn sets the INIT_HALT environment variable to POWEROFF.
Assuming this value is checked by initscripts during the
shutting down procedure, it should cause the system to
be powered off.
If halt is called without -p then the value of INIT_HALT
is not set and the default action (often set in /etc/default/halt)
is taken.
* Removed unnecessary malloc.h includes. Memory allocation
and freeing is now handled in stdlib.h
* Added defines for FreeBSD to make some components compile
on FreeBSD 11.
* Increased the size of the kernel command line buffer in bootlogd
from 256 characters to 4096. This size is defined in KERNEL_COMMAND_LENGTH
for easy modification downstream.
* Added logsave.c and logsave.8 manual page from e2fsprogs to make
sure logsave is available to initscripts.
* Updated src/Makefile to make sure bootlogd compiles with Clang.
* Use defined constants for password length in sulogin. Makes
it easier to update/patch later.
* Minor code fixes across multiple source files to avoid buffer
overflows, or uninitialized strings.
* Changed the way the "when" variable is used internally in shutdown.c.
It starts as a NULL pointer, then might get set as a pointer to optarg,
then it might get set to point to an argv parameter, then it might have
a string value copied into it, over-writing the original data. We should
not risk over-writing internal variables which might get used for something
else (it's rude and security risk). Set up "when" as its own buffer
that has data from optargs and/or argv copied into it.
* Fixed typo in init.8 manual page.
* Updated text of fstab-decode to explain what the utility does.
sysvinit (2.93) released; urgency=low
[ Jesse Smith ]
* Fixed typo in pidof which would prevent the -o (omit PID)
flag from working.
Fixes Debian bug ##913394.
* Fixed error where pidof would not omit checking PIDs passed
to it when the -o flag was used.
Fixes Debian bug #913394.
sysvinit (2.92) released; urgency=low
[ Jesse Smith ]
* The shutdown and init commands were using different default delays between
sending processes SIGTERM and SIGKILL - they were 3 and 5 seconds, respectively.
Unified these on 3 seconds, using a new defined value in init.h.
Updated shutdown manual page to reflect the change and better explain
how -t and -n flags work.
Updated the init manual page with the new default value.
The updated documentation resolves Debian bug #375274.
* Remove PC speaker beep from shutdown process in dowall.c.
Closes Debian bug #614893.
Patch provided by Andreas Fackler.
* Removed unused Version variable from wall.c.
* Updated halt/reboot manual page to acknowledge the -i
flag may not properly shut down network interfaces if the interface
does not have an IP address.
Addresses Debian bug #361935.
* Applied patch from Daniel Povey which should allow killall5/pidof to
avoid locking up if it encounters stopped or zombie processes
due to broken NFS mount points.
This should allow Debian bug #719273 to be closed.
* Applied patch from Regid Ichira to clarify shutdown command
line options. Updated manual page for shutdown.
Closes Debian bug #630661.
* shutdown command was setting environment variable INIT_HALT to
"POWERDOWN", this should have been "POWEROFF" as specified in the
manual page. Fixed code to match manual page and init scripts.
Closes Debian bugs #717531 and #590895
* Added -l flag to "last" command. When used it allows "last" to
display usernames longer than 8 characters long.
* Added -q and -Q flags to shutdown command to make the "system is going down"
message appear less often. The -q flag causes messages to only appear at the
10 minute, 5 minute and x-hour intervals.
The -Q flag maintains complete silence up until the final "now" warning.
* Mention GRUB as a potential boot loader in init page since LILO is
rarely used anymore, outside of Slackware.
* Swapped out ECHOPRT for ECHOE in stty settings when init brings up
emergency console. Should make backspace-erasing characters work
more naturally.
Closes Debian bug #402847.
* Updated src/Makefile to make sure we build all the software before
attempting to install.
* Removed typos from pidof manual page and killall5 page.
Closes Debian bugs #815839, #905245 and #890478
* Added -f <format> option to pidof program to allow printf
style formatting.
Closes Debian bug #571590
Thanks to Philipp Marek for the patch.
* Added new tool (readbootlog) which will read the /var/log/boot file
produced by bootlogd. The output is displayed cleaned up so there
are no control characters. This avoids the need to use sed or related
tools to try to clean up the contents of the log.
* Added manual page for readbootlog program. Updated bootlogd page
to reference it. Closes Debian bug #725123.
* Updated the shutdown manual page to try to make it more clear
where we are talking about an initscript called halt or the halt
program. Likewise whether we are talking about the shutdown process
or the specific shutdown program.
Should address Debian bug #374039.
* Added patch from Samuel Thibault to make project compile
on Hurd branch of Debian.
sysvinit (2.91) world; urgency=low
[ Jesse Smith ]
* Adjusted order of compile flags to make it easier for downstream
to adjust optimization level. Patch provided by Matias Fonzo.
Can now set optimization level in CFLAGS variable.
* Added --version command line flag to display current version info.
Updated manual page for init.8 to match.
* Version information is now fetched and defined by the Makefile.
No more need to update the version manually in the init.c source.
* The init process now writes the current runlevel to /var/run/runlevel.
This information can be read by the "runlevel" command as well as "halt"
and "reboot". Having the information logged in /var/run/runlevel as
well as the utmp file means systems without utmp (like those running
the musl C library) can still check the current runlevel. This is
useful when running halt/reboot as these programs want to check the
runlevel.
* Added patch from Walter Harms which allows pidof to run without
displaying output. In this mode pidof simply returns true or false
without displaying PID values.
Updated manual page with new -q (quiet) mode.
Added -h flag for pidof, which was recognized before, but not used.
The -h flag now displays brief usage information for pidof.
* Added check for kernel parameter init.autocon=1. If this exists, then
init will try to open its own console. If not, then any console=
parameters will be ignored. This avoids conflicts with native kernel
created consoles.
sysvinit (2.90) world; urgency=low
[ Jesse Smith ]
* Updated some comments in init.c to answer questions or
remove old notes we no longer need.
* Removed unneeded "count" variable in utmpdump.c.
* Fixed typo in accidental wrote_wtmp_rlevel == 0 || wrote_wtmp_rlevel
comparison so the latter is wrote_utmp_rlevel.
* Simplified logic in mountpoint.c when testing for same device or same inode.
Thanks to David Binderman for pointing out the above three issues.
* When we run shutdown and then the computer is put to sleep, the
shutdown command recognizes time has passed and continues its
countdown taking the time lapse into consideration. This prevents
longer waits if we slept past the time we should have shutdown.
Accurate to the nearest minute.
Closes Savannah bug #36279.
* Added document article and manual page for the initctl (/run/initctl)
named pipe. Makes it easier for people to communicate with and
extend communication to init.
* Added check that named pipe is open before trying to close it
when something goes wrong or we receive SIGUSER1. Avoids potential
crash if we receive SIGUSR1 while pipe is not open.
* Added new signal handler for SIGUSR2. When init receives SIGUSR2
it closes (and leaves closed) the named pipe /run/initctl. This
can be used to make sure init does not have any files open. However,
it also means we cannot switch run levels or bring down the system.
The pipe can be re-opened by sending init the SIGUSR1 signal.
* Added "Fall through" comments to some switch statements where multiple
approaches are tried in order to prevent warnings from GCC 7 (and newer).
(Thanks to Matias Fonzo for this fix.)
* Added includes on Linux for sys/sysmacros.h as the old defines in
the sys/types.h file will be removed in the future.
(Thanks to Matias Fonzo for this fix.)
* Removed old LSM file.
Added .gitignore files to avoid git tracking object files.
Removed old start-stop-daemon from contrib directory.
(Patches provided by Guillem Jover.)
* Cleaned up most warnings generated by GCC 7 & 8. We still
get some from faulty "nonstring" reports, but silencing them on
GCC 8 results in more warnings on GCC 7 and Clang, so leaving them
for now.
* Fixed compile error on Fedora 28 where crypt() will not link due to
undocumented dependency change.
* Updated Makefile to make sure correct version number and correct
version of files are used. Makefile was pulling from master to create
tarballs with old version information when trying to create beta
snapshot.
* Updated version information in init.c
* Updated compiler flag from -fstack-protector to -fstack-protector-strong
for better protection.
* Cleaned up toplevel Makefile so it stops creating unnecessary temporary
directories.
* Fixed typo in mountpoint.c. Patch provided by Radostin Stoyanov.
sysvinit (2.89) world; urgency=low
[ Jesse Smith ]
* Updated mountpoint command with -p flag. The -p flag causes
mountpoint to search for circular mount points. For example, if
/a/b/c/d is a mount point for /a/b then the former is a valid
mount point. This only works on Linux since it uses /proc/mounts.
Updated manual page to match. This fix closes Savannah bug #37114.
* Removed two sleep calls when we are doing sync anyway to make sure
data is being written. Speeds up reboot time by about two seconds.
* Fixed Clang compiler warning regarding variable data parameters to sprintf().
* Updated top-level Makefile to work with git repo instead of old svn repo.
* Removed unused variables and findtty() function in bootlogd
* Add checks to return code for fscanf() called in init.c.
This mostly just cleans up compiler warnings.
* Perform error check on setuid() call as suggested in manual page.
* Fix typo in killall5.c
Move initscript sample file from "src" to "doc" directory and updated
Makefile to match.
* Allow multiple console output
When booting a kernel with multiple serial console support, or multuiple
console arguments ala "console=tty1 console=ttyS0,9600" the kernel will output
messages to all consoles, init however will not. It will only send output to,
and accept input from, the last of the consoles.
This patch fixes it.
(Patch provided by Martin Buck.)
* Added Patch from Debian developer Mats Erik Andersson to make
ioctl work on GNU/kFreeBSD. Patches bootlogd.
* Added Robert Millan's Debian patch to set TERM variable to xterm (instead
of cons25) when running on GNU/kFreeBSD.
* Added Robert Millan's Debian patch to use /run/initctl as the named
pipe for communicating. This works around a limitation on the kFreeBSD
branch which prevents us from using /dev/initctl for pipes.
* Confirmed we have applied Guillem Jover's patch to make
ifdown work on FreeBSD.
* Confirmed we have Debian patch to fix enabling SELinux.
(Credit to Petter Reinholdtsen)
* Confirmed we have Debian patch to make sure utf-8 flag is not cleared from tty.
(Credit to Samuel Thibault)
* Confirmed we have Roger Leigh's Makefile patch to allow building
with multiarch libcrypt.
* Applied Justus Winter's symlink patch to make sure killall5
builds and runs on Hurd.
* Confirmed we have Werner Fink's PATH_MAX patch for getting
killall5 to build on Hurd.
* Made sure we have Petter Reinholdtsen's patch to init.c which
allows init to build on GNU/kFreeBSD despite missing VSWTC.
* Dropping Debian patch to use /run/nologin instead of /etc/nologin in paths.h.
Seems every distribution uses a different location. Oracle uses /etc/nologin,
CentOS seems to use /var/run/nologin.
We will use /etc/nologin and let distros patch to suit their own preference.
* Updated halt.8 man page with corrections from
Christoph Anton Mitterer.
* Confirmed we have applied patch from Bjarni Ingi Gislason
which fixes typo in fstab-decode man page.
* Applied Debian patch to allow init to build on GNU Hurd.
(Credit: Roger Leigh)
* Confirmed we have Debian patch from developer Johannes Truschnigg
which informs the user of field size limit.
* Applied patch from Debian to the init manual page (init.8)
to better address runlevels. (Author unknown)
* The pidof command used to discover the correct PID of
a process even if the wrong path was given. For example
pidof /wrongpath/sleep would find the PID of a command run as "sleep".
This bug was reported on Launchpad for Ubuntu and on Savannah.
https://bugs.launchpad.net/ubuntu/+source/sysvinit/+bug/1546126
http://savannah.nongnu.org/bugs/?47196
This bug appears to have been fixed in the development branch,
allowing these bugs to be tested/closed.
* Confirmed Savannah bug #37114 (mountpoint does not detect
mount points using --bind on same file system) still exists,
but fixed in Debian and Red Hat.
Considering this bug closed since distributions are using
util-linux's mountpoint program and ours is no longer
built/used by default.
Considered importing util-linux mountpoint but that would duplicate
effort and pull in a new dependency on libmount.
* Problem with pidof breaks after prelink (Savannah bug #34992)
fixed. Patch supplied by Dave Dykstra.
* Patch to automatically spawn a getty on kernel consoles
The feature is useful for developers and admins that occasionally need
to boot with e.g. console=ttyS0.
The built in default can be overridden via inittab for each device. An
entry like "S0::off:" turns off the getty on ttyS0.
characters in log file. Also makes parsing easier.
This should close Savannah bug report 36528.
http://savannah.nongnu.org/bugs/?36528
* Applied patches provided in Savannah bug report 49991. Fix tabs in
bootlogd and avoid printing uninitialized "buf" variable when
consolename() fails.
[ Werner Fink ]
* Do not forget room for last NULL of new environment (was
local bug 35866)
* Handle deleted binaries in pidof (was local bug #34992)
* Allow init to delete extra environment variables (was local bug
#35858)
* Avoid that init double environment variables for its children
(was local bug #35855)
* Remove man-db tag for encoding for canonical man
* Sulogin: try to detect the real device(s) used for the system console
/dev/console if but only if /dev/console is used. On Linux this can
be more than one device, e.g. a serial line as well as a virtual
console as well as a simple printer.
* Fix counting message lines in wall. Patch from Petr Lautrbach.
* Fix bad printf conversion specifier in wall. Patch from Sébastien Luttringer.
* Add patches from Openwall project. Thanks goes to Solar Designer.
* Add code to detect the system consoles with the help of the
new /proc/consoles files of linux kernel 2.6.38+
* Try to make utmpdump IPv6 valid, change based on suggestion from
Navdeep Bhatia (see local bug #32429)
* Fix signal and alarm handling based on the patch from Florent Viard.
(was local bug #32304)
* Add fix for Redhat bug #573346: last incorrectly displays IPv6
addresses (was local bug #29497)
* Correct fix for Debian bug #547073: use IUTF8 flag if defined
and if already set to make sure the utf-8 flag is not cleared
from the tty. Patch from Samuel Thibault.
* Include limits.h in killall.c to enforce definition of PATH_MAX
* Fix sysvinit bug #29758 Linker invocation should not contain
headers. Change based on patch from Elias Pipping.
* Add fix for Debian bug #580272: use return value 1 of
is_selinux_enabled() to determine if SELinux is enabled,
otherwise initialize SELinux and load the policy. Patch from
Petter Reinholdtsen.
* Make quotes visible in example of the manual page of fstab-decode
* Sulogin: enforce reconnection of stdin/stdout/stderr if a device
was specified.
* Sulogin: if zero is read at reading the passwd guess it's done.
* Sulogin: respect byte order that is do not mix chars and ints
* Shutdown: use PATH_DEFAULT as suggested by Paul Arthur in local bug #36101
* Killall5/pidof: handle strange names of executables (local bug #36252)
* Sulogin: be aware the crypt(3) may fail (local bug #36313)
[ Petter Reinholdtsen ]
* Next release will be 2.89dsf.
* Add #ifdef in bootlogd.c to avoid gcc warnings about unused
variable on non-linux platforms.
* Only set the VSWTC field for termios in init if it is available,
to get the source building on FreeBSD.
* Add some code to be able to detect programs even as user with
kernel 3.0 and above
* Improve message printed when signaling processes to stop.
Patch from Matias A. Fonzo at the dragora project.
* Rename internal functions warn() and shutdown() in the shutdown
binary to avoid surprising dynamic library name resolution
conflict with NSS modules. Patch from Richard Tollerton.
* Try harder to find libcrypt.*, even if there is no static library
available. Also look in /usr/lib/*/ for the library, to handle
Debian multiarch systems. Based on patch from Andrew Gregory.
* Adjust included headers to be compatible with the musl C
library. Patch from Matias A. Fonzo and Dragora.
* Move dovoid() macro from #ifdef__GLIBC__ to #ifdef __linux__,
to match the condutions of the place where it is used. Thanks
to Matias A. Fonzo for noticing.
* Define _XOPEN_SOURCE when building to get crypt() from <unistd.h>
instead of using <crypt.h> in sulogin.c, to get the source building
with the musl C library.
* Use sysconf(_SC_SYMLOOP_MAX) instead of MAXSYMLINKS. If sysconf
returns an error, fall back to MAXSYMLINKS on platforms that
define it. Fixes build on Hurd. Patch from Justus Winter and
Debian.
* Adjust makefile to make it easier to link all binaries statically.
Patch from Matias A. Fonzo and Dragora.
* Rewrite findtty() in bootlogd.c to not chance working directory, to
reduce the amount of failure that can happin in that function.
* Adapt bootlogd TIOCCONS call to kfreebsd. Patch from Mats Erik
Andersson and Debian.
* Document length limit for the process field in the inittab. Patch
from Johannes Truschnigg and Debian.
* Fix typo in fstab-decode(8) font escape. Patch from Bjarni Ingi
Gislason and Debian.
* Port ifdown.c to FreeBSD. Patch from Guillem Jover and Debian.
* Drop dsf part from version number. It no longer make sense to keep.
* Remove obsolete/ directory from tarball. None of it have been useful
for many years.
* Make it possible to specify the initctl path as a compile time
define INIT_FIFO.
* Use narrowly scoped file descriptor for handling opened TTY in
spawn(). Patch from Michał Kulling.
* Check exit code from dup() in spawn() and log error if it fail.
Patch from Michał Kulling.
-- Petter Reinholdtsen <pere@hungry.com> Sun Apr 11 11:28:55 CEST 2010
sysvinit (2.88dsf) world; urgency=low
[ Petter Reinholdtsen ]
* Mention new home on Savannah in README.
* Revert change from Fedora/RedHat where the now obsolete command
INIT_CMD_CHANGECONS was introduced. Based on feedback and patch
from Bill Nottingham.
* Adjust makefile to make sure the install directories are created
before files are copied into them.
* Simplify build rules, based on patch from Mike Frysinger and Gentoo.
* Fix minor bug in optimizing of argument parsing. Based on
report from jakemus on freshmeat.
* Add casts to get rid of compiler warning about signed/unsigned issues.
* Change tty handling in init to make sure the UTF-8 flag is not cleared
on boot. Patch from Samuel Thibault.
* Add Makefile in toplevel directory.
* Print usage information when shutdown is used by non-root user.
Patch from Mike Frysinger and Gentoo.
* Sync shutdown manual page and usage information. Patch from Mike
Frysinger and Gentoo.
* Fix race condition in utmp writing. Patch from Gil Kloepfer via
Mike Frysinger and Gentoo.
* Rewrite findtty() in bootlogd to recursively search /dev/ for the
correct device, to handle terminal devices for example in /dev/pty/.
Patch from Debian.
* Make sure bootlogd findpty() returns an error value when it fails to
find a usable pty. Patch from Rob Leslie via Debian.
* Make sure bootlogd fflush() every line, even if asked not to flush
to disk using fdatasync(). Patch from Scott Gifford via Debian.
* Add compatibility code to handle old path "/etc/powerstatus" for a
while.
* Include definition for MNT_DETACH which is missing in older GNU libc
headers.
* Do not strip binaries before installing them, to make it easier to
get binaries with debug information installed.
[ Werner Fink ]
* Add the comment from Andrea Arcangeli about the correct
place of setting the default childhandler within spawn().
* Make sure that newline is printed out for last(1) even
if an utmp record entry is truncated.
* Check if utmp not only exists but also is writable and delay
writing out of the utmp runlevel record if utmp is not writable.
* Be able to find libcrypt also on 64 bit based architectures.
* Add option -w to the last command to display the full user and
domain names in the output. Patch from Petr Lautrbach.
* Add a manual page for utmpdump as this tool is sometimes
very useful even if not intended for normal use.
* Use paths.h macros for wall
* Change path "/etc/powerstatus" to "/var/run/powerstatus"
* Detected also removable block devices at halt/reboot to be able
to flush data and send them the ATA standby command. This should
avoid data loss on USB sticks and other removable block devices.
* Flush block devices on halt/reboot if not done by the kernel.
* Set SHELL to /bin/sh in the environmant of shutdown.
* Retry to write out shutdown messages if interrupted.
* pidof/killall5 - make omit pid list a dynamic one.
* pidof - provide '-n' to skip stat(2) syscall on network based FS.
* init - avoid compiler warnings
* init - initialize console by using the macros from ttydefaults.h
* init - add the possibility to ignore further interrupts from keyboard
* init - add the possibility to set sane terminal line settings
* sulogin - add the possibility to reset the terminal io
* Fix some minor problems
* init - enable is_selinux_enabled() to detect selinuxfs
* Add fix for Debian bug #536574 -- Can be enabled by -DACCTON_OFF
* Add helper program fstab-decode to make it easier to handle
/etc/mtab content. Patch by Miloslav Trmac and Fedora.
* Add fix for Debian bug #335023 - Make sure TERM is set on FreeBSD.
* Add fix for Debian bug #374038 - Make it clear that shutdown -c can
only cancel a waiting shutdown, not an active one.
* Add note to pidof manual page about the use of readlink(2). Patch by
Bill Nottingham and Fedora.
* Add PAM patch contrib/notify-pam-dead.patch based on Debian bug
#68621, which will add PAM support for programs spawned by init on
the console like sulogin. Based on patch by Topi Miettinen. This
patch is not applied by default yet while we review its
usefulness. It is only helpful for session handling, as sulogin
do not use and will not use a PAM conv() function. The current
sulogin is able to handle DES as well as MD5, SHA, and Blowfish
encrypted passwords due using getpwnam(3).
* Move utmp/wtmp before the execvp() in spawn() to be sure to
use the correct pid even on a controlling tty
* Remaining problem is that the pid of the second fork() for
getting a controlling tty isn't that reported by spawn()
* Re-enable writing utmp/wtmp for boot scripts
* Extend sulogin to support additional encryption algorithms
* Re-enable maintenance message of sulogin
* Enable the sulogin fallback password check to handle MD5, SHA, and
Blowfish encrypted passwords in case of getpwnam(3) fails.
* sulogin picking the SELinux context was broken. Patch by Daniel Walsh
-- Petter Reinholdtsen <pere@hungry.com> Sun Apr 11 11:28:55 CEST 2010
sysvinit (2.87dsf) world; urgency=low
* Fix typos and do minor updates in the manual pages.
* Correct section of mountpoint(1).
* Document -e and -t options for telinit in init(8).
* Update address of FSF in the COPYRIGHT file.
* Document in halt(8) that -n might not disable all syncing.
Patch by Bill Nottingham and Fedora
* Adjust output from "last -x". In reboot lines, print endpoint
of uptime too. In shutdown lines print downtimes rather than
the time between downs. Fix typo in string compare in last.c.
Patch by Thomas Hood.
* Improve handling of IPv6 addresses in last. Patch from Fedora.
* Document last options in usage information, previously only
mentioned in the manual page.
* Add new option -F to last, to output full date string instead
of the short form provided by default. Patch from Olaf Dabrunz
and SuSe.
* Adjust build rules to make sure the installed binaries
are stripped.
* Increase the compiler warning level when building.
* Fix utmp/wtmp updating on 64-bit platforms. Patch by Bill
Nottingham and Fedora.
* Avoid unchecked return value from malloc() in utmpdump.
Patch from Christian 'Dr. Disk' Hechelmann and Fedora.
* Make sure to use execle and no execl when passing environment to
the new process. Patch from RedHat.
* Correct init to make sure the waiting status is preserved across
re-exec. Patch from RedHat.
* Correct init to avoid race condition when starting programs during
boot. Patch from SuSe.
* Allow 'telinit u' in runlevels 0 and 6. Patch from Thomas Hood.
* Change install rules to make pidof an absolute symlink. Patch from
Thomas Hood.
* Improve error message from init if fork() fail. Patch found in Suse.
* Add support for SE Linux capability handling. Patch from Manoj
Srivastava, adjusted to avoid aborting if SE policy was loaded in
the initrd with patch from Bill Nottingham and Fedora.
* Add -c option to pidof for only matching processes with the same
process root. Ignore -c when not running as root. Patch from
Thomas Woerner and Fedora.
* Adjust init to terminate argv0 with one 0 rather than two so that
process name can be one character longer. Patch by Kir Kolyshkin.
* Make sure bootlogd exit with non-error exit code when forking of
the child successfully.
* Add bootlogd option -s to make it possible to control the use of
fdatasync(). Patch from Thomas Hood.
* Add bootlogd option -c to tell it to create the log file if it does
not exist. Patch from Thomas Hood.
* Let bootlogd also look at ttyB* devices to work on HPPA. Patch
from Thomas Hood.
* Change init to use setenv() instead of putenv, make sure the PATH
value is usable on re-exec. Patch from Thomas Hood.
* Add usleep in killall5 after killing processes, to force the kernel
to reschedule. Patch from SuSe.
* Modify pidof to not print empty line if no pid was found.
* Modify init and sulogin to fix emergency mode's tty, making sure ^C
and ^Z work when booting with 'emergency' kernel option. Patch from
Samuel Thibault.
* Modify init to allow some time for failed opens to resolve themselves.
Patch from Bill Nottingham and Fedora.
* Modify init to shut down IDE, SCSI and SATA disks properly. Patches
from Sebastian Reichelt, Werner Fink and SuSe.
* Modify wall to use UT_LINESIZE from <utmp.h> instead of hardcoded
string lengths. Patch from SuSe.
* Change wall to make halt include hostname in output.
* Change killall to avoid killing init by mistake. Patch from SuSe.
* Change killall5 to use the exit value to report if it found any
processes to kill. Patch from Debian.
* Add option -o opmitpid to killall5, to make it possible to skip
some pids during shutdown. Based on patch from Colin Watson and
Ubuntu.
* Add references between killall5 and pidof manual pages. Patch from Debian.
* Modify killall to work better with user space file system, by
changing cwd to /proc when stopping and killing processes, and
avoiding stat() when the value isn't used. Also, lock process
pages in memory to avoid paging when user processes are stopped.
Patch from Debian and Goswin von Brederlow with changes by Kel
Modderman.
* Change shutdown to only accept flags -H and -P with the -h flag,
and document this requirement in the manual page.
* Change reboot/halt to work properly when used as a login shell.
Patch by Dale R. Worley and Fedora.
* Let sulogin fall back to the statically linked /bin/sash if both roots
shell and /bin/sh fail to execute.
-- Petter Reinholdtsen <pere@hungry.com> Sun, 12 Jul 2009 19:58:10 +0200
sysvinit (2.86) cistron; urgency=low
* Fixed up bootlogd to read /proc/cmdline. Also keep an internal
linebuffer to process \r, \t and ^H. It is becoming usable.
* Applied trivial OWL patches
* Block signals in syslog(), since syslog() is not re-entrant
(James Olin Oden <joden@malachi.lee.k12.nc.us>, redhat bug #97534)
* Minor adjustments so that sysvinit compiles on the Hurd
* killall5 now skips kernel threads
* Inittab entries with both 'S' and other runlevels were broken.
Fix by Bryan Kadzban <bryan@kadzban.is-a-geek.net>
* Changed initreq.h to be more flexible and forwards-compatible.
* You can now through /dev/initctl set environment variables in
init that will be inherited by its children. For now, only
variables prefixed with INIT_ can be set and the maximum is
16 variables. There's also a length limit due to the size
of struct init_request, so it should be safe from abuse.
* Option -P and -H to shutdown set INIT_HALT=POWERDOWN and
INIT_HALT=HALT as environment variables as described above
* Add "mountpoint" utility.
* Slightly better algorithm in killall5.c:pidof()
* Added some patches from fedora-core (halt-usage, last -t,
sulogin-message, user-console)
-- Miquel van Smoorenburg <miquels@cistron.nl> Fri, 30 Jul 2004 14:14:58 +0200
sysvinit (2.85) cistron; urgency=low
* Add IPv6 support in last(1)
* Sulogin: even if the root password is empty, ask for a password-
otherwise there is no way to set a timeout.
* Removed support for ioctl.save.
* Turned of support for /etc/initrunlvl and /var/run/initrunlvl
* Fixed warts in dowall.c ("Dmitry V. Levin" <ldv@altlinux.org>)
* Fix init.c::spawn(). The "f" variable was used both as file descriptor
and waitpid(2) return code. In certain circumstances, this leads to
TIOCSCTTY with wrong file descriptor (Vladimir N. Oleynik).
* Fix fd leak in sulogin (Dmitry V. Levin).
* More error checking in all wait() calling code (Dmitry V. Levin).
* Fix argv[] initialization in spawn() (Dmitry V. Levin).
* Change strncpy to strncat in most places (Dmitry V. Levin).
-- Miquel van Smoorenburg <miquels@cistron.nl> Tue, 15 Apr 2003 16:37:57 +0200
sysvinit (2.84) cistron; urgency=low
* Don't use /etc/initlvl interface for telinit; only use /dev/initctl,
and give a clear error when that fails.
* Add -i/--init command line flag to init - this tells init
'behave as system init even if you're not PID#1'. Useful for
testing in chroot/jail type environments.
-- Miquel van Smoorenburg <miquels@cistron.nl> Tue, 27 Nov 2001 13:10:08 +0100
sysvinit (2.83) cistron; urgency=low
* Fix bug in shutdown where it didn't check correctly for a
virtual console when checking /etc/shutdown.allow
* Fix race condition in waitpid() [Andrea Arcangeli]
* Call closelog() after openlog()/syslog() since recent libc's
keep the logging fd open and that is fd#0 aka stdin.
-- Miquel van Smoorenburg <miquels@cistron.nl> Tue, 2 Oct 2001 23:27:06 +0200
sysvinit (2.82) cistron; urgency=low
* Print out correct version number at startup.
* Fix spelling of initttab in init(8)
-- Miquel van Smoorenburg <miquels@cistron.nl> Thu, 23 Aug 2001 17:50:44 +0200
sysvinit (2.81) cistron; urgency=low
* Fix typo/bug in killall5/pidof, -o option failed to work since 2.79.
Reformatted source code to prevent this from happening again.
* shutdown.8: applied redhat manpage update
* sulogin: applied redhat sysvinit-2.78-sulogin-nologin.patch
* sulogin: applied redhat sysvinit-2.78-notty.patch
* sulogin: applied redhat sysvinit-2.78-sigint.patch
sysvinit (2.80) cistron; urgency=low
* Grammar/spelling fixes in shutdown.c (Christian Steinrueck)
* Don't set controlling tty for non-(sysinit,boot,single) runlevels
-- Miquel van Smoorenburg <miquels@cistron.nl> Thu, 26 Jul 2001 13:26:56 +0200
sysvinit (2.79) cistron; urgency=low
* New upstream version
* several fixes to wall by Tim Robbins <fyre@box3n.gumbynet.org>
* Several extra boundary checks by Solar Designer
* Make /dev/console controlling tty
* Stricter checks on ownership of tty by mesg(1)
* Documented and restricted -n option to wall(1)
* Make it compile with glibc 2.2.2
* Document IO redirection in wall manpage (closes: #79491)
* Update README (closes: #85650)
* Fix init.8 manpage (closes: #75268)
* Fix typo in halt(8) manpage (closes: #67875)
* Check time argument of shutdown(8) for correctness (closes: #67825)
* Check for stale sessions in last(1) (Chris Wolf <cwolf@starclass.com>)
-- Miquel van Smoorenburg <miquels@cistron.nl> Wed, 4 Jul 2001 15:04:36 +0200
sysvinit (2.78-2) frozen unstable; urgency=high
* Change "booting" to "reloading" message at reload
* Add "-z xxx" dummy command line argument (closes: #54717)
-- Miquel van Smoorenburg <miquels@cistron.nl> Fri, 11 Feb 2000 12:17:54 +0100
sysvinit (2.78-1) unstable; urgency=low
* 2.78 will be the new upstream version, I'm skipping 2.77
* Shutdown now calls sync before switching the runlevel to 0 or 6,
or before unmounting filesystems if -n was used (closes: #46461)
* Some cosmetic changes to init.c (closes: #32079)
-- Miquel van Smoorenburg <miquels@cistron.nl> Thu, 30 Dec 1999 20:40:23 +0100
sysvinit (2.77-2) unstable; urgency=low
* Fix last -i option
-- Miquel van Smoorenburg <miquels@cistron.nl> Tue, 5 Oct 1999 21:51:50 +0200
sysvinit (2.77-1) unstable; urgency=low
* Write reboot record into utmp file as well to make rms happy
* Fork and dump core in / if SIGSEGV is received for debugging purposes
* Patch by Craig Sanders <cas@vicnet.net.au> for "last" -i option
-- Miquel van Smoorenburg <miquels@cistron.nl> Wed, 4 Aug 1999 11:16:23 +0200
sysvinit (2.76-4) unstable; urgency=low
* Change dowall.c to handle Unix98 ptys correctly
* Add comment in rcS about usage of setup.sh and unconfigured.sh
* Shutdown now removes nologin file just before calling telinit
* SEGV handler now tries to continue after sleep of 30 seconds.
On a 386-class processor it also prints out the value of EIP.
* Fix for racecondition in check_init_fifo() by Richard Gooch
-- Miquel van Smoorenburg <miquels@cistron.nl> Sat, 8 May 1999 17:22:57 +0200
sysvinit (2.76-3) frozen unstable; urgency=high
* Small bugfix to last.c courtesy of Danek Duvall <duvall@emufarm.ml.org>
-- Miquel van Smoorenburg <miquels@cistron.nl> Tue, 12 Jan 1999 12:12:44 +0100
sysvinit (2.76-1) frozen unstable; urgency=high
* Fix bug in check_pipe() which crashes init on the Alpha.
-- Miquel van Smoorenburg <miquels@cistron.nl> Tue, 3 Nov 1998 11:09:13 +0100
sysvinit (2.75-4) unstable; urgency=low
* Change sulogin password buffer to 128 characters.
* Don't print control characters in dowall.c
* Try to open getenv ("CONSOLE"), /dev/console and /dev/tty0 in order.
For backwards compatibility when you try to boot a 2.0.x kernel
with a linux > 2.1.70 /dev/console device.
* Change src/Makefile for non-debian systems (mainly, RedHat)
* Try to create /dev/initctl if not present; check every time to see
if the dev/ino of /dev/initctl has changed and re-open it. This should
help devfs a bit.
* Send SIGUSR1 to init at bootup to let it re-open /dev/initctl;
again in support of devfs.
* Moved pidof to /bin (it's only a link to killall5 anyway)
-- Miquel van Smoorenburg <miquels@cistron.nl> Mon, 5 Oct 1998 14:03:14 +0200
sysvinit (2.75-2) frozen unstable; urgency=medium
* Fix last.c again.
* Add check to see if /dev/initctl is really a FIFO
* In ifdown.c first down all shaper devices then the real devices
-- Miquel van Smoorenburg <miquels@cistron.nl> Tue, 2 Jun 1998 22:43:01 +0200
sysvinit (2.75-1) frozen unstable; urgency=low
* Rewrote last.c to be much more memory friendly and correct,
thanks to Nick Andrew <nick@zeta.org.au> and
David Parrish <dparrish@zeta.org.au>
* Fixes bugs:
#21616: sysvinit: sulogin thinks md5 root password is bad
#21765: sysvinit: Typo in `killall5.c'
#21775: sysvinit: sysvinit does not support MD5 hashed passwords
#21990: /usr/bin/last: unnecessary memset and off-by-one bug
#22084: sysvinit 2.74-4: SIGPWR missing on sparc
#21900: init, powerfail events, and shutdown.allow
#21702: init 0 does not work as expected...
#21728: sysvinit: Typo in `init.c'
#22363: sysvinit: discrepance btw. manpage and /sbin/init
-- Miquel van Smoorenburg <miquels@cistron.nl> Tue, 19 May 1998 11:02:29 +0200
sysvinit (2.74-4) frozen unstable; urgency=medium
* Add -o option to last to process libc5 utmp files.
* Buffer overflow fixed in init.c (not very serious; only exploitable
by root). Thanks to Chris Evans <chris@ferret.lmh.ox.ac.uk>
-- Miquel van Smoorenburg <miquels@cistron.nl> Wed, 15 Apr 1998 17:04:33 +0200
sysvinit (2.74-1) unstable; urgency=low
* Should compile with glibc 1.99 :)
* Change behaviour of reboot(1) and halt(1) so that the default when
the runlevel can't be determined is to call shutdown.
* Added re-exec patch from Al Viro (21 Feb 1998):
'U' flag added to telinit. It forces init to re-exec itself
(passing its state through exec, certainly).
May be useful for smoother (heh) upgrades.
24 Feb 1998, AV:
did_boot made global and added to state - thanks, Miquel.
Yet another file descriptors leak - close state pipe if
re_exec fails.
-- Miquel van Smoorenburg <miquels@cistron.nl> Thu, 12 Mar 1998 17:42:46 +0100
sysvinit (2.73-2) unstable; urgency=low
* Change _NSIG to NSIG for 2.1.x kernel includes.
-- Miquel van Smoorenburg <miquels@cistron.nl> Thu, 8 Jan 1998 16:01:02 +0100
sysvinit (2.73-1) unstable; urgency=low
* Use siginterrupt, now that system calls are restarted by default.
Main symptom was that the sulogin timeout didn't work but there
might have been more hidden problems.
* Kill process immediately if turned off in inittab
* Fixed sulogin check on tty arg.
* Use strerror() instead of sys_errlist
* wall now supports a '-n' option to suppress [most of] the banner.
Debian doesn't use sysvinit's wall, but apparently Redhat does.
* Add '-F' (forcefsck) option to shutdown
* Close and reopen /dev/initctl on SIGUSR1 (mainly for a /dev in ram)
-- Miquel van Smoorenburg <miquels@cistron.nl> Sat, 3 Jan 1998 16:32:39 +0100
sysvinit (2.72-3) unstable; urgency=low
* Add extra fork() in dowall.c to avoid hanging in rare cases
-- Miquel van Smoorenburg <miquels@cistron.nl> Wed, 22 Oct 1997 14:44:00 +0200
sysvinit (2.72) unstable; urgency=low
* Applied manual page patches by Bill Hawes <whawes@star.net>. Thanks Bill!
* Applied patches to the sample Slackware scripts by
"Jonathan I. Kamens" <jik@kamens.brookline.ma.us>
* Fix halt and reboot runlevels 0 & 6 check.
* Only say "no more processes left in runlevel x" once
* Fix race condition with SIGCHLD in spawn()
(thanks to Alon Ziv <alonz@CS.Technion.AC.IL>)
* Compress all manpages (missed 2)
* Compiled for libc6
* Added poweroff patch by Roderich Schupp <rsch@ExperTeam.de>
-- Miquel van Smoorenburg <miquels@cistron.nl> Sun, 12 Oct 1997 17:20:17 +0200
sysvinit (2.71-2) frozen unstable; urgency=low
* Print 2.71 instead of 2.70 on startup :)
-- Miquel van Smoorenburg <miquels@cistron.nl> Mon, 5 May 1997 12:45:25 +0200
sysvinit (2.71-1) frozen unstable; urgency=high
* Added code for updwtmp() in utmp.c for glibc (2.0.3)
* Fixed all programs to use functions from utmp.c and getutent()
* Do not try to clean up utmp in init itself (Bug#9022)
* Removed sync() from main loop.
* Hopefully fixes bug #8657 (shutdown signal handling)
-- Miquel van Smoorenburg <miquels@cistron.nl> Sat, 26 Apr 1997 19:57:27 +0200
sysvinit (2.70-1) unstable; urgency=low
* Respawn fix
* Removed StUdLy CaPs from source code
* Moved files in source archive around
* Fixes for glibc (utmp handling, signal handling).
* Fixed '-d' option to last (now also works without '-a').
* Added extra checking in last.c to prevent showing dead entries
-- Miquel van Smoorenburg <miquels@cistron.nl> Fri, 7 Feb 1997 15:31:30 +0100
sysvinit (2.69-1) frozen unstable; urgency=medium
* Fixed bug that can throw X in a loop (or any other app that reads from
/dev/tty0)
-- Miquel van Smoorenburg <miquels@cistron.nl> Sun, 1 Dec 1996 15:32:24 +0100
sysvinit (2.67-1) frozen unstable; urgency=high
* Fixes problem with /dev/console being controlling terminal of some
daemons
* Puts copyright file in the right place
-- Miquel van Smoorenburg <miquels@cistron.nl> Fri, 15 Nov 1996 12:23:33 +0100
sysvinit (2.66-1) unstable; urgency=medium
* Skipped 2.65. A development 2.65 got out by accident and is apparently
being used..
* Also compiles and runs with GNU libc (and on the Alpha)
* Fixed dowall.c not to exit when getpwuid() fails and uid == 0.
* Fixed init panic'ing on empty lines in /etc/inittab
* Changed default PATH to include /usr/local/sbin
* Set /dev/console as controlling terminal for sysinit,bootwait,wait,powerwait
This allows using ^C to interrupt some parts of eg the boot process.
* Remove old symlink in /var/log/initlvl; let init check both
/var/log and /etc itself.
-- Miquel van Smoorenburg <miquels@cistron.nl> Tue, 29 Oct 1996 13:46:54 +0100
2.66 29-Oct-1996
- Skipped 2.65. A development 2.65 got out by accident and is apparently
being used..
- Fixed dowall.c not to exit when getpwuid() fails and uid == 0.
- Fixed init panic'ing on empty lines in /etc/inittab
- Changed default PATH to include /usr/local/sbin
- Ported to Linux/Alpha and GNU libc.
- Set /dev/console as controlling terminal for sysinit,bootwait,wait,powerwait.
This allows using ^C to interrupt some parts of eg the boot process.
- Remove old symlink in /var/log/initlvl; let init check both
/var/log and /etc itself.
2.64 28-Jun-1996
- Init checks CONSOLE environment variable on startup (overrides /dev/console)
- Init sets CONSOLE variable for all its children.
- Wtmp(): when zeroing out old utmp entries, keep ut_id field
- Wtmp(): try to re-use ut_id field if possible.
- SetTerm(): only read from /etc/ioctl.save if written once.
- Included start-stop-daemon, C version (source only).
- Fixed wait() for the emergency shell.
- killall5: ignore signal before doing kill(-1, pid).
2.63 14-Jun-1996
- Fixed preinst script for Debian
- Fixed init.c to become init daemon if name is init.new
- Fixed pidof to not return PIDs of shell scripts
2.62-2 09-Jun-1996
- Changed debian /etc/init.d/boot script to create a nologin file
at boot and to remove it just before going multiuser.
2.62 31-May-1996
- Decided to release a 2.62 version with a BIG WARNING about upgrading
init in it. Will send a patch to Linus for the linux/Documentation/Changes
file so that 2.62 or later is mentioned as the version to upgrade to.
- Added docs for Slackware
2.61-3 29-May-1996
- Fixed debian/etc/init.d/network for the lo device.
- Added "-xdev" to the cd /tmp && find in debian/etc/init.d/boot
- Made remove time for files in /tmp configurable.
2.61 29-Apr-1996
- Changed /etc/init.d/boot script again
- Fixed problem in init.c with trailing whitespace after entries in inittab
- Fixed killall5 problems
- Added manpage for lastb
- Added SHELL= environment variable to sulogin
- Fixed sulogin & shadow problems
- Added timeout option to sulogin
2.60-2 16-Apr-1996
- Fixed sulogin (didn't work if root wasn't first entry in shadow file)
- Fixed mesg for systems with "tty" group (such as Debian)
- Fixed nsyslog() in killall5.c
2.60 01-Apr-1996
- Fixed race condition in init.c, resulting in hanging shutdowns.
Courtesy of Max Neunhoeffer <Max.Neunhoeffer@urz.uni-heidelberg.de>.
- Fixed debian/etc/init.d/boot for swapon and mdadd
- Added architecture to debian.control
- Added manpages for rc.boot and rc.local
- Updated inittab manpage for 4-character runlevel field
- Added debian replaces for bsdutils < version_without_mesg
- Fixed init.c so that it also works with kernels 1.3.81 and up
2.59 10-Mar-1996
- Init logs less to syslog (suspected to hang in syslog() or openlog() )
- removed closelog() from init.c
- removed time check of runlevel record in halt.
- Added options to last to get hostname from ut_addr field
- Added last and mesg to installation targets
- rewrote /etc/init.d/boot a bit.
2.58-2 04-Jan-1996
- Changed etc/init.d/rc to do a stty onlcr
- Added /var/log/initrunlvl symlink
2.58-1 31-Dec-1995
- Added the latest debian files.
- Added support for 4-character id fields (if you have libc5).
- Fixed pidof (in killall5) parsing of /proc/.../stat
- Save restore GMT setting in /etc/init.d/boot
2.57d 03-Dec-1995
- Added sulogin
- Added "-b" flag to init, gives a shell before
anything else (in case the startup scripts are screwed)
- Moved fastboot to /fastboot
- Folded in Debian patches.
- Removed old scripts
- Added debian /etc/directory.
2.57c 08-Oct-1995
- Changed over to init_request (with initreq.h)
- Processes no longer killed when "process" field
changes, change takes effect after next respawn.
2.57b xx-Aug-1995
- Bugfix release for Debian and Slackware 3.0
2.57a 10-Jul-1995
- Fixed race condition init init.c wrt got_chld
- Fixed one-off for malloc in killall5.c
- Changed dowall.c
- Console code: no relink to /dev/systty on CTRL-ALT-DEL)
2.57 22-May-1995
- Changed a few things here and there, didn't
really document it :)
2.55 17-Jan-1995
- Added option to shutdown to run standalone.
2.54 12-Jan-1995
- Added GNU copyrigh to all *.[ch] files.
- added /etc/initscript
- reboot and halt now call shutdown in runlevels 1-5
- Can run from read-only root (CDROM)
2.53 10-Oct-1994
- Renamed pidof to killall5, updated all scripts to
use killall5 instead of kill -1 ....
- Rewrote scripts to use this, and some general changes.
- Added SysV command line compatibility to shutdown.
2.52 30-Aug-1994
- Added `powerfailnow' keyword, for when UPS battery is low.
- Updated `last'.
- Fixed utmp handling (wrt. CLEAN_UTMP)
TODO:
* Make last compatible with GNU/BSD (long options?)
* update powerd
* remote SIGPWR broadcast? in powerd? (with priv. port)
* remote shutdown
2.50 14-Feb-1994
- Ignores unknown command line arguments.
- Modelled more after the "real" sysVinit
- Lots of changes all over the place.
(like showing runlevel in "ps" listing, logging
runlevel into utmp file etc)
- now using "reliable" signals instead of V7 style.
- Updated all scripts. Examples are in two directories:
etc (normal) and etc-sysv (sysv style scripts).
- runlevel 0 = halt, 1 = single user, 6 = reboot.
- added support for serial console.
- updated Propaganda, manpages.
- added shutdown access control.
2.4 24-May-93
- Send out the official version into the world as
SysVinit-2.4.tar.z.
2.4g 15-May-93
- Changed init to really catch SIGPWR 'cause we
hooked up an UPS to the Linux machine. The
keyword for catching the TreeFingerSalute is
now "ctrlaltdel" instead of "power{wait,fail}".
2.4a 22-Apr-93
- Fixed last to reckognize BSD style wtmp logging.
- Changed init to write wtmp records that are
SysV compliant but are also reckognized by the
BSD last. Added a '+' option to the 'process'
field of inittab, for getties that want to do
their own utmp/wtmp housekeeping (kludge!).
- Now accepts a runlevel on the command line,
and reckognizes the 'auto' argument. (Sets the
environment variable AUTOBOOT to YES)
2.2.3 24-Mar-93
- Ripped out the 'leave' action. To difficult, and
unneeded.
- Going single user now kills _all_ processes.
- Added '-t secs' option to all commands.
- This version is stable enough to post.
2.2 02-Mar-93
- Made wait()'s asynchronous
- Changed whole thing to one big state machine
- Now using 'pseudo levels' # & * for SYSINIT & BOOT
- Added a new type of 'action', called leave. This
process will be executed when the system goes from a
runlevel specified in it's runlevel field to a
level that's not. Nice to bring down NFS and the like.
2.1 28-Jan-93
- Fixed a bug with 'boot' and 'once'.
- Check 'initdefault' for validity.
- Reckognizes "single" as command line argument.
- Retries execvp with 'sh -c exec ..' if command
is a shell script. (shouldn't execvp do this?)
- Added patches to use syslog if defined.
2.0 08-Dec-92
- Rewrote the code totally, so started with a new
version number.
- Dropped Minix support, this code now is Linux - specific.
- With TEST switch on, this init & telinit can
run standalone for test purposes.
1.3, 05-Jul-92
- Got a 386, so installed Linux. Added 'soft' reboot
to be default under linux. Fixed some typos.
1.2, 16-Jun-92
- Bugreport from Michael Haardt ; removed deadlock
and added 'waitpid' instead of 'wait' for SYSV.
1.1, 30-Apr-92
- Read manual wrong: there is no 'action' field called
process, but all entries are of type process. Every
'process' get exec'ed by /bin/sh -c 'exec command'.
- Rapidly respawning processes are caught in the act.
- _SYSV support is really Linux support,
done by poe@daimi.aau.dk on 25-Mar-92.
1.0, 01-Feb-92
- Initial version, very primitive for the Minix
operating system. Required some mods. to the
kernel.
================================================
FILE: doc/Install
================================================
Install instructions for the System V style init
init, shutdown, halt, reboot, wall, last, mesg, runlevel,
killall5, pidof, sulogin.
All programs, files and scripts in this package are covered by
the GNU General Public License version 2, and copyrighted by
Miquel van Smoorenburg (1991-2004) and, Jesse Smith (2018).
If you are not using Debian and the debianized package,
you may have to install the new init by hand if Debian is
using an init system other than SysV (eg systemd). You should
be able to drop the binaries into a Slackware or Devuan system, I think.
The SysV init software, core programs and manual pages can be
installed by running the following two commands from the top-level
source directory.
make
sudo make install
If sudo is not installed, the "make install" command may be run as
the root user.
Other than the GNU make utility, SysV init has few dependencies.
SysV can be built on virtually any Linux system featuring
the GNU C library or musl libc. A C compiler, such as the GNU Compiler
Collection (GCC) or Clang is also required.
On systems which want to provide translated versions of manual pages
the po4a package should be installed.
Here is a list of preferred directories to install the progs & manpages,
this should be done for you automatically when you run "make install"
as the root user, or via sudo, ie "sudo make install".
wall.1, last.1, mesg.1 /usr/man/man1
inittab.5, initscript.5 /usr/man/man5
init.8, halt.8, reboot.8,
shutdown.8, powerd.8,
killall5.8, pidof.8,
runlevel.8, sulogin.8 /usr/man/man8
init /sbin/init
inittab /etc/inittab
initscript.sample /etc/initscript.sample
telinit a link (with ln(1) ) to init, either
in /bin or in /sbin.
halt /sbin/halt
reboot a link to /sbin/halt in the same directory
killall5 /sbin/killall5
pidof a link to /sbin/killall5 in the same directory.
runlevel /sbin/runlevel
shutdown /sbin/shutdown.
wall /usr/bin/wall
mesg /usr/bin/mesg
last /usr/bin/last
sulogin /sbin/sulogin
bootlogd /sbin/bootlogd
utmpdump don't install, it's just a debug thingy.
If you already _have_ a "wall" in /bin (the SLS release had, for example)
do _not_ install this version of wall. Chances are that the wall you are already
using is linked to /bin/write. Either first _remove_ /bin/wall before
installing the new one, or don't install the new one at all.
You might want to create a file called "/etc/shutdown.allow". Read the
manual page on shutdown to find out more about this.
Running from a read-only file system (CDROM?):
* All communication to init goes through the FIFO /run/initctl.
There should be no problem using a read-only root file system
If you use a Linux kernel > 1.3.66. Older kernels don't allow
writing to a FIFO on a read-only file system.
================================================
FILE: doc/Propaganda
================================================
Propaganda for version 2.89 of sysvinit & utilities
==================================================
NOTE: If you use a standard distribution like Slackware, Devuan
or Gentoo there probably is no need to upgrade. Installing sysvinit
is only for those that upgrade their system by hand or for people
that create Linux distributions.
SysV init was probably the most widely used init package for Linux.
Most distributions once used it. sysvinit 2.4 was really a good package,
and it was not the need for bug fixes but the need for more features
that made me work on sysvinit again.
SysV init is now a Debian package. Debian source packages are not
special in any way -- in fact you can just unpack and compile
it on any other Linux distribution.
There was a 2.50 release of sysvinit but that was not very popular-
some of the included scripts broke with certain shells and other
minor things like that. Unfortunately I was not able to fix this
at the time because I was abroad for some time. Therefore the
description below is a comparison of 2.4 and 2.58 (actually the
same blurb as from the 2.50 announce but updated).
Wrt 2.4, some of the code has been made simpler. Everything, from
halt to reboot to single user mode is now done by shell scripts
that are executed directly by init (from /etc/inittab), so shutdown
does not kill processes anymore and then calls reboot - it merely
does some wall's to the logged in users and then switches to
runlevel 0 (halt), 1 (single user) or 6 (reboot).
I have removed support for the old style scripts; the included
example scripts are the Debian GNU/Linux distribution scripts.
This does not mean that eg the Slackware scripts stop to work;
you can probably drop this init into Slackware 3.0 without problems.
Most people have an entry in inittab to run shutdown when CTRL-ALT-DEL
is pressed; a feature has been added to shutdown to check if a
authorized user is logged in on one of the consoles to see if a
shutdown is allowed. This can be configured with an access file.
Some other general changes:
- utility "runlevel" to read the current and previous runlevel from
/var/run/utmp (it's also shown on the command line if you do a "ps").
- unreckognized options are silently ignored (such as the infamous
"ro" - mount root file system read only).
- if the file /etc/initscript is present it will be used to launch
all programs that init starts (so that you can set a generic
umask, ulimit eg for ALL processes - see initscript.sample).
- A "sulogin" program added that always asks for the root
passsword before entering single user mode.
- A "-b" flag to init that starts a shell at boot time before
_any_ other processing.
- I moved /etc/fastboot to /fastboot - wonder what that's gonna break :)
- I even updated the manpages!
Right, now some boring stuff you already know since it's the same
as in the 2.4 release:
The sysvinit package includes
* a SysV compatible /sbin/init program
* a telinit program (er, just a link to /sbin/init) to change runlevels
* a featureful shutdown
* halt and reboot to assist shutdown
* a very forgiving last utility
* the wall & mesg programs (not installed by default)
* manpages for everything
The new SysV init can be found on:
https://github.com/slicer69/sysvinit
================================================
FILE: doc/bootlogd.README
================================================
bootlogd: a way to capture all console output during bootup
in a logfile.
- bootlogd opens /dev/console and finds out what the real console is
with an ioctl() if TIOCCONS is available
- otherwise bootlogd tries to parse /proc/cmdline for console=
kernel command line arguments
- then opens the (most probable) real console
- allocates a pty pair
- redirects console I/O to the pty pair
- then goes in a loop reading from the pty, writing to the real
console and a logfile as soon as a r/w partition is available,
buffering in memory until then.
As soon as bootlogd exits or gets killed, the pty is closed and the
redirection will be automatically undone by the kernel. So that's
pretty safe.
================================================
FILE: doc/initctl
================================================
This document describes the communiction pipe set up by SysV init
at /run/initctl. This named pipe allows programs with the proper
permissions (typically programs run by root have read+write access to
the pipe) to send signals to the init program (PID 1).
The init manual page has, up until recently, simply stated
that people wishing to understand how to send messages to init
should read the init program's source code, but that is not usually practical.
Messages sent to the pipe to talk to init must have a special format.
This format is defined as a C structure and the technical break-down
is presented here:
/*
* Because of legacy interfaces, "runlevel" and "sleeptime"
* aren't in a separate struct in the union.
*
* The weird sizes are because init expects the whole
* struct to be 384 bytes.
*/
struct init_request {
int magic; /* Magic number */
int cmd; /* What kind of request */
int runlevel; /* Runlevel to change to */
int sleeptime; /* Time between TERM and KILL */
union {
struct init_request_bsd bsd;
char data[368];
} i;
};
Let's go through the init_request structure one line at a time. The
first variable, the "magic" number must be of the value 0x03091969.
The init program then knows that only programs with root access which send
this magic number are authorized to communicate with init.
The cmd variable is a value in the range of 0-8 (currently). This cmd
variable tells init what we want it to do. Here are the possible options:
1 - Set the current runlevel, specified by the runlevel variable.
2 - The power will fail soon (probably low battery) prepare to shutdown.
3 - The power is failing, do shutdown immediately.
4 - The power is okay, cancel shutdown.
6 - Set an environment variable to a value to be specified in
the data variable of this structure.
Other cmd options may be added to init later. For example, command values
0, 5 and 7 are defined but currently not implemented.
The runlevel variable will specify the runlevel to switch to (0-6).
The sleeptime variable is to be used when we want to tell init to change
the time spent waiting between sending SIGTERM and SIGKILL during the
shutdown process. Changing this at run time is not yet implemented.
The data variable (in the union) can be used to pass misc data which init
might need to process our request. For example, when setting environment
variables.
When setting an environment variable through init's /run/initctl pipe,
the data variable should have the format VARIABLE=VALUE. The string
should be terminated with a NULL '\0' character.
The following C code example shows how to send a set environment variable
request to the init process using the /run/initctl pipe. This example
is simplified and skips the error checking. A more comlpete example can be
found in the shutdown.c program's init_setnv() function.
struct init_request request; /* this is the structure defined above */
int fd; /* file descriptor for the pipe */
memset(&request, 0, sizeof(request)); /* initialize structure */
request.magic = 0x03091969; /* this magic number must be included */
request.cmd = 6; /* 6 is the command to set a variable */
sprintf(request.data, "VARIABLE=VALUE"); /* set VARIABLE to VALUE in init */
if ((fd = open(INIT_FIFO, O_WRONLY)) >= 0) /* open pipe for writing */
{
size_t s = sizeof(request); /* size of the structure to write */
void *ptr = &request; /* temporary pointer */
write(fd, ptr, s); /* send the structure to the pipe */
close(fd); /* close the pipe when done */
}
Usually the /run/initctl pipe would only be used by low-level programs to
request a power-related shutdown or change the runlevel, like telinit
would do. Most of the time there is no need to talk to init directly, but
this gives us an extenable approach so init can be taught how to learn
more commands.
================================================
FILE: doc/initscript.sample
================================================
#
# initscript If this script is intalled as /etc/initscript,
# it is executed by init(8) for every program it
# wants to spawn like this:
#
# /bin/sh /etc/initscript <id> <level> <action> <process>
#
# It can be used to set the default umask and ulimit
# of all processes. By default this script is installed
# as /etc/initscript.sample, so to enable it you must
# rename this script first to /etc/initscript.
#
# Version: @(#)initscript 1.10 10-Dec-1995 MvS.
#
# Author: Miquel van Smoorenburg, <miquels@cistron.nl>
#
# Set umask to safe level, and enable core dumps.
umask 022
ulimit -c 2097151
PATH=/bin:/sbin:/usr/bin:/usr/sbin
export PATH
# Execute the program.
eval exec "$4"
================================================
FILE: man/Makefile
================================================
MANPAGES=bootlogd.8 fstab-decode.8 halt.8 init.8 initctl.5 initscript.5 inittab.5 \
killall5.8 last.1 lastb.1 logsave.8 mesg.1 mountpoint.1 pidof.8 poweroff.8 \
readbootlog.1 reboot.8 runlevel.8 shutdown.8 sulogin.8 telinit.8 utmpdump.1 \
wall.1
PO4A := $(shell command -v po4a 2> /dev/null)
PO4A_OPTS = --previous --srcdir po/ --destdir ./ --no-backups --stamp \
--package-name sysvinit --package-version $(VERSION) \
--msgid-bugs-address "Jesse <jsmith@resonatingmedia.com>"
all:
sed --in-place=.orig --separate 's/\@VERSION\@/$(VERSION)/g' $(MANPAGES)
ifdef PO4A
po4a $(PO4A_OPTS) po/po4a.cfg
else
@echo 'Install po4a to build translated manpages'
endif
# Installation recipes are in ../src/Makefile
install: all
clean distclean:
ifdef PO4A
po4a $(PO4A_OPTS) --rm-translations po/po4a.cfg
endif
rm -f *.po sysvinit-man.pot
================================================
FILE: man/bootlogd.8
================================================
'\" -*- coding: UTF-8 -*-
.\" Copyright (C) 1998-2003 Miquel van Smoorenburg.
.\"
.\" 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 2 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, write to the Free Software
.\" Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
.\"
.TH BOOTLOGD 8 "Jul 21, 2003" "sysvinit " "Linux System Administrator's Manual"
.SH NAME
bootlogd \- record boot messages
.SH SYNOPSIS
.B /sbin/bootlogd
.RB [ \-c ]
.RB [ \-d ]
.RB [ \-e ]
.RB [ \-r ]
.RB [ \-s ]
.RB [ \-v ]
.RI [ " \fB-l\fP logfile " ]
.RI [ " \fB-p\fP pidfile " ]
.SH DESCRIPTION
\fBbootlogd\fP runs in the background and copies all strings sent to the
\fI/dev/console\fP device to a logfile. If the \fIlogfile\fP is not accessible,
the messages will be kept in memory until it is.
.SH OPTIONS
.IP \fB\-d\fP
Do not fork and run in the background.
.IP \fB\-e\fP
Print escape characters to the boot log file. This turns off filtering of
escape characters and allows tools like GNU \fBless\fP(1) to see and use
colour control characters (show the log in colour).
.IP \fB\-c\fP
Attempt to write to the logfile even if it does not yet exist.
Without this option, \fBbootlogd\fP will wait for the logfile to appear before
attempting to write to it. This behavior prevents \fBbootlogd\fP from creating
logfiles under mount points.
.IP \fB\-r\fP
If there is an existing logfile called \fIlogfile\fP rename it to
\fIlogfile~\fP unless \fIlogfile~\fP already exists.
.IP \fB\-s\fP
Ensure that the data is written to the file after each line by calling
.BR fdatasync (3).
This will slow down a
.BR fsck (8)
process running in parallel.
.IP \fB\-v\fP
Show version.
.IP "\fB\-l\fP \fIlogfile\fP"
Log to this logfile. The default is \fI/var/log/boot\fP.
.IP "\fB\-p\fP \fIpidfile\fP"
Put process-id in this file. The default is no pidfile.
.SH NOTES
\fBbootlogd\fP saves log data which includes control characters. The log is
technically a text file, but not very easy for humans to read. To address
this the \fBreadbootlog\fP(1) command can be used to display the boot log
without the control characters.
.SH BUGS
\fBbootlogd\fP works by redirecting the console output from the console device.
(Consequently \fBbootlogd\fP requires PTY support in the kernel configuration.)
It copies that output to the real console device and to a log file.
There is no standard way of ascertaining the real console device
if you have a new-style \fI/dev/console\fP device (major 5, minor 1)
so \fBbootlogd\fP parses the kernel command line looking for
\fBconsole=...\fP lines and deduces the real console device from that.
If that syntax is ever changed by the kernel, or a console type is used that
\fBbootlogd\fP does not know about then \fBbootlogd\fP will not work.
.SH AUTHOR
.MT miquels@\:cistron\:.nl
Miquel van Smoorenburg
.ME
.SH "SEE ALSO"
.BR dmesg (8),
.BR fdatasync (3),
.BR readbootlog (1)
================================================
FILE: man/fstab-decode.8
================================================
'\" -*- coding: UTF-8 -*-
.\" A man page for fstab-decode(8).
.\"
.\" Copyright (C) 2006 Red Hat, Inc. All rights reserved.
.\"
.\" This copyrighted material is made available to anyone wishing to use,
.\" modify, copy, or redistribute it subject to the terms and conditions of the
.\" GNU General Public License v.2.
.\"
.\" 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, write to the Free Software Foundation, Inc.,
.\" 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
.\"
.\" Author: Miloslav Trmac <mitr@redhat.com>
.TH FSTAB-DECODE 8 "May 2006" "sysvinit " "Linux System Administrator's Manual"
.SH NAME
fstab-decode \- run a command with fstab-encoded arguments
.SH SYNOPSIS
.B fstab-decode
.IR COMMAND " [" ARGUMENT " \&.\|.\|.\&]"
.SH DESCRIPTION
.B fstab-decode
decodes escapes (such as newline characters and other whitespace)
in the specified
.IR ARGUMENT s
and uses them to run
.IR COMMAND .
The argument escaping uses the same rules as path escaping in
.IR /etc/fstab ", " /etc/mtab " and " /proc/mtab .
In essence \fBfstab-decode\fR can be used anytime we want to pass multiple
parameters to a command as a list of command line arguments.
It turns output like this:
.nf
/root
/mnt/remote-disk
/home
.fi
Into one long list of parameters, "/root /mnt/remote-disk /home".
This can be useful when trying to work with multiple filesystems at once.
For instance, we can use it to unmount multiple NFS shares.
This program also removes whitespace and
other characters which might cause programs such as
\fBmount\fR(8) or \fBumount\fR(8) to fail.
.SH EXIT STATUS
.B fstab-decode
exits with status 127 if
.I COMMAND
can't be run.
Otherwise it exits with the status returned by
.IR COMMAND .
.SH EXAMPLES
The following example reads
.IR fstab ,
finds all instances of VFAT filesystems
and prints their mount points
(argument 2 in the
.I fstab
file).
.B fstab-decode
then runs the specified program, \fBumount\fR(8), and passes
it the list of VFAT mountpoints.
This unmounts all VFAT partitions.
.nf
.B fstab-decode umount $(awk \[aq]$3 == \[dq]vfat\[dq] { print $2 }\[aq] \
/etc/fstab)
.fi
.SH SEE ALSO
.BR fstab (5)
================================================
FILE: man/halt.8
================================================
'\" -*- coding: UTF-8 -*-
.\" Copyright (C) 1998-2001 Miquel van Smoorenburg.
.\"
.\" 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 2 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, write to the Free Software
.\" Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
.\"
.\"{{{}}}
.\"{{{ Title
.TH HALT 8 "Nov 6, 2001" "sysvinit " "Linux System Administrator's Manual"
.\"}}}
.\"{{{ Name
.SH NAME
halt, reboot, poweroff \- stop the system
.\"}}}
.\"{{{ Synopsis
.SH SYNOPSIS
.B /sbin/halt
.RB [ \-d ]
.RB [ \-f ]
.RB [ \-h ]
.RB [ \-i ]
.RB [ \-n ]
.RB [ \-p ]
.RB [ \-w ]
.br
.B /sbin/reboot
.RB [ \-d ]
.RB [ \-f ]
.RB [ \-i ]
.RB [ \-k ]
.RB [ \-m\ <message> ]
.RB [ \-n ]
.RB [ \-w ]
.br
.B /sbin/poweroff
.RB [ \-d ]
.RB [ \-f ]
.RB [ \-h ]
.RB [ \-i ]
.RB [ \-n ]
.RB [ \-w ]
.\"}}}
.\"{{{ Description
.SH DESCRIPTION
\fBhalt\fP notes that the system is being brought down in the file
\fI/var/log/wtmp\fP, and then either tells the kernel to halt, reboot or
power-off the system.
.PP
If \fBhalt\fP or \fBreboot\fP is called when the system is
\fInot\fP in runlevel \fB0\fP or \fB6\fP, in other words when it's running
normally, \fBshutdown\fP will be invoked instead (with the \fB\-h\fP
or \fB\-r\fP flag).
For more info see the \fBshutdown\fP(8) manpage.
.PP
The rest of this manpage describes the behavior in runlevels 0
and 6, that is when the systems shutdown scripts are being run.
.\"}}}
.\"{{{ Options
.SH OPTIONS
.IP \fB\-d\fP
Don't write the wtmp record.
.IP \fB\-f\fP
Force halt or reboot, don't call \fBshutdown\fP(8).
.IP \fB\-h\fP
Put all hard drives on the system in stand-by mode
just before halt or power-off.
.IP \fB\-i\fP
Shut down all network interfaces just before \fBhalt\fR or \fBreboot\fR.
Warning: This may not work on interfaces which do not have an IP address
and should ideally be handled by a network manager service.
.IP \fB\-k\fP
Try to reboot using \fBkexec\fP, if kernel supports it.
.IP \fB\-m\fP
When running on a Linux system, any quoted parameter after the
\-m flag will be passed to the firmware to be interpreted at boot time.
Some systems, like the Raspberry Pi,
can use this to switch target partitions.
Please note, this parameter enables \-f,
forcing the reboot command to handle shutting down itself.
.IP \fB\-n\fP
Don't sync before reboot or halt.
Note that the kernel and storage drivers may still sync.
This implies \fB\-d\fP.
.IP \fB\-p\fP
When halting the system, switch off the power.
This is the default when \fBhalt\fR is called as \fBpoweroff\fP.
.IP \fB\-w\fP
Don't actually reboot or halt but only write the wtmp record
(in the \fI/var/log/wtmp\fP file).
.\"}}}
.\"{{{ Diagnostics
.SH DIAGNOSTICS
If you're not the superuser, you will get the message `must be superuser'.
.\"}}}
.\"{{{ Notes
.SH NOTES
Under older \fBsysvinit\fP releases, \fBreboot\fP and \fBhalt\fP should
never be called directly.
From release 2.74 on,
\fBhalt\fP and \fBreboot\fP invoke \fBshutdown\fP(8)
if the system is not in runlevel 0 or 6.
This means that if \fBhalt\fP or \fBreboot\fP cannot find out the current
runlevel
(for example, when \fI/var/run/utmp\fP hasn't been initialized correctly and
\fI/var/run/runlevel\fR does not exist)
\fBshutdown\fP will be called,
which might not be what you want.
Use the \fB\-f\fP flag if you want to do a hard \fBhalt\fP or \fBreboot\fP.
.PP
The \fB\-h\fP flag puts all hard disks in standby mode just before halt
or power-off.
Right now this is only implemented for IDE drives.
A side effect of putting the drive in stand-by mode is
that the write cache on the disk is flushed.
This is important for IDE drives,
since the kernel doesn't flush the write cache itself before power-off.
.PP
The \fBhalt\fP program uses \fI/proc/ide/hd*\fR to find all IDE disk devices,
which means that \fI/proc\fP needs to be mounted when \fBhalt\fP or
\fBpoweroff\fP is called or the \fB\-h\fP switch will do nothing.
.\"}}}
.\"{{{ Author
.SH AUTHOR
.MT miquels@\:cistron\:.nl
Miquel van Smoorenburg
.ME
.\"}}}
.\"{{{ See also
.SH "SEE ALSO"
.BR shutdown (8),
.BR init (8)
.\"}}}
================================================
FILE: man/init.8
================================================
'\" -*- coding: UTF-8 -*-
.\" Copyright (C) 1998-2004 Miquel van Smoorenburg.
.\"
.\" 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 2 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, write to the Free Software
.\" Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
.\"
.\"{{{}}}
.\"{{{ Title
.TH INIT 8 "29 Jul 2004" "sysvinit " "Linux System Administrator's Manual"
.\"}}}
.\"{{{ Name
.SH NAME
init, telinit \- process control initialization
.\"}}}
.\"{{{ Synopsis
.SH SYNOPSIS
.B /sbin/init
.RB [ " \-a " ]
.RB [ " \-s " ]
.RB [ " \-b " ]
[ \fB\-z\fP \fIxxx\fP ]
.RB [ " 0123456Ss " ]
.br
.B /sbin/init
.RB [ " \-\-version " ]
.br
.B /sbin/telinit
[ \fB\-t\fP \fISECONDS\fP ]
.RB
.IR 0123456sSQqabcUu
.br
.B /sbin/telinit
[ \fB\-e\fP \fIVAR\fP[\fB=\fP\fIVAL\fP] ]
.\"}}}
.\"{{{ Description
.SH DESCRIPTION
.\"{{{ init
.SS Init
.B init
is the parent of all processes. Its primary role is to create processes
from a script stored in the file \fI/etc/inittab\fR (see
\fBinittab\fR(5)). This file usually has entries which cause \fBinit\fR
to spawn \fBgetty\fRs on each line that users can log in. It also
controls autonomous processes required by any particular system.
.
.\"{{{ Runlevels
.SH RUNLEVELS
A \fIrunlevel\fR is a software configuration of the system which allows
only a selected group of processes to exist. The processes spawned by
\fBinit\fR for each of these runlevels are defined in the
\fI/etc/inittab\fR file. \fBinit\fR can be in one of eight runlevels:
\fB0\(en6\fP and \fBS\fP (a.k.a., \fBs\fP). The runlevel is
changed by having a privileged user run \fBtelinit\fP, which sends
appropriate signals to \fBinit\fP, telling it which runlevel to change
to.
.PP
Runlevels \fBS\fP, \fB0\fP, \fB1\fP, and \fB6\fP are reserved.
Runlevel S is used to initialize the system on boot.
When starting runlevel S (on boot)
or runlevel 1 (switching from a multi-user runlevel)
the system is entering ``single-user mode'', after which the
current runlevel is S.
Runlevel 0 is used to halt the system;
runlevel 6 is used to reboot the system.
.PP
After booting through S the system automatically enters one of
the multi-user runlevels 2 through 5, unless there was some
problem that needs to be fixed by the administrator in
single-user mode.
Normally after entering single-user mode
the administrator performs maintenance and then reboots the system.
.PP
For more information,
see the manpages for \fBshutdown\fP(8) and \fBinittab\fP(5).
.PP
Runlevels 7\(en9 are also valid, though not really documented.
This is because "traditional" Unix variants don't use them.
.PP
Runlevels \fIS\fP and \fIs\fP are the same.
Internally they are aliases for the same runlevel.
.\"}}}
.
.SH BOOTING
After \fBinit\fP is invoked as the last step of the kernel boot sequence,
it looks for the file \fI/etc/inittab\fP to see if there is an entry of the
type \fBinitdefault\fP (see \fBinittab\fR(5)).
The \fBinitdefault\fP entry determines the initial runlevel of the system.
If there is no such entry
(or no \fI/etc/inittab\fR at all),
a runlevel must be entered at the system console.
.PP
Runlevel \fBS\fP or \fBs\fP initialize the system
and do not require an \fI/etc/inittab\fP file.
.PP
In single user mode, \fB/sbin/sulogin\fP is invoked on \fI/dev/console\fP.
.PP
When entering single user mode,
\fBinit\fP initializes the consoles \fBstty\fP settings to sane values.
Clocal mode is set.
Hardware speed and handshaking are not changed.
.PP
When entering a multi-user mode for the first time, \fBinit\fP performs the
\fBboot\fP and \fBbootwait\fP entries to allow file systems to be
mounted before users can log in. Then all entries matching the runlevel
are processed.
.PP
When starting a new process,
\fBinit\fP first checks whether the file \fI/etc/initscript\fP exists.
If it does, it uses this script to start the process.
.PP
Each time a child terminates, \fBinit\fP records the fact and the reason
it died in \fI/var/run/utmp\fP and \fI/var/log/wtmp\fP,
provided that these files exist.
.SH CHANGING RUNLEVELS
After it has spawned all of the processes specified, \fBinit\fP waits
for one of its descendant processes to die, a powerfail signal, or until
it is signaled by \fBtelinit\fP to change the system's runlevel.
When one of the above three conditions occurs, it re-examines
the \fI/etc/inittab\fP file. New entries can be added to this file at
any time. However, \fBinit\fP still waits for one of the above three
conditions to occur.
To provide for an instantaneous response,
the \fBtelinit Q\fP or \fBq\fP command can wake up \fBinit\fP to re-examine
(reload) the \fI/etc/inittab\fP file.
.PP
If \fBinit\fP is not in single user mode and receives a powerfail
signal (SIGPWR),
it reads the file \fI/etc/powerstatus\fP.
It then starts a command based on the contents of this file:
.IP F(AIL)
Power is failing,
UPS is providing the power.
Execute the \fBpowerwait\fP and \fBpowerfail\fP entries.
.IP O(K)
The power has been restored, execute the \fBpowerokwait\fP entries.
.IP L(OW)
The power is failing and the UPS has a low battery.
Execute the \fBpowerfailnow\fP entries.
.PP
If \fI/etc/powerstatus\fR doesn't exist or contains anything else then the
letters \fBF\fP, \fBO\fP or \fBL\fP, \fBinit\fR will behave as if it has read
the letter \fBF\fP.
.PP
Usage of \fBSIGPWR\fP and \fI/etc/powerstatus\fP is discouraged.
Someone wanting to interact with \fBinit\fP should use the \fI/run/initctl\fP
control channel \(en
see the \fBinitctl\fR(5) manual page for more documentation about this.
.PP
When \fBinit\fP is requested to change the runlevel, it sends the
warning signal \fBSIGTERM\fP to all processes that are undefined
in the new runlevel. It then waits 3 seconds before forcibly
terminating these processes via the \fBSIGKILL\fP signal.
Note that \fBinit\fP assumes that all these processes (and their
descendants) remain in the same process group which \fBinit\fP
originally created for them. If any process changes its process group
affiliation it will not receive these signals. Such processes need to
be terminated separately.
.\"}}}
.\"{{{ telinit
.SH TELINIT
\fB/sbin/telinit\fP is linked to \fB/sbin/init\fP. It takes a
one-character argument and signals \fBinit\fP to perform the appropriate
action. The following arguments serve as directives to
\fBtelinit\fP:
.IP "\fB0\fP, \fB1\fP, \fB2\fP, \fB3\fP, \fB4\fP, \fB5\fP or \fB6\fP"
tell \fBinit\fP to switch to the specified run level.
.IP "\fBa\fP, \fBb\fP, \fBc\fP"
tell \fBinit\fP to process only those \fB/etc/inittab\fP file
entries having runlevel \fBa\fP, \fBb\fP or \fBc\fP.
.IP "\fBQ\fP or \fBq\fP"
tell \fBinit\fP to re-examine the \fI/etc/inittab\fP file.
.IP "\fBS\fP or \fBs\fP"
tell \fBinit\fP to switch to single user mode.
.IP "\fBU\fP or \fBu\fP"
tell \fBinit\fP to re-execute itself (preserving the state).
No re-examining of \fI/etc/inittab\fP file happens.
Runlevel should be one of \fBSs0123456\fP
otherwise request would be silently ignored.
.PP
\fBtelinit\fP can tell \fBinit\fP how long it should wait
between sending processes the \fBSIGTERM\fR and \fBSIGKILL\fR signals.
The default is 3 seconds,
but this can be changed with the \fB\-t\fP option.
.PP
\fBtelinit \-e\fP tells \fBinit\fP to change the environment
for processes it spawns.
The argument of \fB\-e\fP is either of the form \fIVAR\fP=\fIVAL\fP
which sets variable \fIVAR\fP to value \fIVAL\fP,
or of the form \fIVAR\fP
(without an equality sign)
which unsets variable \fIVAR\fP.
.PP
\fBtelinit\fP can be invoked only by users with appropriate
privileges.
.PP
The \fBinit\fP binary checks if it is \fBinit\fP or \fBtelinit\fP by looking
at its \fIprocess id\fP; the real \fBinit\fP's process id is always \fB1\fP.
\&From this it follows that instead of calling \fBtelinit\fP one can also
just use \fBinit\fP instead as a shortcut.
.\"}}}
.\"}}}
.SH ENVIRONMENT
\fBInit\fP sets the following environment variables for all its children:
.IP \fBPATH\fP
\fI/bin:/usr/bin:/sbin:/usr/sbin\fP
.IP \fBINIT_VERSION\fP
As the name says.
Useful to determine if a script runs directly from \fBinit\fP.
.IP \fBRUNLEVEL\fP
The current system runlevel.
.IP \fBPREVLEVEL\fP
The previous runlevel (useful after a runlevel switch).
.IP \fBCONSOLE\fP
The system console.
This is really inherited from the kernel; however
if it is not set \fBinit\fP will set it to \fI/dev/console\fP by default.
.SH BOOTFLAGS
It is possible to pass a number of flags to \fBinit\fP from the
boot monitor (e.g., LILO or GRUB).
\fBinit\fP accepts the following flags:
.TP 0.5i
.B \-s, S, single
Single user mode boot.
In this mode \fI/etc/inittab\fP is examined and
the bootup rc scripts are usually run before the single user mode shell is
started.
.
.TP 0.5i
.B 1\(en5
Runlevel to boot into.
.
.TP 0.5i
.B \-b, emergency
Boot directly into a single user shell without running any
other startup scripts.
.
.TP 0.5i
.B \-a, auto
The LILO boot loader adds the word "auto" to the command line if it
booted the kernel with the default command line (without user intervention).
If this is found \fBinit\fP sets the "AUTOBOOT" environment
variable to "yes".
Note that you cannot use this for any security measures \(en
of course the user could specify "auto" or \fB\-a\fR on the
command line manually.
.
.TP 0.5i
.BI "\-z " xxx
The argument to \fB\-z\fP is ignored.
You can use this to expand the command line a bit,
so that it takes some more space on the stack.
\fBinit\fP can then manipulate the command line
so that \fBps\fP(1) shows the current runlevel.
.
.TP 0.5i
.B \-\-version
This argument, when used on its own, displays the current version of \fBinit\fP
to the console/stdout.
It is a quick way to determine which \fBinit\fP software and
version is being used.
After the version information is displayed,
\fBinit\fP immediately exits with a return code of zero.
.
.SH INTERFACE
\fBinit\fP listens on a \fIfifo\fP as, \fI/run/initctl\fP, for messages.
\fBTelinit\fP uses this to communicate with \fBinit\fP.
The interface is not very well documented or finished.
Those interested should study the \fIinitreq.h\fP file in the \fIsrc/\fP
subdirectory of the \fBinit\fP source code tar archive.
.SH SIGNALS
Init reacts to several signals:
.TP 0.5i
.B SIGHUP
Has the same effect as \fBtelinit q\fP.
.
.TP 0.5i
.B SIGUSR1
On receipt of this signals,
\fBinit\fP closes and re-opens its control fifo,
\fB/run/initctl\fP.
Useful for bootscripts when \fI/dev\fP is remounted.
.TP 0.5i
.B SIGUSR2
When \fBinit\fP receives \fBSIGUSR2\fR,
\fBinit\fP closes and leaves the control fifo,
\fB/run/initctl\fP, closed.
This may be used to make sure \fBinit\fP is not holding open any files.
However, it also prevents \fBinit\fP from switching runlevels.
Which means commands like shutdown no longer work.
The fifo can be re-opened by sending \fBinit\fP the \fBSIGUSR1\fR signal.
.TP 0.5i
.B SIGINT
Normally the kernel sends this signal to \fBinit\fP when CTRL-ALT-DEL is
pressed.
It activates the \fIctrlaltdel\fP action.
.TP 0.5i
.B SIGWINCH
The kernel sends this signal when the \fIKeyboardSignal\fP key is hit.
It activates the \fIkbrequest\fP action.
\"{{{ Conforming to
.SH CONFORMING TO
\fBinit\fP is compatible with the System V init.
It works closely together with the scripts in the directories
\fI/etc/init.d\fP and \fI/etc/rc{runlevel}.d\fP.
If your system uses this convention,
there should be a \fIREADME\fP file in the directory \fI/etc/init.d\fP
explaining how these scripts work.
.\"}}}
.\"{{{ Files
.SH FILES
.nf
/etc/inittab
/etc/initscript
/dev/console
/var/run/utmp
/var/log/wtmp
/run/initctl
.fi
.\"}}}
.\"{{{ Warnings
.SH WARNINGS
\fBinit\fP assumes that processes and descendants of processes
remain in the same process group which was originally created
for them. If the processes change their group, \fBinit\fP can't
kill them and you may end up with two processes reading from one
terminal line.
.PP
On a Debian system, entering runlevel 1 causes all processes
to be killed except for kernel threads and the script that does
the killing and other processes in its session.
As a consequence of this, it isn't safe to return from runlevel 1
to a multi-user runlevel: daemons that were started in runlevel S
and are needed for normal operation are no longer running.
The system should be rebooted.
.\"}}}
.\"{{{ Diagnostics
.SH DIAGNOSTICS
If \fBinit\fP finds that it is continuously respawning an entry
more than 10 times in 2 minutes, it will assume that there is an error
in the command string, generate an error message on the system console,
and refuse to respawn this entry until either 5 minutes has elapsed or
it receives a signal. This prevents it from eating up system resources
when someone makes a typographical error in the \fI/etc/inittab\fP file
or the program for the entry is removed.
.\"}}}
.\"{{{ Author
.SH AUTHOR
.MT miquels@\:cistron\:.nl
Miquel van Smoorenburg
.ME , initial manual page by
.MT u31b3hs@\:pool\:.informatik\:.rwth-aachen\:.de
Michael Haardt
.ME .
.\"}}}
.\"{{{ See also
.SH "SEE ALSO"
.BR getty (1),
.BR login (1),
.BR sh (1),
.BR runlevel (8),
.BR shutdown (8),
.BR kill (1),
.BR initctl (5),
.BR inittab (5),
.BR initscript (5),
.BR utmp (5)
.\"}}}
================================================
FILE: man/initctl.5
================================================
'\" -*- coding: UTF-8 -*-
.\" Copyright (C) 2018 Jesse Smith
.\"
.\" 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 2 of the License.
.\"
.\" 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, write to the Free Software
.\" Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
.\"
.TH INITCTL 5 "April 13, 2018" "sysvinit " "File Formats"
.SH NAME
initctl \- /run/initctl is a named pipe which passes commands to SysV init
.SH SYNOPSIS
/run/initctl
.SH DESCRIPTION
This document describes the communication pipe set up by SysV \fBinit\fR
at \fI/run/initctl\fR. This named pipe allows programs with the proper
permissions (typically programs run by root have read+write access to
the pipe) to send signals to the \fBinit\fR program (PID 1).
The \fBinit\fR manual page has, up until recently, simply stated
that people wishing to understand how to send messages to \fBinit\fR
should read the init program's source code, but that is not usually practical.
Messages sent to the pipe to talk to \fBinit\fR must have a special format.
This format is defined as a C structure and the technical break-down
is presented here:
/*
* Because of legacy interfaces, "runlevel" and "sleeptime"
* aren't in a separate struct in the union.
*
* The weird sizes are because init expects the whole
* struct to be 384 bytes.
*/
struct init_request {
int magic; /* Magic number */
int cmd; /* What kind of request */
int runlevel; /* Runlevel to change to */
int sleeptime; /* Time between TERM and KILL */
union {
struct init_request_bsd bsd;
char data[368];
} i;
};
Let's go through the init_request structure one line at a time. The
first variable, the "magic" number must be of the value 0x03091969.
The \fBinit\fR program then knows that only programs with root access which send
this magic number are authorized to communicate with init.
The \fIcmd\fR variable is a value in the range of 0-8 (currently). This \fIcmd\fR
variable tells init what we want it to do. Here are the possible options:
1 - Set the current runlevel, specified by the runlevel variable.
2 - The power will fail soon (probably low battery) prepare to shutdown.
3 - The power is failing, do shutdown immediately.
4 - The power is okay, cancel shutdown.
6 - Set an environment variable to a value to be specified in
the \fIdata\fR variable of this structure.
Other \fIcmd\fR options may be added to \fBinit\fR later. For example, command values
0, 5 and 7 are defined but currently not implemented.
The \fIrunlevel\fR variable will specify the runlevel to switch to (0-6).
The \fIsleeptime\fR variable is to be used when we want to tell \fBinit\fR to change
the time spent waiting between sending \fBSIGTERM\fR and \fBSIGKILL\fR during the
shutdown process. Changing this at run time is not yet implemented.
The \fIdata\fR variable (in the union) can be used to pass misc data which init
might need to process our request. For example, when setting environment
variables.
When setting an environment variable through \fBinit\fR's \fI/run/initctl\fR pipe,
the data variable should have the format \fIVARIABLE\fR=\fIVALUE\fR. The string
should be terminated with a NULL character.
.SH EXAMPLES
The following C code example shows how to send a set environment variable
request to the \fBinit\fR process using the \fI/run/initctl\fR pipe. This example
is simplified and skips the error checking. A more complete example can be
found in the shutdown.c program's \fBinit_setnv\fR() function.
.nf
struct init_request request; /* structure defined above */
int fd; /* file descriptor for pipe */
memset(&request, 0, sizeof(request)); /* initialize structure */
request.magic = 0x03091969; /* magic number required */
request.cmd = 6; /* 6 is to set a variable */
sprintf(request.data, "VARIABLE=VALUE"); /* set VAR to VALUE in init */
if ((fd = open(INIT_FIFO, O_WRONLY)) >= 0) /* open pipe for writing */
{
size_t s = sizeof(request); /* size of structure to write */
void *ptr = &request; /* temporary pointer */
write(fd, ptr, s); /* send structure to the pipe */
close(fd); /* close the pipe when done */
}
.fi
.sp
.SH NOTES
Usually the \fI/run/initctl\fR pipe would only be used by low-level programs to
request a power-related shutdown or change the runlevel, like \fBtelinit\fR
would do. Most of the time there is no need to talk to \fBinit\fR directly, but
this gives us an extendable approach so \fBinit\fR can be taught how to learn
more commands.
.PP
The commands passed through the \fI/run/initctl\fR pipe must be sent in a specific
binary format and be of a specific length. Larger data structures or ones
not using the proper format will be ignored. Typically, only root has the
ability to write to the initctl pipe for security reasons.
.PP
The \fI/run/initctl\fR pipe can be closed by sending init (PID 1) the \fBSIGUSR2\fR
signal. This closes the pipe and leaves it closed. This may be useful
for making sure \fBinit\fR is not keeping any files open. However, when the
pipe is closed, \fBinit\fR no longer receives signals, such as those sent by
\fBshutdown\fR(8) or \fBtelinit\fR(8). In other words if we close the pipe, \fBinit\fR cannot
change its runlevel directly. The pipe may be re-opened by sending \fBinit\fR (PID 1)
the \fBSIGUSR1\fR signal.
.PP
If the \fI/run/initctl\fR pipe is closed then it may still be possible to bring
down the system using the \fBshutdown\fR(8) command's \fB-n\fR flag, but this is not
always clean and not recommended.
.SH FILES
/run/initctl
/sbin/init
.SH AUTHOR
.MT jsmith@\:resonatingmedia\:.com
Jesse Smith
.ME
.SH "SEE ALSO"
.BR init (8)
================================================
FILE: man/initscript.5
================================================
'\" -*- coding: UTF-8 -*-
.\" Copyright (C) 1998-2003 Miquel van Smoorenburg.
.\"
.\" 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 2 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, write to the Free Software
.\" Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
.\"
.TH INITSCRIPT 5 "July 10, 2003" "sysvinit " "File Formats"
.SH NAME
initscript \- script that executes inittab commands
.SH SYNOPSIS
/bin/sh /etc/initscript id runlevels action process
.SH DESCRIPTION
When the shell script \fI/etc/initscript\fP is present, \fBinit\fP
will use it to execute the commands from \fIinittab\fP.
This script can be used to set things like \fIulimit\fP and
\fIumask\fP default values for every process.
.SH EXAMPLES
This is a sample initscript, which might be installed on your
system as \fI/etc/initscript.sample\fP.
.RS
.sp
.nf
.ne 7
#
# initscript Executed by init(8) for every program it
# wants to spawn like this:
#
# /bin/sh /etc/initscript <id> <level> <action> <process>
#
# Set umask to safe level, and enable core dumps.
umask 022
ulimit -c 2097151
PATH=/bin:/sbin:/usr/bin:/usr/sbin
export PATH
# Increase the hard file descriptor limit for all processes
# to 8192. The soft limit is still 1024, but any unprivileged
# process can increase its soft limit up to the hard limit
# with "ulimit -Sn xxx" (needs a 2.2.13 or later Linux kernel).
ulimit -Hn 8192
# Execute the program.
eval exec "$4"
.sp
.RE
.SH NOTES
This script is not meant as startup script for daemons or services.
It has nothing to do with a \fIrc.local\fP style script. It's just
a handler for things executed from \fB/etc/inittab\fP. Experimenting
with this can make your system un(re)bootable.
.SH FILES
/etc/inittab,
/etc/initscript.
.SH AUTHOR
.MT miquels@\:cistron\:.nl
Miquel van Smoorenburg
.ME
.SH "SEE ALSO"
.BR inittab (5),
.BR init (8)
================================================
FILE: man/inittab.5
================================================
'\" -*- coding: UTF-8 -*-
.\" Copyright (C) 1998-2001 Miquel van Smoorenburg.
.\"
.\" 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 2 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, write to the Free Software
.\" Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
.\"
.\"{{{}}}
.\"{{{ Title
.TH INITTAB 5 "Dec 4, 2001" "sysvinit " "File Formats"
.\"}}}
.\"{{{ Name
.SH NAME
inittab \- format of the inittab file used by the sysv-compatible init
process
.\"}}}
.\"{{{ Description
.SH DESCRIPTION
The \fBinittab\fP file describes which processes are started at bootup and
during normal operation (e.g.\& /etc/init.d/boot, /etc/init.d/rc, gettys...).
.BR init (8)
distinguishes multiple \fIrunlevels\fP, each of which can have its own set of
processes that are started. Valid runlevels are \fB0\fP\-\fB6\fP plus
\fBA\fP, \fBB\fP, and \fBC\fP for \fBondemand\fP entries. An entry in the
\fBinittab\fP file has the following format:
.RS
.sp
\fIid\fP:\fIrunlevels\fP:\fIaction\fP:\fIprocess\fP
.sp
.RE
Lines beginning with `#' are ignored.
.\"{{{ id
.IP \fIid\fP
is a unique sequence of 1-4 characters which identifies an entry in
.B inittab
(for versions of sysvinit compiled with the \fIold\fP libc5 (< 5.2.18) or
a.out libraries the limit is 2 characters).
.sp
Note: traditionally, for getty and other login processes, the value of the
\fIid\fP field is kept the same as the suffix of the corresponding tty, e.g.\&
\fB1\fP for \fBtty1\fP. Some ancient login accounting programs might
expect this, though I can't think of any.
.\"}}}
.\"{{{ runlevels
.IP \fIrunlevels\fP
lists the runlevels for which the specified action should be taken.
.\"}}}
.\"{{{ action
.IP \fIaction\fP
describes which action should be taken.
.\"}}}
.\"{{{ process
.IP \fIprocess\fP
specifies the process to be executed. If the process field starts with
a `+' character,
.B init
will not do utmp and wtmp accounting for that process. This is needed for
gettys that insist on doing their own utmp/wtmp housekeeping. This is also
a historic bug. The length of this field is limited to 253 characters. Anything
beyond 253 will result in a log warning and the process command line being
skipped/ignored.
Please note that including certain characters in the process field will result
in
.B init
attempting to launch a shell to interpret the command contained in the process field.
The characters which will trigger a shell are:
.B ~`!$^&*()=|\{}[];\
"'<>?
On systems which do not have a shell to be launched or which do not wish to
use a shell to interpret the process field, the process field can be prefixed
with the @ symbol. The @ will be ignored and everything followed will be treated
as a command to be launched, literally, by the
.B init
service.
In cases where both a + and @ sign are to be used (to turn off logging and shell
interpretation), place the + sign before the @ symbol. Both flags will be handled
and then everything following the @ will be handled by
.B init
.\"}}}
.PP
The \fIrunlevels\fP field may contain multiple characters for different
runlevels. For example, \fB123\fP specifies that the process should be
started in runlevels 1, 2, and 3.
The \fIrunlevels\fP for \fBondemand\fP entries may contain an \fBA\fP,
\fBB\fP, or \fBC\fP. The \fIrunlevels\fP field of \fBsysinit\fP,
\fBboot\fP, and \fBbootwait\fP entries are ignored.
.PP
When the system runlevel is changed, any running processes that are not
specified for the new runlevel are killed, first with \s-2SIGTERM\s0,
then with \s-2SIGKILL\s0.
.PP
Valid actions for the \fIaction\fP field are:
.\"{{{ respawn
.IP \fBrespawn\fP
The process will be restarted whenever it terminates (e.g.\& getty).
.\"}}}
.\"{{{ wait
.IP \fBwait\fP
The process will be started once when the specified runlevel is entered and
.B init
will wait for its termination.
.\"}}}
.\"{{{ once
.IP \fBonce\fP
The process will be executed once when the specified runlevel is
entered.
.\"}}}
.\"{{{ boot
.IP \fBboot\fP
The process will be executed during system boot. The \fIrunlevels\fP
field is ignored.
.\"}}}
.\"{{{ bootwait
.IP \fBbootwait\fP
The process will be executed during system boot, while
.B init
waits for its termination (e.g.\& /etc/rc).
The \fIrunlevels\fP field is ignored.
.\"}}}
.\"{{{ off
.IP \fBoff\fP
This does nothing.
.\"}}}
.\"{{{ ondemand
.IP \fBondemand\fP
A process marked with an \fBondemand\fP runlevel will be executed
whenever the specified \fBondemand\fP runlevel is called. However, no
runlevel change will occur (\fBondemand\fP runlevels are `a', `b',
and `c').
.\"}}}
.\"{{{ initdefault
.IP \fBinitdefault\fP
An \fBinitdefault\fP entry specifies the runlevel which should be
entered after system boot. If none exists,
.B init
will ask for a runlevel on the console. The \fIprocess\fP field is ignored.
.\"}}}
.\"{{{ sysinit
.IP \fBsysinit\fP
The process will be executed during system boot. It will be
executed before any \fBboot\fP or \fB bootwait\fP entries.
The \fIrunlevels\fP field is ignored.
.\"}}}
.\"{{{ powerwait
.IP \fBpowerwait\fP
The process will be executed when the power goes down. \fBinit\fR is usually
informed about this by a process talking to a UPS connected to the computer.
\fBinit\fP will wait for the process to finish before continuing.
.\"}}}
.\"{{{ powerfail
.IP \fBpowerfail\fP
As for \fBpowerwait\fP, except that \fBinit\fP does not wait for the process's
completion.
.\"}}}
.\"{{{ powerokwait
.IP \fBpowerokwait\fP
This process will be executed as soon as \fBinit\fP is informed that the
power has been restored.
.\"}}}
.\"{{{ powerfailnow
.IP \fBpowerfailnow\fP
This process will be executed when \fBinit\fP is told that the battery of
the external UPS is almost empty and the power is failing (provided that the
external UPS and the monitoring process are able to detect this condition).
.\"}}}
.\"{{{ ctrlaltdel
.IP \fBctrlaltdel\fP
The process will be executed when \fBinit\fP receives the \fBSIGINT\fP signal.
This means that someone on the system console has pressed the
\fBCTRL\-ALT\-DEL\fP key combination. Typically one wants to execute some
sort of \fBshutdown\fP either to get into single\-user level or to
reboot the machine.
.\"}}}
.\"{{{ kbrequest
.IP \fBkbrequest\fP
The process will be executed when \fBinit\fP receives a signal from the
keyboard handler that a special key combination was pressed on the
console keyboard.
.sp
The documentation for this function is not complete yet; more documentation
can be found in the kbd-x.xx packages (most recent was kbd-0.94 at
the time of this writing). Basically you want to map some keyboard
combination to the "KeyboardSignal" action. For example, to map Alt-Uparrow
for this purpose use the following in your keymaps file:
.RS
.sp
alt keycode 103 = KeyboardSignal
.sp
.RE
.\"}}}
.\"}}}
.\"{{{ Examples
.SH EXAMPLES
This is an example of a inittab which resembles the old Linux inittab:
.RS
.sp
.nf
.ne 7
# inittab for linux
id:1:initdefault:
rc::bootwait:/etc/rc
1:1:respawn:/etc/getty 9600 tty1
2:1:respawn:/etc/getty 9600 tty2
3:1:respawn:/etc/getty 9600 tty3
4:1:respawn:/etc/getty 9600 tty4
.fi
.sp
.RE
This inittab file executes \fI/etc/rc\fP during boot and starts gettys
on tty1\-tty4.
.PP
A more elaborate \fBinittab\fP with different runlevels (see the comments
inside):
.RS
.sp
.nf
.ne 19
# Level to run in
id:2:initdefault:
# Boot-time system configuration/initialization script.
si::sysinit:/etc/init.d/rcS
# What to do in single-user mode.
~:S:wait:/sbin/sulogin
# /etc/init.d executes the S and K scripts upon change
# of runlevel.
#
# Runlevel 0 is halt.
# Runlevel 1 is single-user.
# Runlevels 2-5 are multi-user.
# Runlevel 6 is reboot.
l0:0:wait:/etc/init.d/rc 0
l1:1:wait:/etc/init.d/rc 1
l2:2:wait:/etc/init.d/rc 2
l3:3:wait:/etc/init.d/rc 3
l4:4:wait:/etc/init.d/rc 4
l5:5:wait:/etc/init.d/rc 5
l6:6:wait:/etc/init.d/rc 6
# What to do at the "3 finger salute".
ca::ctrlaltdel:/sbin/shutdown -t1 -h now
# Runlevel 2,3: getty on virtual consoles
# Runlevel 3: getty on terminal (ttyS0) and modem (ttyS1)
1:23:respawn:/sbin/getty tty1 VC linux
2:23:respawn:/sbin/getty tty2 VC linux
3:23:respawn:/sbin/getty tty3 VC linux
4:23:respawn:/sbin/getty tty4 VC linux
S0:3:respawn:/sbin/getty -L 9600 ttyS0 vt320
S1:3:respawn:/sbin/mgetty -x0 -D ttyS1
.fi
.sp
.RE
.\"}}}
.\"{{{ Files
.SH FILES
/etc/inittab
.\"}}}
.\"{{{ Author
.SH AUTHOR
\fBinit\fP was written by
.MT miquels@\:cistron\:.nl
Miquel van Smoorenburg
.ME .
This manual page was written by
.MT lederer@\:francium\:.informatik\:.uni-bonn\:.de
Sebastian Lederer
.ME
and modified by
.MT u31b3hs@\:pool\:.informatik\:.rwth-aachen\:.de
Michael Haardt
.ME .
.\"}}}
.\"{{{ See also
.SH "SEE ALSO"
.BR init (8),
.BR telinit (8)
.\"}}}
================================================
FILE: man/killall5.8
================================================
'\" -*- coding: UTF-8 -*-
.\" Copyright (C) 1998-2003 Miquel van Smoorenburg.
.\"
.\" 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 2 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, write to the Free Software
.\" Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
.\"
.TH KILLALL5 8 "04 Nov 2003" "sysvinit " "Linux System Administrator's Manual"
.SH NAME
killall5 - send a signal to all processes
.SH SYNOPSIS
.B killall5
.B \-signalnumber
.RB [ \-o
.IR omitpid [, omitpid ...]]
.RB [ \-o
.IR omitpid [, omitpid ...]...]
.SH DESCRIPTION
.B killall5
is the SystemV \fBkillall\fR command. It sends a signal to all processes except
kernel threads and the processes in its own session, so it won't kill
the shell that is running the script it was called from. Its primary
(only) use is in the \fBrc\fP scripts found in the \fI/etc/init.d\fP directory.
.SH OPTIONS
.IP "\fB-o\fP \fIomitpid\fP"
Tells \fBkillall5\fP to omit processes with that process id.
.SH NOTES
\fBkillall5\fP can also be invoked as \fBpidof\fP(8), which is simply a
(symbolic) link to the \fBkillall5\fP program.
.SH EXIT STATUS
The program return zero if it killed processes. It returns 2 if no
process were killed, and 1 if it was unable to find any processes
(\fI/proc/\fP is missing).
.SH SEE ALSO
.BR halt (8),
.BR reboot (8),
.BR pidof (8)
.SH AUTHOR
.MT miquels@\:cistron\:.nl
Miquel van Smoorenburg
.ME
================================================
FILE: man/last.1
================================================
'\" -*- coding: UTF-8 -*-
.\" Copyright (C) 1998-2004 Miquel van Smoorenburg.
.\"
.\" 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 2 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, write to the Free Software
.\" Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
.\"
.\"{{{}}}
.\"{{{ Title
.TH LAST, LASTB 1 "Jul 31, 2004" "sysvinit " "User Commands"
.\"}}}
.\"{{{ Name
.SH NAME
last, lastb \- show listing of last logged in users
.\"}}}
.\"{{{ Synopsis
.SH SYNOPSIS
.B last
.RB [ \-R ]
.RB [ \-\fInum\fP ]
[\-\fBn\fP \fInum\/\fP]
.RB [ \-adFiowx ]
[\-\fBf\fP \fIfile\/\fP]
[\-\fBt\fP \fIYYYYMMDDHHMMSS\/\fP]
.RI [ name... ]
.RI [ tty... ]
.br
.B lastb
.RB [ \-R ]
.RB [ \-\fInum\fP ]
[\-\fBn\fP \fInum\/\fP]
[\-\fBf\fP \fIfile\/\fP]
.RB [ \-adFiowx ]
.RI [ name... ]
.RI [ tty... ]
.\"}}}
.\"{{{ Description
.SH DESCRIPTION
.B Last
searches back through the file \fB/var/log/wtmp\fP (or the file
designated by the \fB\-f\fP flag) and displays a list of all
users logged in (and out) since that file was created. Names of users
and tty's can be given, in which case \fBlast\fP will show only those entries
matching the arguments. Names of ttys can be abbreviated, thus \fBlast
0\fP is the same as \fBlast tty0\fP.
.PP
When \fBlast\fP catches a \fBSIGINT\fP signal (generated by the interrupt key,
usually control-C) or a \fBSIGQUIT\fP signal (generated by the quit key,
usually control-\e), \fBlast\fP will show how far it has searched through the
file; in the case of the \fBSIGINT\fP signal \fBlast\fP will then terminate.
.PP
The pseudo user \fBreboot\fP logs in each time the system is rebooted.
Thus \fBlast reboot\fP will show a log of all reboots since the log file
was created.
.PP
\fBlastb\fP is the same as \fBlast\fP, except that by default it shows a log
of the file \fB/var/log/btmp\fP, which contains all the bad login attempts.
.\"}}}
.\"{{{ Options
.SH OPTIONS
.IP "\fB\-f\fP \fIfile\fP"
Tells \fBlast\fP to use a specific file instead of \fI/var/log/wtmp\fP.
.IP \fB\-\fP\fInum\fP
This is a count telling \fBlast\fP how many lines to show.
.IP "\fB\-n\fP \fInum\fP"
The same.
.IP "\fB\-t\fP \fIYYYYMMDDHHMMSS\fP"
Display the state of logins as of the specified time. This is
useful, e.g., to determine easily who was logged in at a particular
time -- specify that time with \fB\-t\fP and look for "still logged
in".
.IP \fB\-R\fP
Suppresses the display of the hostname field.
.IP \fB\-a\fP
Display the hostname in the last column. Useful in combination
with the next flag.
.IP \fB\-d\fP
For non-local logins, Linux stores not only the host name of the remote
host but its IP number as well. This option translates the IP number
back into a hostname.
.IP \fB\-F\fP
Print full login and logout times and dates.
.IP \fB\-i\fP
This option is like \fB-d\fP in that it displays the IP number of the remote
host, but it displays the IP number in numbers-and-dots notation.
.IP \fB\-l\fP
This option allows the display of usernames longer than 8 characters.
This may mess up formatting in some programs and make the output wider than
the standard 80 characters.
.IP \fB\-o\fP
Read an old-type wtmp file (written by linux-libc5 applications).
.IP \fB\-w\fP
Display full user and domain names in the output.
.IP \fB\-x\fP
Display the system shutdown entries and run level changes.
.\"}}}
.SH NOTES
The files \fIwtmp\fP and \fIbtmp\fP might not be found. The system only
logs information in these files if they are present. This is a local
configuration issue. If you want the files to be used, they can be
created with a simple \fBtouch\fP(1) command (for example,
\fBtouch /var/log/wtmp\fP).
.\"{{{ Files
.SH FILES
/var/log/wtmp
.br
/var/log/btmp
.\"}}}
.\"{{{ Author
.SH AUTHOR
.MT miquels@\:cistron\:.nl
Miquel van Smoorenburg
.ME
.\"}}}
.\"{{{ See also
.SH "SEE ALSO"
.BR shutdown (8),
.BR login (1),
.BR init (8)
.\"}}}
================================================
FILE: man/lastb.1
================================================
.so man1/last.1
================================================
FILE: man/logsave.8
================================================
.\" -*- nroff -*-
.\" Copyright 2003 by Theodore Ts'o. All Rights Reserved.
.\" This file may be copied under the terms of the GNU Public License.
.\"
.TH LOGSAVE 8 "" "sysvinit " "Linux System Administrator's Manual"
.SH NAME
logsave \- save the output of a command in a logfile
.SH SYNOPSIS
.B logsave
[
.B \-asv
]
.I logfile cmd_prog [ ... ]
.SH DESCRIPTION
The
.B logsave
program will execute
.I cmd_prog
with the specified argument(s), and save a copy of its output to
.IR logfile .
If the containing directory for
.I logfile
does not exist,
.B logsave
will accumulate the output in memory until it can be written out.
A copy of the output will also be written to standard output.
.PP
If
.I cmd_prog
is a single hyphen ('-'), then instead of executing a program,
.B logsave
will take its input from standard input and save it in
.IR logfile .
.PP
.B logsave
is useful for saving the output of initial boot scripts
until the \fI/var\fP partition is mounted, so the output can be written to
\fI/var/log\fP.
.SH OPTIONS
.TP
.B \-a
This option will cause the output to be appended to
.IR logfile ,
instead of replacing its current contents.
.TP
.B \-s
This option will cause
.B logsave
to skip writing to the log file text which is bracketed with a control-A
(ASCII 001 or Start of Header) and control-B (ASCII 002 or Start of
Text). This allows progress bar information to be visible to the user
on the console, while not being written to the log file.
.TP
.B \-v
This option will make
.B logsave
to be more verbose in its output to the user.
.SH AUTHOR
.MT tytso@mit\:.edu
Theodore Ts'o
.ME
.SH SEE ALSO
.BR fsck (8)
================================================
FILE: man/mesg.1
================================================
'\" -*- coding: UTF-8 -*-
.\" Copyright (C) 1998-2001 Miquel van Smoorenburg.
.\"
.\" 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 2 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, write to the Free Software
.\" Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
.\"
.\"{{{}}}
.\"{{{ Title
.TH MESG 1 "Feb 26, 2001" "sysvinit " "User Commands"
.\"}}}
.\"{{{ Name
.SH NAME
mesg \- control write access to your terminal
.\"}}}
.\"{{{ Synopsis
.SH SYNOPSIS
.B mesg
.RB [ y | n ]
.\"}}}
.\"{{{ Description
.SH DESCRIPTION
.B mesg
controls the access to your terminal by others. It's typically used to
allow or disallow other users to write to your terminal (see \fBwrite\fP(1)).
.\"}}}
.\"{{{ Options
.SH OPTIONS
.IP \fBy\fP
Allow write access to your terminal.
.IP \fBn\fP
Disallow write access to your terminal.
.PP
If no option is given, \fBmesg\fP prints out the current access state of your
terminal.
.\"}}}
.\"{{{ Notes
.SH NOTES
\fBmesg\fP assumes that its standard input is connected to your
terminal. That also means that if you are logged in multiple times,
you can get/set the mesg status of other sessions by using redirection.
For example "mesg n < /dev/pts/46".
.SH AUTHOR
.MT miquels@\:cistron\:.nl
Miquel van Smoorenburg
.ME
.\"}}}
.\"{{{ See also
.SH "SEE ALSO"
.BR talk (1),
.BR write (1),
.BR wall (1)
.\"}}}
================================================
FILE: man/mountpoint.1
================================================
'\" -*- coding: UTF-8 -*-
.\" Copyright (C) 1998-2004 Miquel van Smoorenburg.
.\"
.\" 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 2 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, write to the Free Software
.\" Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
.\"
.TH MOUNTPOINT 1 "Mar 15, 2004" "sysvinit " "User Commands"
.SH NAME
mountpoint \- see if a directory is a mountpoint
.SH SYNOPSIS
.B mountpoint
.RB [ \-q ]
.RB [ \-d ]
.I /path/to/directory
.br
.B mountpoint
.B \-x
.I /dev/device
.SH DESCRIPTION
\fBmountpoint\fP checks if the directory is a mountpoint.
.SH OPTIONS
.IP \fB\-q\fP
Be quiet - don't print anything.
.IP \fB\-d\fP
Print major/minor device number of the filesystem on stdout.
.IP \fB\-p\fP
Check Linux's \fI/proc/mounts\fP file to try to detect circular mount points.
.IP \fB\-x\fP
Print major/minor device number of the blockdevice on stdout.
.SH EXIT STATUS
Zero if the directory is a mountpoint, non-zero if not.
.SH NOTES
Symbolic links are not followed, except when the \fB-x\fP option is
used. To force following symlinks, add a trailing slash to the
path of the directory.
.PP
The name of the command is misleading when the \fB-x\fP option is used,
but the option is useful for comparing if a directory and a device
match up, and there is no other command that can print the info easily.
.PP
The mountpoint command fails when a directory is binded to one of its grandparents.
For example, if /a/b/c/d is a mount point for /a/b then mountpoint will report
/a/b/c/d is not a valid mount point. This is because both the original directory and
its new mount point share the same inode and device number.
.PP
The circular mount problem can be worked around on Linux systems by using
the\fB-p\fP flag to check the \fI/proc/mounts\fP file for references to the circular mount bind.
When using the \fB-p\fP flag, make sure to specify the full path (ie \fI/home/user/mp\fP and
not just \fImp\fP). Also, \fBmountpoint\fP may still fail if there are spaces in
the mount point's path, even when using the \fB-p\fP flag because of the way
\fB/proc/mounts\fP mangles the spaces in the path name. Of course, if the
admin is using circular mount points with spaces in the name, there
are bigger concerns.
.SH AUTHOR
.MT miquels@\:cistron\:.nl
Miquel van Smoorenburg
.ME
.SH "SEE ALSO"
.BR stat (1)
================================================
FILE: man/pidof.8
================================================
'\" -*- coding: UTF-8 -*-
.\" Copyright (C) 1998 Miquel van Smoorenburg.
.\"
.\" 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 2 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, write to the Free Software
.\" Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
.\"
.TH PIDOF 8 "01 Sep 1998" "sysvinit " "Linux System Administrator's Manual"
.SH NAME
pidof \- find the process ID of a running program
.SH SYNOPSIS
.B pidof
.RB [ \-s ]
.RB [ \-c ]
.RB [ \-n ]
.RB [ \-x ]
.RB [ \-z ]
.RB [ \-o
.IR omitpid [ \fB,\fPomitpid "...\&]]"
.RB [ \-o
.IR omitpid [ \fB,\fPomitpid ...]...\&]
.RB [ \-d
.IR sep ]
.I program
.RI [ program "...]"
.SH DESCRIPTION
.B pidof
finds the process id's (PIDs) of the named programs.
It prints those id's on the standard output.
This program is on some systems used in run-level change scripts,
especially when the system has a \fISystem-V\fP like \fIrc\fP structure.
In that case these scripts are located in \fI/etc/rc?.d\fP,
where ? is the runlevel.
If the system has a \fBstart-stop-daemon\fP(8) program
that should be used instead.
.SH OPTIONS
.IP \fB\-s\fP
Single shot - this instructs the program to only return one \fIpid\fP.
.IP \fB\-c\fP
Only return process PIDs that are running with the same root directory.
This option is ignored for non-root users, as they will be unable to check
the current root directory of processes they do not own.
.IP \fB\-n\fP
Avoid
.BR stat (2)
system function call on all binaries which are located on network
based file systems like
.BR NFS .
Instead of using this option the variable
.B PIDOF_NETFS
may be set and exported.
.IP \fB\-q\fP
Do not display matched PIDs to standard out.
Simply exit with a status of true or false to indicate whether a matching
PID was found.
.IP \fB\-x\fP
Scripts too - this causes the program to also return process id's of
shells running the named scripts.
.IP \fB\-z\fP
Try to detect processes which are stuck in zombie (Z) status.
Usually these processes are skipped
as trying to deal with them can cause pidof or related tools to hang.
Note: In the past pidof would ignore processes in the uninterruptable state
(D),
unless the \fB\-z\fP flag was specified.
This is no longer the case.
The \fBpidof\fP program will find and report processes in the D state
whether \fB\-z\fP is specified or not.
.IP "\-d \fIsep\fP"
Tells \fIpidof\fP to use \fIsep\fP as an output separator
if more than one PID is shown.
The default separator is a space.
.IP "\-o \fIomitpid\fP"
Tells \fIpidof\fP to omit processes with that process id.
The special pid \fB%PPID\fP can be used to name the parent process of the
\fBpidof\fP program,
in other words the calling shell or shell script.
.SH "EXIT STATUS"
.TP
.B 0
At least one program was found with the requested name.
.TP
.B 1
No program was found with the requested name.
.SH NOTES
\fIpidof\fP is actually the same program as \fBkillall5\fP(8);
the program behaves according to the name under which it is called.
.PP
When \fBpidof\fP is invoked with a full pathname to the program it
should find the pid of,
it is reasonably safe.
Otherwise it is possible
that it returns PIDs of running programs that happen to have the same name
as the program you're after but are actually other programs.
Note that the executable name of running processes is calculated with
.BR readlink (2),
so symbolic links to executables will also match.
.PP
Zombie processes or processes in disk sleep
(states Z and D, respectively)
are ignored,
as attempts to access the stats of these will sometimes fail.
The \fB\-z\fP flag (see above) tells \fBpidof\fP to try to detect these
sleeping and zombie processes,
at the risk of failing or hanging.
.SH SEE ALSO
.BR shutdown (8),
.BR init (8),
.BR halt (8),
.BR reboot (8),
.BR killall5 (8)
.SH AUTHOR
.MT miquels@\:cistron\:.nl
Miquel van Smoorenburg
.ME
================================================
FILE: man/po/de.po
================================================
# German translation of the sysvinit man pages.
# Martin Okrslar <okrslar@informatik.uni-muenchen.de>, 2000.
# Martin Schulze <joey@infodrom.org>, 2001.
# Martin Eberhard Schauer <Martin.E.Schauer@gmx.de>, 2010.
# Chris Leick <c.leick@vollbio.de>, 2010.
# Helge Kreutzmann <debian@helgefjell.de>, 2016, 2018-2021.
# Mario Blättermann <mario.blaettermann@gmail.com>, 2014, 2018-2021.
msgid ""
msgstr ""
"Project-Id-Version: sysvinit-man\n"
"POT-Creation-Date: 2021-12-27 14:19+0100\n"
"PO-Revision-Date: 2021-12-27 22:14+0100\n"
"Last-Translator: Mario Blättermann <mario.blaettermann@gmail.com>\n"
"Language-Team: German <debian-l10n-german@lists.debian.org>\n"
"Language: de\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: Lokalize 21.12.0\n"
#. type: TH
#: ../bootlogd.8:18
#, no-wrap
msgid "BOOTLOGD"
msgstr "BOOTLOGD"
#. type: TH
#: ../bootlogd.8:18
#, no-wrap
msgid "Jul 21, 2003"
msgstr "21. Juli 2003"
#. type: TH
#: ../bootlogd.8:18 ../fstab-decode.8:20 ../halt.8:20 ../init.8:20
#: ../initctl.5:17 ../initscript.5:18 ../inittab.5:20 ../killall5.8:18
#: ../last.1:20 ../logsave.8:5 ../mesg.1:20 ../mountpoint.1:18 ../pidof.8:18
#: ../readbootlog.1:20 ../runlevel.8:18 ../shutdown.8:20 ../sulogin.8:18
#: ../utmpdump.1:18 ../wall.1:18
#, no-wrap
msgid "sysvinit @VERSION@"
msgstr "sysvinit @VERSION@"
#. type: TH
#: ../bootlogd.8:18 ../fstab-decode.8:20 ../halt.8:20 ../init.8:20
#: ../killall5.8:18 ../logsave.8:5 ../pidof.8:18 ../runlevel.8:18
#: ../shutdown.8:20 ../sulogin.8:18
#, no-wrap
msgid "Linux System Administrator's Manual"
msgstr "Linux-Systemverwaltungshandbuch"
#. type: SH
#: ../bootlogd.8:19 ../fstab-decode.8:22 ../halt.8:23 ../init.8:23
#: ../initctl.5:18 ../initscript.5:19 ../inittab.5:23 ../killall5.8:19
#: ../last.1:23 ../logsave.8:6 ../mesg.1:23 ../mountpoint.1:19 ../pidof.8:19
#: ../readbootlog.1:23 ../runlevel.8:19 ../shutdown.8:23 ../sulogin.8:19
#: ../utmpdump.1:19 ../wall.1:20
#, no-wrap
msgid "NAME"
msgstr "BEZEICHNUNG"
#. type: Plain text
#: ../bootlogd.8:21
msgid "bootlogd - record boot messages"
msgstr "bootlogd - Boot-Meldungen aufzeichnen"
#. type: SH
#: ../bootlogd.8:21 ../fstab-decode.8:25 ../halt.8:27 ../init.8:27
#: ../initctl.5:20 ../initscript.5:21 ../killall5.8:21 ../last.1:27
#: ../logsave.8:8 ../mesg.1:27 ../mountpoint.1:21 ../pidof.8:21
#: ../readbootlog.1:27 ../runlevel.8:21 ../shutdown.8:27 ../sulogin.8:21
#: ../utmpdump.1:21 ../wall.1:23
#, no-wrap
msgid "SYNOPSIS"
msgstr "ÜBERSICHT"
#. type: Plain text
#: ../bootlogd.8:31
msgid ""
"B</sbin/bootlogd> [B<-c>] [B<-d>] [B<-e>] [B<-r>] [B<-s>] [B<-v>] [I< >B<-"
"l>I< logfile >] [I< >B<-p>I< pidfile >]"
msgstr ""
"B</sbin/bootlogd> [B<-c>] [B<-d>] [B<-e>] [B<-r>] [B<-s>] [B<-v>] [I< >B<-"
"l>I< Protokolldatei >] [I< >B<-p>I< PID-Datei >]"
#. type: SH
#: ../bootlogd.8:31 ../fstab-decode.8:28 ../halt.8:53 ../init.8:46
#: ../initctl.5:22 ../initscript.5:23 ../inittab.5:28 ../killall5.8:28
#: ../last.1:48 ../logsave.8:14 ../mesg.1:32 ../mountpoint.1:30 ../pidof.8:36
#: ../readbootlog.1:34 ../runlevel.8:24 ../shutdown.8:36 ../sulogin.8:27
#: ../utmpdump.1:25 ../wall.1:28
#, no-wrap
msgid "DESCRIPTION"
msgstr "BESCHREIBUNG"
#. type: Plain text
#: ../bootlogd.8:35
msgid ""
"B<bootlogd> runs in the background and copies all strings sent to the I</dev/"
"console> device to a logfile. If the I<logfile> is not accessible, the "
"messages will be kept in memory until it is."
msgstr ""
"B<bootlogd> wird im Hintergrund ausgeführt und kopiert alle an das Gerät I</"
"dev/console> gesendeten Zeichenketten in eine Protokolldatei. Falls auf die "
"I<Ptotokolldatei> nicht zugegriffen werden kann, werden die Meldungen im "
"Speicher behalten, bis der Zugriff wieder möglich ist."
#. type: SH
#: ../bootlogd.8:35 ../halt.8:68 ../killall5.8:34 ../last.1:70 ../logsave.8:39
#: ../mesg.1:38 ../mountpoint.1:33 ../pidof.8:44 ../readbootlog.1:42
#: ../runlevel.8:49 ../shutdown.8:54 ../utmpdump.1:28 ../wall.1:52
#, no-wrap
msgid "OPTIONS"
msgstr "OPTIONEN"
#. type: IP
#: ../bootlogd.8:36 ../halt.8:75 ../last.1:87 ../mountpoint.1:36
#, no-wrap
msgid "B<-d>"
msgstr "B<-d>"
#. type: Plain text
#: ../bootlogd.8:38
msgid "Do not fork and run in the background."
msgstr ""
#. type: IP
#: ../bootlogd.8:38
#, no-wrap
msgid "B<-e>"
msgstr "B<-e>"
#. type: Plain text
#: ../bootlogd.8:42
msgid ""
"Print escape characters to the boot log file. This turns off filtering of "
"escape characters and allows tools like GNU B<less>(1) to see and use colour "
"control characters (show the log in colour)."
msgstr ""
"gibt Escape-Zeichen in die Boot-Protokolldatei aus. Dadurch wird die "
"Filterung der Escape-Zeichen deaktiviert und Werkzeugen wie GNU B<less>(1) "
"ermöglicht, diese zu sehen und Farb-Steuerzeichen zu verwenden (also das "
"Protokoll farbig anzuzeigen)."
#. type: IP
#: ../bootlogd.8:42 ../pidof.8:47 ../shutdown.8:101
#, no-wrap
msgid "B<-c>"
msgstr "B<-c>"
#. type: Plain text
#: ../bootlogd.8:47
msgid ""
"Attempt to write to the logfile even if it does not yet exist. Without this "
"option, B<bootlogd> will wait for the logfile to appear before attempting to "
"write to it. This behavior prevents B<bootlogd> from creating logfiles under "
"mount points."
msgstr ""
"versucht, auch dann in die Protokolldatei zu schreiben, wenn diese noch "
"nicht existiert. Ohne diese Option wartet B<bootlogd>, bis die "
"Protokolldatei erscheint, bevor ein Schreibversuch unternommen wird. Dieses "
"Verhalten hindert B<bootlogd> daran, Protokolldateien unterhalb von "
"Einhängepunkten zu erstellen."
#. type: IP
#: ../bootlogd.8:47 ../shutdown.8:64 ../utmpdump.1:31
#, no-wrap
msgid "B<-r>"
msgstr "B<-r>"
#. type: Plain text
#: ../bootlogd.8:50
msgid ""
"If there is an existing logfile called I<logfile> rename it to I<logfile~> "
"unless I<logfile~> already exists."
msgstr ""
"Eine vorhandene I<Protokolldatei> wird umbenannt, indem dem Namen eine Tilde "
"angehängt wird (I<Protokolldatei~>), außer wenn die I<Protokolldatei~> "
"bereits vorhanden ist."
#. type: IP
#: ../bootlogd.8:50 ../logsave.8:45 ../pidof.8:45
#, no-wrap
msgid "B<-s>"
msgstr "B<-s>"
#. type: Plain text
#: ../bootlogd.8:56
msgid ""
"Ensure that the data is written to the file after each line by calling "
"B<fdatasync>(3). This will slow down a B<fsck>(8) process running in "
"parallel."
msgstr ""
"stellt sicher, dass die Daten tatsächlich in die Datei geschrieben werden, "
"indem nach jeder Zeile B<fdatasync>(3) aufgerufen wird. Dadurch wird ein "
"parallel laufender B<fsck>(8)-Prozess verlangsamt."
#. type: TP
#: ../bootlogd.8:56 ../logsave.8:53
#, no-wrap
msgid "B<-v>"
msgstr "B<-v>"
#. type: Plain text
#: ../bootlogd.8:58
msgid "Show version."
msgstr "zeigt die Version an."
#. type: IP
#: ../bootlogd.8:58
#, no-wrap
msgid "B<-l> I<logfile>"
msgstr "B<-l> I<Protokolldatei>"
#. type: Plain text
#: ../bootlogd.8:60
msgid "Log to this logfile. The default is I</var/log/boot>."
msgstr ""
"speichert in die angegebene Protokolldatei. Die Vorgabe ist I</var/log/boot>."
#. type: IP
#: ../bootlogd.8:60
#, no-wrap
msgid "B<-p> I<pidfile>"
msgstr "B<-p> I<PID-Datei>"
#. type: Plain text
#: ../bootlogd.8:62
msgid "Put process-id in this file. The default is no pidfile."
msgstr ""
"speichert die Prozesskennung (PID) in dieser Datei. Standardmäßig wird keine "
"PID-Datei gespeichert."
#. }}}
#. type: SH
#: ../bootlogd.8:62 ../halt.8:94 ../initctl.5:119 ../initscript.5:60
#: ../killall5.8:37 ../last.1:107 ../mesg.1:48 ../mountpoint.1:44 ../pidof.8:87
#: ../shutdown.8:216
#, no-wrap
msgid "NOTES"
msgstr "ANMERKUNGEN"
#. type: Plain text
#: ../bootlogd.8:67
msgid ""
"B<bootlogd> saves log data which includes control characters. The log is "
"technically a text file, but not very easy for humans to read. To address "
"this the B<readbootlog>(1) command can be used to display the boot log "
"without the control characters."
msgstr ""
#. type: SH
#: ../bootlogd.8:67 ../utmpdump.1:52
#, no-wrap
msgid "BUGS"
msgstr "FEHLER"
#. type: Plain text
#: ../bootlogd.8:77
msgid ""
"B<bootlogd> works by redirecting the console output from the console "
"device. (Consequently B<bootlogd> requires PTY support in the kernel "
gitextract_nrp8io5d/
├── .gitignore
├── COPYING
├── COPYRIGHT
├── Makefile
├── README
├── contrib/
│ ├── alexander.viro
│ ├── migrate-svn-git
│ ├── notify-pam-dead.patch
│ ├── sysd2v.sh
│ └── zefram-patches
├── doc/
│ ├── Changelog
│ ├── Install
│ ├── Propaganda
│ ├── bootlogd.README
│ ├── initctl
│ └── initscript.sample
├── man/
│ ├── Makefile
│ ├── bootlogd.8
│ ├── fstab-decode.8
│ ├── halt.8
│ ├── init.8
│ ├── initctl.5
│ ├── initscript.5
│ ├── inittab.5
│ ├── killall5.8
│ ├── last.1
│ ├── lastb.1
│ ├── logsave.8
│ ├── mesg.1
│ ├── mountpoint.1
│ ├── pidof.8
│ ├── po/
│ │ ├── de.po
│ │ ├── es.po
│ │ ├── fi.po
│ │ ├── fr.po
│ │ ├── hu.po
│ │ ├── id.po
│ │ ├── pl.po
│ │ ├── po4a.cfg
│ │ ├── pt.po
│ │ └── sysvinit-man.pot
│ ├── poweroff.8
│ ├── readbootlog.1
│ ├── reboot.8
│ ├── runlevel.8
│ ├── shutdown.8
│ ├── sulogin.8
│ ├── telinit.8
│ ├── utmpdump.1
│ └── wall.1
└── src/
├── .gitignore
├── Makefile
├── bootlogd.c
├── bootlogd.h
├── consoles.c
├── consoles.h
├── dowall.c
├── fstab-decode.c
├── halt.c
├── hddown.c
├── ifdown.c
├── init.c
├── init.h
├── initreq.h
├── killall5.c
├── last.c
├── logsave.c
├── mesg.c
├── mountpoint.c
├── oldutmp.h
├── paths.h
├── readbootlog.c
├── reboot.h
├── runlevel.c
├── runlevellog.c
├── runlevellog.h
├── set.h
├── shutdown.c
├── sulogin.c
├── utmp.c
├── utmpdump.c
└── wall.c
SYMBOL INDEX (218 symbols across 25 files)
FILE: src/bootlogd.c
type real_cons (line 73) | struct real_cons {
type consdev (line 82) | struct consdev {
function handler (line 104) | void handler(int sig)
function chdir_int (line 113) | static int chdir_int(const char *path)
function findtty (line 131) | static int findtty(char *res, const char *startdir, int rlen, dev_t dev)
function findpty (line 191) | int findpty(int *master, int *slave, char *name)
function istty (line 225) | static int istty(const char *dev)
function isconsole (line 244) | int isconsole(char *s, char *res, int rlen)
function consolenames (line 281) | int consolenames(struct real_cons *cons, int max_consoles)
function writelog (line 401) | void writelog(FILE *fp, unsigned char *ptr, int len, int print_escape_ch...
function usage (line 493) | void usage(void)
function open_nb (line 499) | int open_nb(char *buf)
function write_err (line 516) | int write_err(int pts, int realfd, char *realcons, int e)
function main (line 534) | int main(int argc, char **argv)
FILE: src/consoles.c
type console (line 58) | struct console
function dev_t (line 118) | static
type dirent (line 156) | struct dirent
type stat (line 163) | struct stat
type chardata (line 183) | struct chardata
function consalloc (line 200) | __attribute__((__nonnull__,__hot__))
function detect_consoles (line 235) | int detect_consoles(const char *device, int fallback)
FILE: src/consoles.h
type chardata (line 29) | struct chardata {
type console (line 35) | struct console {
type console (line 47) | struct console
FILE: src/dowall.c
function handler (line 57) | static void handler(int arg)
function feputs (line 67) | static void feputs(const char *line, FILE *fp)
function getuidtty (line 83) | static void getuidtty(char **userp, char **ttyp)
function file_isatty (line 130) | static int file_isatty(const char *fname)
function wall (line 159) | void wall(const char *text, int remote)
FILE: src/fstab-decode.c
function decode (line 26) | static void
function main (line 72) | int
FILE: src/halt.c
function usage (line 82) | void usage(void)
function get_runlevel (line 107) | int get_runlevel(void)
function do_shutdown (line 169) | void do_shutdown(char *fl, int should_poweroff, char *tm)
function main (line 197) | int main(int argc, char **argv)
FILE: src/hddown.c
type dirent (line 87) | struct dirent
type dirent (line 194) | struct dirent
function do_standby_disk (line 205) | static int do_standby_disk(char *device, unsigned int flags)
function hddown (line 262) | int hddown(void)
function hdflush (line 280) | int hdflush(void)
function FILE (line 315) | static FILE *hdopen(const char* const format, const char* const name)
function flush_cache_ext (line 344) | static int flush_cache_ext(const char *device)
function find_idedisks (line 415) | static int find_idedisks(const char **dev, int maxdev, int *count)
function find_scsidisks (line 449) | static int find_scsidisks(const char **dev, int maxdev, int *count)
function open_disk (line 466) | static int open_disk(const char *device)
function open_disks (line 476) | static int open_disks(const char **disks, int *fds, int count)
function do_standby_disk (line 490) | static int do_standby_disk(int fd)
function do_standby_disks (line 514) | static int do_standby_disks(const int *fds, int count)
function hddown (line 529) | int hddown(void)
function hdflush (line 545) | int hdflush(void)
function hddown (line 553) | int hddown(void)
function hdflush (line 558) | int hdflush(void)
function main (line 566) | int main(int argc, char **argv)
FILE: src/ifdown.c
function ifdown (line 63) | int ifdown(void)
FILE: src/init.c
type utmp (line 159) | struct utmp
type actions (line 177) | struct actions {
function do_msleep (line 252) | static
function send_state (line 298) | static
function get_string (line 349) | static int get_string(char *p, int size, FILE *f)
function get_void (line 364) | static int get_void(FILE *f)
function get_cmd (line 377) | static int get_cmd(FILE *f)
function CHILD (line 393) | static CHILD *get_record(FILE *f)
function receive_state (line 522) | static
function setproctitle (line 553) | static int setproctitle(char *fmt, ...)
function console_init (line 577) | static
function console_open (line 615) | static
function signal_handler (line 647) | static
function chld_handler (line 660) | void chld_handler(int sig)
function cont_handler (line 705) | void cont_handler(int sig)
function coredump (line 714) | static
type sigcontext (line 753) | struct sigcontext
function segv_handler (line 755) | void segv_handler(int sig, struct sigcontext ctx)
function segv_handler (line 774) | void segv_handler(int sig)
function stop_handler (line 794) | void stop_handler(int sig)
function console_stty (line 808) | static
function safe_write (line 884) | static ssize_t
function print (line 905) | void print(char *s)
function initlog (line 919) | __attribute__ ((format (printf, 2, 3)))
function addnewenv (line 957) | int addnewenv(const char *new, char **curr, int n)
function init_freeenv (line 1025) | void init_freeenv(char **e)
function pid_t (line 1041) | static
function startup (line 1338) | static
function check_kernel_console (line 1372) | static
function read_inittab (line 1449) | static
function start_if_needed (line 1925) | static
function ask_runlevel (line 1971) | static
function get_init_default (line 2000) | static
function read_level (line 2050) | static
function fail_check (line 2166) | static
function fail_cancel (line 2199) | static
function do_power_fail (line 2214) | static
function check_pipe (line 2248) | static
function make_pipe (line 2269) | static
function my_re_exec (line 2292) | static
function redo_utmp_wtmp (line 2368) | static
function fifo_new_level (line 2388) | static
function initcmd_setenv (line 2430) | static
function check_init_fifo (line 2487) | static
function boot_transitions (line 2632) | static
function process_signals (line 2719) | static
function init_main (line 2855) | static
function usage (line 3018) | static
function telinit (line 3025) | static
function main (line 3139) | int main(int argc, char **argv)
FILE: src/init.h
type CHILD (line 96) | typedef struct _child_ {
type utmp (line 165) | struct utmp
FILE: src/initreq.h
type init_request_bsd (line 52) | struct init_request_bsd {
type init_request (line 71) | struct init_request {
FILE: src/killall5.c
type PROC (line 72) | typedef struct proc {
type PIDQ (line 88) | typedef struct pidq {
type PIDQ_HEAD (line 93) | typedef struct {
type OMIT (line 99) | typedef struct _s_omit {
type SHADOW (line 105) | typedef struct _s_shadow
type NFS (line 113) | typedef struct _s_nfs
function xmemalign (line 181) | static inline void xmemalign(void **memptr, size_t alignment, size_t size)
function mount_proc (line 193) | int mount_proc(void)
function isnetfs (line 240) | static inline int isnetfs(const char * type)
function init_nfs (line 254) | void init_nfs(void)
function clear_shadow (line 317) | static void clear_shadow(SHADOW *restrict shadow)
function clear_mnt (line 337) | static void clear_mnt(void)
function shadow (line 362) | static int shadow(SHADOW *restrict this, const char *restrict name, cons...
function maxsymlinks (line 384) | static int maxsymlinks(void)
function check4nfs (line 397) | int check4nfs(const char * path, char * real)
function readarg (line 464) | int readarg(FILE *fp, char *buf, int sz)
function readproc (line 479) | int readproc()
function PIDQ_HEAD (line 681) | PIDQ_HEAD *init_pid_q(PIDQ_HEAD *q)
function empty_q (line 687) | int empty_q(PIDQ_HEAD *q)
function add_pid_to_q (line 692) | int add_pid_to_q(PIDQ_HEAD *q, PROC *p)
function PROC (line 711) | PROC *get_next_from_pid_q(PIDQ_HEAD *q)
function PIDQ_HEAD (line 727) | PIDQ_HEAD *pidof(char *prog)
function usage (line 881) | void usage(void)
function pidof_usage (line 889) | void pidof_usage(void)
function nsyslog (line 907) | __attribute__ ((format (printf, 2, 3)))
function main_pidof (line 934) | int main_pidof(int argc, char **argv)
function main (line 1088) | int main(int argc, char **argv)
FILE: src/last.c
type utmplist (line 62) | struct utmplist {
type utmplist (line 67) | struct utmplist
function uconv (line 102) | void uconv(struct oldutmp *oldut, struct utmp *utn)
function uread (line 119) | int uread(FILE *fp, struct utmp *u, int *quit)
function uread (line 223) | int uread(FILE *fp, struct utmp *u, int *quit)
function int_handler (line 299) | void int_handler()
function quit_handler (line 308) | void quit_handler()
function dns_lookup (line 331) | int dns_lookup(char *result, int size, int useip, int32_t *a)
function list (line 375) | int list(struct utmp *p, time_t t, int what)
function usage (line 587) | void usage(char *s)
function time_t (line 595) | time_t parsetm(char *ts)
function main (line 634) | int main(int argc, char **argv)
FILE: src/logsave.c
function usage (line 47) | static void usage(char *progname)
function write_all (line 61) | static int write_all(int fd, const char *buf, size_t count)
function send_output (line 80) | static void send_output(const char *buffer, int c, int flag)
function do_read (line 122) | static int do_read(int fd)
function signal_term (line 158) | static void signal_term(int sig)
function run_program (line 164) | static int run_program(char **argv)
function copy_from_stdin (line 233) | static int copy_from_stdin(void)
function main (line 256) | int main(int argc, char **argv)
FILE: src/mesg.c
function hasttygrp (line 43) | int hasttygrp(void)
function tty_in_ttygrp (line 56) | int tty_in_ttygrp(struct stat *st)
function main (line 68) | int main(int argc, char **argv)
FILE: src/mountpoint.c
function dostat (line 43) | int dostat(char *path, struct stat *st, int do_lstat, int quiet)
function do_proc_check (line 68) | int do_proc_check(char *path)
function usage (line 108) | void usage(void) {
function main (line 113) | int main(int argc, char **argv)
FILE: src/oldutmp.h
type oldutmp (line 30) | struct oldutmp {
FILE: src/readbootlog.c
function print_usage (line 11) | void print_usage()
function Clean_Line (line 27) | int Clean_Line(char *source_line, char *output_line)
function main (line 93) | int main(int argc, char *argv[])
FILE: src/runlevel.c
function main (line 30) | int main(argc, argv)
FILE: src/runlevellog.c
function Write_Runlevel_Log (line 31) | int Write_Runlevel_Log(int new_runlevel)
function Read_Runlevel_Log (line 54) | int Read_Runlevel_Log(int *runlevel)
FILE: src/shutdown.c
function hardsleep (line 106) | void hardsleep(int secs)
function stopit (line 123) | void stopit(int sig)
function usage (line 138) | void usage(void)
function alrm_handler (line 162) | void alrm_handler(int sig)
function init_setenv (line 171) | int init_setenv(char *name, char *value)
function issue_warn (line 235) | void issue_warn(int mins)
function donologin (line 258) | void donologin(int min)
function spawn (line 279) | int spawn(int noerr, char *prog, ...)
function fastdown (line 326) | void fastdown()
function issue_shutdown (line 426) | void issue_shutdown(char *halttype)
function needwarning (line 479) | static int needwarning(int wt, int quiet_mode)
function main (line 512) | int main(int argc, char **argv)
FILE: src/sulogin.c
function tcinit (line 109) | static
function tcfinal (line 235) | static
function alrm_handler (line 313) | void alrm_handler(int sig)
function chld_handler (line 327) | void chld_handler(int sig)
function valid (line 338) | static
function set (line 406) | static
type passwd (line 416) | struct passwd
type passwd (line 418) | struct passwd
type passwd (line 419) | struct passwd
type spwd (line 420) | struct spwd
function doprompt (line 517) | static
function setup (line 556) | static
type console (line 611) | struct console
type sigaction (line 614) | struct sigaction
type chardata (line 615) | struct chardata
type termios (line 616) | struct termios
function sushell (line 720) | static
function putmounts (line 807) | static __attribute__((__noinline__))
function getmounts (line 816) | static __attribute__((__constructor__))
function usage (line 839) | static
function main (line 845) | int main(int argc, char **argv)
FILE: src/utmp.c
function write_wtmp (line 60) | void write_wtmp(
function write_utmp (line 151) | static void write_utmp(
function write_utmp_wtmp (line 248) | void write_utmp_wtmp(
FILE: src/utmpdump.c
function oldtonew (line 41) | struct utmp
function newtoold (line 59) | struct oldutmp
function time_t (line 90) | time_t
function xcleanse (line 110) | void
function unspace (line 118) | void
function print_utline (line 128) | void
function dump (line 159) | void
function gettok (line 181) | int
type utmp (line 219) | struct utmp
type oldutmp (line 220) | struct oldutmp
function usage (line 255) | void
function main (line 262) | int main(int argc, char **argv)
FILE: src/wall.c
function main (line 40) | int main(int argc, char **argv)
Condensed preview — 82 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (1,933K chars).
[
{
"path": ".gitignore",
"chars": 12,
"preview": "*.o\n*.tar.*\n"
},
{
"path": "COPYING",
"chars": 17987,
"preview": "\t\t GNU GENERAL PUBLIC LICENSE\n\t\t Version 2, June 1991\n\n Copyright (C) 1989, 1991 Free Software Foundation, Inc."
},
{
"path": "COPYRIGHT",
"chars": 1001,
"preview": "Sysvinit is Copyright (C) 1991-2004 Miquel van Smoorenburg\n Updated Copyright (C) 2018 Jesse Smith\n\n This program "
},
{
"path": "Makefile",
"chars": 1557,
"preview": "PACKAGE=sysvinit\nVERSION=$(shell sed -rn '1s/.*[[:blank:]]\\((.*)\\)[[:blank:]].*/\\1/p' doc/Changelog)\n\nall install clean "
},
{
"path": "README",
"chars": 1619,
"preview": "# README for SysV init\n\n## Please note this project has migrated to CodeBerg: https://codeberg.org/thejessesmith/sysvini"
},
{
"path": "contrib/alexander.viro",
"chars": 897,
"preview": "I proposed moving some stuff to a separate file, such as the\nre-exec routines. Alexander wrote:\n\n\nAccording to Alexander"
},
{
"path": "contrib/migrate-svn-git",
"chars": 848,
"preview": "#!/bin/sh\n#\n# Script to migrate sysvinit project source code from subversion to git.\n# Used february 2018.\n\nauthorsmap=$"
},
{
"path": "contrib/notify-pam-dead.patch",
"chars": 5893,
"preview": "Index: src/init.sample\n===================================================================\n--- src/init.sample\t(revision"
},
{
"path": "contrib/sysd2v.sh",
"chars": 15393,
"preview": "#!/bin/sh\n# sysd2v v0.3 -- systemd unit to sysvinit script converter\n# Copyright (C) 2019 Trek http://www.trek.eu.org"
},
{
"path": "contrib/zefram-patches",
"chars": 6480,
"preview": "Date: Mon, 14 Apr 1997 15:39:08 +0100 (BST)\nFrom: Zefram <zefram@dcs.warwick.ac.uk>\nMessage-Id: <25042.199704141439@ston"
},
{
"path": "doc/Changelog",
"chars": 64116,
"preview": "sysvinit (3.15) released; urgency=low\n\n * Patched manual page for runlevel command. This cleans up formatting and whi"
},
{
"path": "doc/Install",
"chars": 2860,
"preview": "\nInstall instructions for the System V style init\n\ninit, shutdown, halt, reboot, wall, last, mesg, runlevel,\nkillall5, p"
},
{
"path": "doc/Propaganda",
"chars": 3276,
"preview": "\n\n\tPropaganda for version 2.89 of sysvinit & utilities\n\t==================================================\n\nNOTE: If you"
},
{
"path": "doc/bootlogd.README",
"chars": 714,
"preview": "\nbootlogd: a way to capture all console output during bootup\n in a logfile.\n\n- bootlogd opens /dev/console and "
},
{
"path": "doc/initctl",
"chars": 4241,
"preview": "This document describes the communiction pipe set up by SysV init\nat /run/initctl. This named pipe allows programs with "
},
{
"path": "doc/initscript.sample",
"chars": 706,
"preview": "#\n# initscript\tIf this script is intalled as /etc/initscript,\n#\t\tit is executed by init(8) for every program it\n#\t\twants"
},
{
"path": "man/Makefile",
"chars": 860,
"preview": "MANPAGES=bootlogd.8 fstab-decode.8 halt.8 init.8 initctl.5 initscript.5 inittab.5 \\\nkillall5.8 last.1 lastb.1 logsave.8 "
},
{
"path": "man/bootlogd.8",
"chars": 3414,
"preview": "'\\\" -*- coding: UTF-8 -*-\n.\\\" Copyright (C) 1998-2003 Miquel van Smoorenburg.\n.\\\"\n.\\\" This program is free software; you"
},
{
"path": "man/fstab-decode.8",
"chars": 2452,
"preview": "'\\\" -*- coding: UTF-8 -*-\n.\\\" A man page for fstab-decode(8).\n.\\\"\n.\\\" Copyright (C) 2006 Red Hat, Inc. All rights reserv"
},
{
"path": "man/halt.8",
"chars": 4595,
"preview": "'\\\" -*- coding: UTF-8 -*-\n.\\\" Copyright (C) 1998-2001 Miquel van Smoorenburg.\n.\\\"\n.\\\" This program is free software; you"
},
{
"path": "man/init.8",
"chars": 13694,
"preview": "'\\\" -*- coding: UTF-8 -*-\n.\\\" Copyright (C) 1998-2004 Miquel van Smoorenburg.\n.\\\"\n.\\\" This program is free software; you"
},
{
"path": "man/initctl.5",
"chars": 6475,
"preview": "'\\\" -*- coding: UTF-8 -*-\n.\\\" Copyright (C) 2018 Jesse Smith\n.\\\"\n.\\\" This program is free software; you can redistribute"
},
{
"path": "man/initscript.5",
"chars": 2427,
"preview": "'\\\" -*- coding: UTF-8 -*-\n.\\\" Copyright (C) 1998-2003 Miquel van Smoorenburg.\n.\\\"\n.\\\" This program is free software; you"
},
{
"path": "man/inittab.5",
"chars": 9264,
"preview": "'\\\" -*- coding: UTF-8 -*-\n.\\\" Copyright (C) 1998-2001 Miquel van Smoorenburg.\n.\\\"\n.\\\" This program is free software; you"
},
{
"path": "man/killall5.8",
"chars": 1926,
"preview": "'\\\" -*- coding: UTF-8 -*-\n.\\\" Copyright (C) 1998-2003 Miquel van Smoorenburg.\n.\\\"\n.\\\" This program is free software; you"
},
{
"path": "man/last.1",
"chars": 4396,
"preview": "'\\\" -*- coding: UTF-8 -*-\n.\\\" Copyright (C) 1998-2004 Miquel van Smoorenburg.\n.\\\"\n.\\\" This program is free software; you"
},
{
"path": "man/lastb.1",
"chars": 16,
"preview": ".so man1/last.1\n"
},
{
"path": "man/logsave.8",
"chars": 1622,
"preview": ".\\\" -*- nroff -*-\n.\\\" Copyright 2003 by Theodore Ts'o. All Rights Reserved.\n.\\\" This file may be copied under the terms"
},
{
"path": "man/mesg.1",
"chars": 1880,
"preview": "'\\\" -*- coding: UTF-8 -*-\n.\\\" Copyright (C) 1998-2001 Miquel van Smoorenburg.\n.\\\"\n.\\\" This program is free software; you"
},
{
"path": "man/mountpoint.1",
"chars": 2869,
"preview": "'\\\" -*- coding: UTF-8 -*-\n.\\\" Copyright (C) 1998-2004 Miquel van Smoorenburg.\n.\\\"\n.\\\" This program is free software; you"
},
{
"path": "man/pidof.8",
"chars": 4361,
"preview": "'\\\" -*- coding: UTF-8 -*-\n.\\\" Copyright (C) 1998 Miquel van Smoorenburg.\n.\\\"\n.\\\" This program is free software; you can "
},
{
"path": "man/po/de.po",
"chars": 198076,
"preview": "# German translation of the sysvinit man pages.\n# Martin Okrslar <okrslar@informatik.uni-muenchen.de>, 2000.\n# Martin Sc"
},
{
"path": "man/po/es.po",
"chars": 144239,
"preview": "# Spanish translation of the sysvinit man pages.\n# Pedro Pablo Fábrega <pfabrega@arrakis.es>, 1998-1999.\n# Fidel García "
},
{
"path": "man/po/fi.po",
"chars": 104289,
"preview": "# Finnish translation of the sysvinit man pages.\n# Juha-Pekka Syrjälä <jsyrjala@iki.fi>, 1998.\n# Sami Kuhmonen <sami@iqs"
},
{
"path": "man/po/fr.po",
"chars": 199249,
"preview": "# French translation of the sysvinit man pages.\n# carmie\n# Michel Quercia <quercia AT cal DOT enst DOT fr>, 1997.\n# Thie"
},
{
"path": "man/po/hu.po",
"chars": 117486,
"preview": "# Hungarian translation of the sysvinit man pages.\n# Fehér -Aries- János <aries@vlug.vein.hu>, 2001.\n# Hermann Benedek <"
},
{
"path": "man/po/id.po",
"chars": 100601,
"preview": "# Indonesian translation of the sysvinit man pages\n# I Made Wiryana <mwiryana@gunadarma.ac.id>, 1999.\nmsgid \"\"\nmsgstr \"\""
},
{
"path": "man/po/pl.po",
"chars": 168260,
"preview": "# Polish translation of the sysvinit man pages.\n# Marcin Garski <mgarski@post.pl>, 1997.\n# Paweł Wilk <siefca@pl.qmail.o"
},
{
"path": "man/po/po4a.cfg",
"chars": 1010,
"preview": "[po_directory] ./\n\n[type:man] ../bootlogd.8 $lang:$lang/bootlogd.8\n[type:man] ../fstab-decode.8 $lang:$lang/fstab-"
},
{
"path": "man/po/pt.po",
"chars": 157784,
"preview": "# Translation of sysvinit MANPAGE to European Portuguese\n#\n# Copyright (C) 2022 Free Software Foundation, Inc.\n# This fi"
},
{
"path": "man/po/sysvinit-man.pot",
"chars": 94552,
"preview": "# SOME DESCRIPTIVE TITLE\n# Copyright (C) YEAR Free Software Foundation, Inc.\n# This file is distributed under the same l"
},
{
"path": "man/poweroff.8",
"chars": 16,
"preview": ".so man8/halt.8\n"
},
{
"path": "man/readbootlog.1",
"chars": 1774,
"preview": "'\\\" -*- coding: UTF-8 -*-\n.\\\" Copyright (C) 1998-2004 Miquel van Smoorenburg.\n.\\\"\n.\\\" This program is free software; you"
},
{
"path": "man/reboot.8",
"chars": 16,
"preview": ".so man8/halt.8\n"
},
{
"path": "man/runlevel.8",
"chars": 1921,
"preview": "'\\\" -*- coding: UTF-8 -*-\n.\\\" Copyright (C) 1997 Miquel van Smoorenburg.\n.\\\"\n.\\\" This program is free software; you can "
},
{
"path": "man/shutdown.8",
"chars": 9977,
"preview": "'\\\" -*- coding: UTF-8 -*-\n.\\\" Copyright (C) 1998-2003 Miquel van Smoorenburg.\n.\\\"\n.\\\" This program is free software; you"
},
{
"path": "man/sulogin.8",
"chars": 3371,
"preview": "'\\\" -*- coding: UTF-8 -*-\n.\\\" Copyright (C) 1998-2006 Miquel van Smoorenburg.\n.\\\"\n.\\\" This program is free software; you"
},
{
"path": "man/telinit.8",
"chars": 16,
"preview": ".so man8/init.8\n"
},
{
"path": "man/utmpdump.1",
"chars": 1936,
"preview": "'\\\" -*- coding: UTF-8 -*-\n.\\\" Copyright (C) 2010 Michael Krapp\n.\\\"\n.\\\" This program is free software; you can redistribu"
},
{
"path": "man/wall.1",
"chars": 1967,
"preview": "'\\\" -*- coding: UTF-8 -*-\n.\\\" Copyright (C) 1998-2003 Miquel van Smoorenburg.\n.\\\"\n.\\\" This program is free software; you"
},
{
"path": "src/.gitignore",
"chars": 111,
"preview": "bootlogd\nfstab-decode\nhalt\ninit\nkillall5\nlast\nlogsave\nmesg\nreadbootlog\nrunlevel\nshutdown\nsulogin\nutmpdump\nwall\n"
},
{
"path": "src/Makefile",
"chars": 6834,
"preview": "#\n# Makefile\tMakefile for the systemV init suite.\n#\t\tTargets: all compiles everything\n#\t\t install inst"
},
{
"path": "src/bootlogd.c",
"chars": 18068,
"preview": "/*\n * bootlogd.c\tStore output from the console during bootup into a file.\n *\t\tThe file is usually located on the /var pa"
},
{
"path": "src/bootlogd.h",
"chars": 177,
"preview": "#ifndef LOGFILE\n#define LOGFILE \"/var/log/boot\"\n#endif\n\n#ifndef TRUE\n#define TRUE 1\n#endif\n\n#ifndef FALSE\n#define FALSE "
},
{
"path": "src/consoles.c",
"chars": 10347,
"preview": "/*\n * consoles.c\t Routines to detect the system consoles\n *\n * Copyright (c) 2011 SuSE LINUX Products GmbH, All right"
},
{
"path": "src/consoles.h",
"chars": 1376,
"preview": "/*\n * consoles.h\t Header file for routines to detect the system consoles\n *\n * Copyright (c) 2011 SuSE LINUX Products"
},
{
"path": "src/dowall.c",
"chars": 6083,
"preview": "/*\n * dowall.c\tWrite to all users on the system.\n *\n * Author:\tMiquel van Smoorenburg, miquels@cistron.nl\n * \n * Version"
},
{
"path": "src/fstab-decode.c",
"chars": 1919,
"preview": "/* fstab-decode(8).\n\nCopyright (c) 2006 Red Hat, Inc. All rights reserved.\n\nThis copyrighted material is made available "
},
{
"path": "src/halt.c",
"chars": 9244,
"preview": "/*\n * Halt\t\tStop the system running.\n *\t\tIt re-enables CTRL-ALT-DEL, so that a hard reboot can\n *\t\tbe done. If called as"
},
{
"path": "src/hddown.c",
"chars": 12896,
"preview": "/*\n * hddown.c\tFind all disks on the system and\n *\t\tshut them down.\n *\n * Copyright (C) 2003 Miquel van Smoorenburg.\n *\n"
},
{
"path": "src/ifdown.c",
"chars": 3547,
"preview": "/*\n * ifdown.c\tFind all network interfaces on the system and\n *\t\tshut them down.\n *\n * Copyright (C) 1998 Miquel van Smo"
},
{
"path": "src/init.c",
"chars": 73527,
"preview": "/*\n * Init\t\tA System-V Init Clone.\n *\n * Usage:\t/sbin/init\n *\t\t init [0123456SsQqAaBbCc]\n *\t\t telinit [0123456SsQqA"
},
{
"path": "src/init.h",
"chars": 4918,
"preview": "/*\n * init.h\tSeveral defines and declarations to be\n *\t\tincluded by all modules of the init program.\n *\n * Version:\t@(#)"
},
{
"path": "src/initreq.h",
"chars": 2446,
"preview": "/*\n * initreq.h\tInterface to talk to init through /run/initctl.\n *\n *\t\tCopyright (C) 1995-2004 Miquel van Smoorenburg\n *"
},
{
"path": "src/killall5.c",
"chars": 26775,
"preview": "/*\n * killall5.c\tKill all processes except processes that have the\n *\t\tsame session id, so that the shell that called us"
},
{
"path": "src/last.c",
"chars": 23293,
"preview": "/*\n * last.c\tRe-implementation of the 'last' command, this time\n *\t\tfor Linux. Yes I know there is BSD last, but I\n *\t\tj"
},
{
"path": "src/logsave.c",
"chars": 6297,
"preview": "/*\n * logsave.c --- A program which saves the output of a program until\n *\t/var/log is mounted.\n *\n * Copyright (C) 2003"
},
{
"path": "src/mesg.c",
"chars": 2890,
"preview": "/*\n * mesg.c\tThe \"mesg\" utility. Gives / restrict access to\n *\t\tyour terminal by others.\n *\n * Usage:\tmesg [y|n].\n *\t\tWi"
},
{
"path": "src/mountpoint.c",
"chars": 4850,
"preview": "/*\n * mountpoint\tSee if a directory is a mountpoint.\n *\n * Author:\tMiquel van Smoorenburg.\n *\n * Version:\t@(#)mountpoint"
},
{
"path": "src/oldutmp.h",
"chars": 1218,
"preview": "/*\n * oldutmp.h\tDefinition of the old libc5 utmp structure.\n *\n * Version:\t@(#)oldutmp.h 1.00 29-Mar-1998 miquels@cis"
},
{
"path": "src/paths.h",
"chars": 2525,
"preview": "/*\n * paths.h\tPaths of files that init and related utilities need.\n *\n * Version:\t@(#) paths.h 2.85-8 05-Nov-2003\n *\n * "
},
{
"path": "src/readbootlog.c",
"chars": 3745,
"preview": "#include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\n#include <unistd.h>\n#include \"bootlogd.h\"\n\n#ifndef MAX_LINE\n#"
},
{
"path": "src/reboot.h",
"chars": 1513,
"preview": "/*\n * reboot.h\tHeaderfile that defines how to handle\n *\t\tthe reboot() system call.\n *\n * Version:\t@(#)reboot.h 2.85-17 "
},
{
"path": "src/runlevel.c",
"chars": 1575,
"preview": "/*\n * runlevel\tPrints out the previous and the current runlevel.\n *\n * Version:\t@(#)runlevel 1.20 16-Apr-1997 MvS\n *\n"
},
{
"path": "src/runlevellog.c",
"chars": 1959,
"preview": "/*\n * runlevellog - Saves and restores runlevel from distor-neutral location.\n *\n *\n * This file is part o"
},
{
"path": "src/runlevellog.h",
"chars": 1217,
"preview": "/*\n * runlevellog - Saves and restores runlevel from distor-neutral location.\n *\n *\n * This file is part o"
},
{
"path": "src/set.h",
"chars": 1121,
"preview": "/*\n * set.h\tMacros that look like sigaddset et al. but\n *\t\taren't. They are used to manipulate bits in\n *\t\tan integer, t"
},
{
"path": "src/shutdown.c",
"chars": 20849,
"preview": "/*\n * shutdown.c\tShut the system down.\n *\n * Usage:\tshutdown [-krhfnc] time [warning message]\n *\t\t -k: don't really shu"
},
{
"path": "src/sulogin.c",
"chars": 22898,
"preview": "/*\n * sulogin\tThis program gives Linux machines a reasonable\n *\t\tsecure way to boot single user. It forces the\n *\t\tuser "
},
{
"path": "src/utmp.c",
"chars": 6962,
"preview": "/*\n * utmp.c\tRoutines to read/write the utmp and wtmp files.\n *\t\tBasically just wrappers around the library routines.\n *"
},
{
"path": "src/utmpdump.c",
"chars": 7241,
"preview": "/*\n * utmpdump\tSimple program to dump UTMP and WTMP files in\n *\t\traw format, so they can be examined.\n *\n * Author:\tMiqu"
},
{
"path": "src/wall.c",
"chars": 2826,
"preview": "/*\n * wall.c\tWrite to all users logged in.\n *\n * Usage:\twall [text]\n *\n * Version:\t@(#)wall 2.79 12-Sep-2000 miquels@"
}
]
About this extraction
This page contains the full source code of the slicer69/sysvinit GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 82 files (1.7 MB), approximately 573.4k tokens, and a symbol index with 218 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.