Commit 01530382 authored by Daniel Reurich's avatar Daniel Reurich

update changelog

parent 370cc574
sysvinit (2.88dsf-59+devuan1) unstable; urgency=medium
[ Andreas Henriksson ]
* Let mount (src:util-linux) provide mountpoint (Closes: #399608)
* Let util-linux provide sulogin, last, lastb, mesg (Closes: #784567)
[ Martin Pitt ]
* Fix circular dependency with util-linux
* Drop 91_sulogin_lockedpw.dpatch
* Fix Breaks: syntax
[ Andreas Henriksson ]
* Update dependency for /bin/mountpoint being moved to util-linux instead of mount. Use breaks instead of depends to avoid circular dependency.
[ Daniel Reurich ]
* Applied the above cherry-picks from debian
-- Daniel Reurich <daniel@centurion.net.nz> Mon, 25 May 2015 13:20:42 +0000
sysvinit (2.88dsf-58+devuan1) unstable; urgency=medium
* debian/* systemd extirpation.
......
......@@ -48,7 +48,7 @@ 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?):
o All communication to init goes through the FIFO /dev/initctl.
o 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.
......
......@@ -26,7 +26,7 @@ fstab-decode \- run a command with fstab-encoded arguments
.SH DESCRIPTION
.B fstab-decode
decodes escapes in the specified \FIARGUMENT\fRs
decodes escapes in the specified \fIARGUMENT\fRs
and uses them to run \fICOMMAND\fR.
The argument escaping uses the same rules as path escaping in
\fB/etc/fstab\fR,
......
......@@ -51,7 +51,7 @@ halt, reboot, poweroff \- stop the system.
.\"}}}
.\"{{{ Description
.SH DESCRIPTION
\fBHalt\fP notes that the system is being brought down in the file
\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
......@@ -68,12 +68,12 @@ and 6, that is when the systems shutdown scripts are being run.
.SH OPTIONS
.IP \fB\-n\fP
Don't sync before reboot or halt. Note that the kernel and storage
drivers may still sync.
drivers may still sync. This implies \fB\-d\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).
.IP \fB\-d\fP
Don't write the wtmp record. The \fB\-n\fP flag implies \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\-i\fP
......
......@@ -56,21 +56,34 @@ A \fIrunlevel\fP is a software configuration of the system which allows
only a selected group of processes to exist. The processes spawned by
\fBinit\fP for each of these runlevels are defined in the
\fB/etc/inittab\fP file. \fBInit\fP can be in one of eight runlevels:
\fB0\(en6\fP and \fBS\fP or \fBs\fP. The runlevel is
\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 \fB0\fP, \fB1\fP, and \fB6\fP are reserved. Runlevel 0 is used to
halt the system, runlevel 6 is used to reboot the system, and runlevel
1 is used to get the system down into single user mode. Runlevel \fBS\fP
is not really meant to be used directly, but more for the scripts that are
executed when entering runlevel 1. For more information on this,
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-9 are also valid, though not really documented. This is
because "traditional" Unix variants don't use them.
In case you're curious, runlevels \fIS\fP and \fIs\fP are in fact the same.
.PP
Runlevels \fIS\fP and \fIs\fP are the same.
Internally they are aliases for the same runlevel.
.\"}}}
.PP
......@@ -82,9 +95,10 @@ determines the initial runlevel of the system. If there is no such
entry (or no \fB/etc/inittab\fP at all), a runlevel must be
entered at the system console.
.PP
Runlevel \fBS\fP or \fBs\fP bring the system to single user mode
and do not require an \fB/etc/inittab\fP file. In single user mode,
\fB/sbin/sulogin\fP is invoked on \fB/dev/console\fP.
Runlevel \fBS\fP or \fBs\fP initialize the system
and do not require an \fB/etc/inittab\fP file.
.PP
In single user mode, \fB/sbin/sulogin\fP is invoked on \fB/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
......@@ -130,7 +144,7 @@ letters \fBF\fP, \fBO\fP or \fBL\fP, init will behave as if it has read
the letter \fBF\fP.
.PP
Usage of \fBSIGPWR\fP and \fB/etc/powerstatus\fP is discouraged. Someone
wanting to interact with \fBinit\fP should use the \fB/dev/initctl\fP
wanting to interact with \fBinit\fP should use the \fB/run/initctl\fP
control channel - see the source code of the \fBsysvinit\fP package
for more documentation about this.
.PP
......@@ -234,7 +248,7 @@ can then manipulate the command line so that \fBps\fP(1) shows
the current runlevel.
.PP
.SH INTERFACE
Init listens on a \fIfifo\fP in /dev, \fI/dev/initctl\fP, for messages.
Init listens on a \fIfifo\fP in /run, \fI/run/initctl\fP, for messages.
\fBTelinit\fP uses this to communicate with init. 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
......@@ -248,7 +262,7 @@ Has the same effect as \fBtelinit q\fP.
.TP 0.5i
.B SIGUSR1
On receipt of this signals, init closes and re-opens its control fifo,
\fB/dev/initctl\fP. Useful for bootscripts when /dev is remounted.
\fB/run/initctl\fP.
.TP 0.5i
.B SIGINT
Normally the kernel sends this signal to init when CTRL-ALT-DEL is
......@@ -273,7 +287,7 @@ file in the directory \fI/etc/init.d\fP explaining how these scripts work.
/dev/console
/var/run/utmp
/var/log/wtmp
/dev/initctl
/run/initctl
.fi
.\"}}}
.\"{{{ Warnings
......@@ -283,6 +297,14 @@ 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
......
......@@ -66,7 +66,7 @@ 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.
a historic bug. The length of this field is limited to 127 characters.
.\"}}}
.PP
The \fIrunlevels\fP field may contain multiple characters for different
......
......@@ -119,7 +119,7 @@ Second, it can be in the format \fB+\fP\fIm\fP, in which \fIm\fP is the
number of minutes to wait. The word \fBnow\fP is an alias for \fB+0\fP.
.PP
If shutdown is called with a delay, it will create the advisory file
.I /etc/nologin
.I /run/nologin
which causes programs such as \fIlogin(1)\fP to not allow new user
logins. This file is created five minutes before the shutdown sequence
starts. Shutdown removes this file if it is stopped before it
......
......@@ -11,6 +11,7 @@
CPPFLAGS =
CFLAGS ?= -ansi -O2 -fomit-frame-pointer
override CFLAGS += -W -Wall -D_GNU_SOURCE
override CFLAGS += $(shell getconf LFS_CFLAGS)
STATIC =
# For some known distributions we do not build all programs, otherwise we do.
......@@ -77,10 +78,15 @@ else
SULOGINLIBS =
endif
LIBDIR=/usr/lib
# Additional libs for GNU libc.
ifneq ($(wildcard /usr/lib*/libcrypt.a),)
SULOGINLIBS += -lcrypt
else
ifneq ($(wildcard $(LIBDIR)*/libcrypt.a),)
SULOGINLIBS += -lcrypt
endif
endif
all: $(BIN) $(SBIN) $(USRBIN)
......@@ -176,8 +182,8 @@ ifeq ($(ROOT),)
#
# This part is skipped on Debian systems, the
# debian.preinst script takes care of it.
@if [ ! -p /dev/initctl ]; then \
echo "Creating /dev/initctl"; \
rm -f /dev/initctl; \
mknod -m 600 /dev/initctl p; fi
@if [ ! -p /run/initctl ]; then \
echo "Creating /run/initctl"; \
rm -f /run/initctl; \
mknod -m 600 /run/initctl p; fi
endif
......@@ -57,6 +57,7 @@
char *Version = "@(#) bootlogd 2.86 03-Jun-2004 miquels@cistron.nl";
#define LOGFILE "/var/log/boot"
#define MAX_CONSOLES 16
char ringbuf[32768];
char *endptr = ringbuf + sizeof(ringbuf);
......@@ -73,6 +74,11 @@ struct line {
int pos;
} line;
struct real_cons {
char name[1024];
int fd;
};
/*
* Console devices as listed on the kernel command line and
* the mapping to actual devices in /dev
......@@ -235,10 +241,10 @@ int isconsole(char *s, char *res, int rlen)
}
/*
* Find out the _real_ console. Assume that stdin is connected to
* Find out the _real_ console(s). Assume that stdin is connected to
* the console device (/dev/console).
*/
int consolename(char *res, int rlen)
int consolenames(struct real_cons *cons, int max_consoles)
{
#ifdef TIOCGDEV
unsigned int kdev;
......@@ -247,34 +253,9 @@ int consolename(char *res, int rlen)
char buf[256];
char *p;
int didmount = 0;
int n, r;
int n;
int fd;
fstat(0, &st);
if (major(st.st_rdev) != 5 || minor(st.st_rdev) != 1) {
/*
* Old kernel, can find real device easily.
*/
int r = findtty(res, "/dev", rlen, st.st_rdev);
if (0 != r)
fprintf(stderr, "bootlogd: cannot find console device "
"%d:%d under /dev\n", major(st.st_rdev), minor(st.st_rdev));
return r;
}
#ifdef TIOCGDEV
# ifndef ENOIOCTLCMD
# define ENOIOCTLCMD 515
# endif
if (ioctl(0, TIOCGDEV, &kdev) == 0) {
int r = findtty(res, "/dev", rlen, (dev_t)kdev);
if (0 != r)
fprintf(stderr, "bootlogd: cannot find console device "
"%d:%d under /dev\n", major(kdev), minor(kdev));
return r;
}
if (errno != ENOIOCTLCMD) return -1;
#endif
int considx, num_consoles = 0;
#ifdef __linux__
/*
......@@ -283,7 +264,7 @@ int consolename(char *res, int rlen)
stat("/", &st);
if (stat("/proc", &st2) < 0) {
perror("bootlogd: /proc");
return -1;
return 0;
}
if (st.st_dev == st2.st_dev) {
if (mount("proc", "/proc", "proc", 0, NULL) < 0) {
......@@ -293,21 +274,21 @@ int consolename(char *res, int rlen)
didmount = 1;
}
n = 0;
r = -1;
n = -1;
if ((fd = open("/proc/cmdline", O_RDONLY)) < 0) {
perror("bootlogd: /proc/cmdline");
} else {
buf[0] = 0;
if ((n = read(fd, buf, sizeof(buf) - 1)) >= 0)
r = 0;
else
if ((n = read(fd, buf, sizeof(buf) - 1)) < 0)
perror("bootlogd: /proc/cmdline");
close(fd);
}
if (didmount) umount("/proc");
if (n < 0) return 0;
if (r < 0) return r;
/*
* OK, so find console= in /proc/cmdline.
......@@ -315,21 +296,32 @@ int consolename(char *res, int rlen)
*/
p = buf + n;
*p-- = 0;
r = -1;
while (p >= buf) {
if (*p == ' ' || *p == '\t' || *p == '\r' || *p == '\n') {
*p-- = 0;
continue;
}
if (strncmp(p, "console=", 8) == 0 &&
isconsole(p + 8, res, rlen)) {
r = 0;
break;
isconsole(p + 8, cons[num_consoles].name, sizeof(cons[num_consoles].name))) {
/*
* Suppress duplicates
*/
for (considx = 0; considx < num_consoles; considx++) {
if (!strcmp(cons[num_consoles].name, cons[considx].name)) {
goto dontuse;
}
}
num_consoles++;
if (num_consoles >= max_consoles) {
break;
}
}
dontuse:
p--;
}
if (r == 0) return r;
if (num_consoles > 0) return num_consoles;
#endif
/*
......@@ -337,12 +329,12 @@ int consolename(char *res, int rlen)
* guess the default console.
*/
for (n = 0; defcons[n]; n++)
if (isconsole(defcons[n], res, rlen))
return 0;
if (isconsole(defcons[n], cons[0].name, sizeof(cons[0].name)))
return 1;
fprintf(stderr, "bootlogd: cannot deduce real console device\n");
return -1;
return 0;
}
......@@ -472,7 +464,6 @@ int main(int argc, char **argv)
struct timeval tv;
fd_set fds;
char buf[1024];
char realcons[1024];
char *p;
char *logfile;
char *pidfile;
......@@ -482,6 +473,12 @@ int main(int argc, char **argv)
int realfd;
int n, m, i;
int todo;
#ifndef __linux__ /* BSD-style ioctl needs an argument. */
int on = 1;
#endif
int considx;
struct real_cons cons[MAX_CONSOLES];
int num_consoles, consoles_left;
fp = NULL;
logfile = LOGFILE;
......@@ -528,18 +525,22 @@ int main(int argc, char **argv)
/*
* Open console device directly.
*/
if (consolename(realcons, sizeof(realcons)) < 0)
return 1;
if (strcmp(realcons, "/dev/tty0") == 0)
strcpy(realcons, "/dev/tty1");
if (strcmp(realcons, "/dev/vc/0") == 0)
strcpy(realcons, "/dev/vc/1");
if ((realfd = open_nb(realcons)) < 0) {
fprintf(stderr, "bootlogd: %s: %s\n", buf, strerror(errno));
if ((num_consoles = consolenames(cons, MAX_CONSOLES)) <= 0)
return 1;
consoles_left = num_consoles;
for (considx = 0; considx < num_consoles; considx++) {
if (strcmp(cons[considx].name, "/dev/tty0") == 0)
strcpy(cons[considx].name, "/dev/tty1");
if (strcmp(cons[considx].name, "/dev/vc/0") == 0)
strcpy(cons[considx].name, "/dev/vc/1");
if ((cons[considx].fd = open_nb(cons[considx].name)) < 0) {
fprintf(stderr, "bootlogd: %s: %s\n", cons[considx].name, strerror(errno));
consoles_left--;
}
}
if (!consoles_left)
return 1;
/*
* Grab a pty, and redirect console messages to it.
......@@ -554,15 +555,20 @@ int main(int argc, char **argv)
return 1;
}
#ifdef __linux__
(void)ioctl(0, TIOCCONS, NULL);
#if 1
/* Work around bug in 2.1/2.2 kernels. Fixed in 2.2.13 and 2.3.18 */
if ((n = open("/dev/tty0", O_RDWR)) >= 0) {
(void)ioctl(n, TIOCCONS, NULL);
close(n);
}
#endif
if (ioctl(pts, TIOCCONS, NULL) < 0) {
#ifdef __linux__
if (ioctl(pts, TIOCCONS, NULL) < 0)
#else /* BSD usage of ioctl TIOCCONS. */
if (ioctl(pts, TIOCCONS, &on) < 0)
#endif
{
fprintf(stderr, "bootlogd: ioctl(%s, TIOCCONS): %s\n",
buf, strerror(errno));
return 1;
......@@ -618,26 +624,34 @@ int main(int argc, char **argv)
if ((n = read(ptm, inptr, endptr - inptr)) >= 0) {
/*
* Write data (in chunks if needed)
* to the real output device.
* to the real output devices.
*/
m = n;
p = inptr;
while (m > 0) {
i = write(realfd, p, m);
if (i >= 0) {
m -= i;
p += i;
continue;
}
/*
* Handle EIO (somebody hung
* up our filedescriptor)
*/
realfd = write_err(pts, realfd,
realcons, errno);
if (realfd >= 0) continue;
got_signal = 1; /* Not really */
break;
for (considx = 0; considx < num_consoles; considx++) {
if (cons[considx].fd < 0) continue;
m = n;
p = inptr;
while (m > 0) {
i = write(cons[considx].fd, p, m);
if (i >= 0) {
m -= i;
p += i;
continue;
}
/*
* Handle EIO (somebody hung
* up our filedescriptor)
*/
cons[considx].fd = write_err(pts,
cons[considx].fd,
cons[considx].name, errno);
if (cons[considx].fd >= 0) continue;
/*
* If this was the last console,
* generate a fake signal
*/
if (--consoles_left <= 0) got_signal = 1;
break;
}
}
/*
......@@ -683,7 +697,9 @@ int main(int argc, char **argv)
close(pts);
close(ptm);
close(realfd);
for (considx = 0; considx < num_consoles; considx++) {
close(cons[considx].fd);
}
return 0;
}
......
......@@ -37,6 +37,23 @@ char *v_ifdown = "@(#)ifdown.c 1.11 02-Jun-1998 miquels@cistron.nl";
#define MAX_IFS 64
/* XXX: Ideally this would get detected at configure time... */
#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || \
defined(__NetBSD__) || defined(__OpenBSD__)
#define HAVE_SOCKADDR_SA_LEN 1
#endif
#ifndef _SIZEOF_ADDR_IFREQ
#ifdef HAVE_SOCKADDR_SA_LEN
#define _SIZEOF_ADDR_IFREQ(ifr) \
((ifr).ifr_addr.sa_len > sizeof(struct sockaddr) ? \
(sizeof((ifr).ifr_name) + (ifr).ifr_addr.sa_len) : \
sizeof(struct ifreq))
#else
#define _SIZEOF_ADDR_IFREQ(ifr) sizeof(struct ifreq)
#endif
#endif
/*
* First, we find all shaper devices and down them. Then we
* down all real interfaces. This is because the comment in the
......@@ -45,10 +62,10 @@ char *v_ifdown = "@(#)ifdown.c 1.11 02-Jun-1998 miquels@cistron.nl";
*/
int ifdown(void)
{
struct ifreq ifr[MAX_IFS];
char ifr_buf[sizeof(struct ifreq) * MAX_IFS];
char *ifr_end;
struct ifconf ifc;
int i, fd;
int numif;
int fd;
int shaper;
if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) {
......@@ -56,8 +73,8 @@ int ifdown(void)
perror("socket");
return -1;
}
ifc.ifc_len = sizeof(ifr);
ifc.ifc_req = ifr;
ifc.ifc_len = sizeof(ifr_buf);
ifc.ifc_buf = ifr_buf;
if (ioctl(fd, SIOCGIFCONF, &ifc) < 0) {
fprintf(stderr, "ifdown: ");
......@@ -65,42 +82,55 @@ int ifdown(void)
close(fd);
return -1;
}
numif = ifc.ifc_len / sizeof(struct ifreq);
ifr_end = ifr_buf + ifc.ifc_len;
for (shaper = 1; shaper >= 0; shaper--) {
for (i = 0; i < numif; i++) {
char *ifr_next = ifr_buf;
while (ifr_next < ifr_end) {
struct ifreq *ifr;
int flags;
if ((strncmp(ifr[i].ifr_name, "shaper", 6) == 0)
ifr = (struct ifreq *)ifr_next;
ifr_next += _SIZEOF_ADDR_IFREQ(*ifr);
if ((strncmp(ifr->ifr_name, "shaper", 6) == 0)
!= shaper) continue;
if (strcmp(ifr[i].ifr_name, "lo") == 0)
if (strncmp(ifr->ifr_name, "lo", 2) == 0)
continue;
if (strchr(ifr[i].ifr_name, ':') != NULL)
if (strchr(ifr->ifr_name, ':') != NULL)
continue;
/* Read interface flags */
if (ioctl(fd, SIOCGIFFLAGS, &ifr[i]) < 0) {
if (ioctl(fd, SIOCGIFFLAGS, ifr) < 0) {
fprintf(stderr, "ifdown: shutdown ");
perror(ifr[i].ifr_name);
perror(ifr->ifr_name);
continue;
}
/*
* Expected in <net/if.h> according to
* "UNIX Network Programming".
*/
#ifdef ifr_flags
# define IRFFLAGS ifr_flags
#else /* Present on kFreeBSD */
# define IRFFLAGS ifr_flagshigh
#ifdef ifr_flagshigh
flags = (ifr->ifr_flags & 0xffff) |
(ifr->ifr_flagshigh << 16);
#else
flags = ifr->ifr_flags;
#endif
if (flags & IFF_UP) {
flags &= ~(IFF_UP);
#ifdef ifr_flagshigh
ifr->ifr_flags = flags & 0xffff;
ifr->ifr_flagshigh = flags >> 16;
#else
ifr->ifr_flags = flags;
#endif
if (ifr[i].IRFFLAGS & IFF_UP) {
ifr[i].IRFFLAGS &= ~(IFF_UP);
if (ioctl(fd, SIOCSIFFLAGS, &ifr[i]) < 0) {
if (ioctl(fd, SIOCSIFFLAGS, ifr) < 0) {
fprintf(stderr, "ifdown: shutdown ");
perror(ifr[i].ifr_name);
perror(ifr->ifr_name);
}
}
#undef IRFFLAGS
}
}
close(fd);
......
......@@ -54,10 +54,6 @@
#ifdef WITH_SELINUX
# include <selinux/selinux.h>
# include <sys/mount.h>
# ifndef MNT_DETACH /* present in glibc 2.10, missing in 2.7 */
# define MNT_DETACH 2
# endif
#endif
#ifdef __i386__
......@@ -133,7 +129,7 @@ char *argv0; /* First arguments; show up in ps listing */
int maxproclen; /* Maximal length of argv[0] with \0 */
struct utmp utproto; /* Only used for sizeof(utproto.ut_id) */
char *console_dev; /* Console device. */
int pipe_fd = -1; /* /dev/initctl */
int pipe_fd = -1; /* /run/initctl */
int did_boot = 0; /* Did we already do BOOT* stuff? */
int main(int, char **);
......@@ -751,11 +747,11 @@ void console_stty(void)
#ifdef __FreeBSD_kernel__
/*
* The kernel of FreeBSD expects userland to set TERM. Usually, we want
* "cons25". Later, gettys might disagree on this (i.e. we're not using
* "xterm". Later, gettys might disagree on this (i.e. we're not using
* syscons) but some boot scripts, like /etc/init.d/xserver-xorg, still
* need a non-dumb terminal.
*/
putenv ("TERM=cons25");
putenv ("TERM=xterm");
#endif
(void) tcgetattr(fd, &tty);
......@@ -770,7 +766,9 @@ void console_stty(void)
tty.c_cc[VEOF] = CEOF;
tty.c_cc[VTIME] = 0;
tty.c_cc[VMIN] = 1;
#ifdef VSWTC /* not defined on FreeBSD */
tty.c_cc[VSWTC] = _POSIX_VDISABLE;
#endif /* VSWTC */
tty.c_cc[VSTART] = CSTART;
tty.c_cc[VSTOP] = CSTOP;
tty.c_cc[VSUSP] = CSUSP;
......@@ -784,10 +782,11 @@ void console_stty(void)
/*
* Set pre and post processing
*/
tty.c_iflag = IGNPAR|ICRNL|IXON|IXANY;
tty.c_iflag = IGNPAR|ICRNL|IXON|IXANY
#ifdef IUTF8 /* Not defined on FreeBSD */
tty.c_iflag |= IUTF8;
| (tty.c_iflag & IUTF8)
#endif /* IUTF8 */
;
tty.c_oflag = OPOST|ONLCR;
tty.c_lflag = ISIG|ICANON|ECHO|ECHOCTL|ECHOPRT|ECHOKE;
......@@ -1314,7 +1313,7 @@ void read_inittab(void)
if (rlevel && strlen(rlevel) > 11)
strcpy(err, "rlevel field too long (max 11 characters)");
if (process && strlen(process) > 127)
strcpy(err, "process field too long");
strcpy(err, "process field too long (max 127 characters)");
if (action && strlen(action) > 32)
strcpy(err, "action field too long");
if (err[0] != 0) {
......@@ -2175,13 +2174,13 @@ void check_init_fifo(void)
int quit = 0;
/*
* First, try to create /dev/initctl if not present.
* First, try to create /run/initctl if not present.
*/
if (stat(INIT_FIFO, &st2) < 0 && errno == ENOENT)
(void)mkfifo(INIT_FIFO, 0600);
/*
* If /dev/initctl is open, stat the file to see if it
* If /run/initctl is open, stat the file to see if it
* is still the _same_ inode.
*/
if (pipe_fd >= 0) {
......@@ -2195,7 +2194,7 @@ void check_init_fifo(void)
}
/*
* Now finally try to open /dev/initctl
* Now finally try to open /run/initctl
*/
if (pipe_fd < 0) {
if ((pipe_fd = open(INIT_FIFO, O_RDWR|O_NONBLOCK)) >= 0) {
......@@ -2501,7 +2500,7 @@ void process_signals()
}
if (ISMEMBER(got_signals, SIGUSR1)) {
/*
* SIGUSR1 means close and reopen /dev/initctl
* SIGUSR1 means close and reopen /run/initctl
*/
INITDBG(L_VB, "got SIGUSR1");
close(pipe_fd);
......@@ -2737,7 +2736,7 @@ int telinit(char *progname, int argc, char **argv)
chdir("/");
/* Open the fifo and write a command. */
/* Make sure we don't hang on opening /dev/initctl */
/* Make sure we don't hang on opening /run/initctl */
SETSIG(sa, SIGALRM, signal_handler, 0);
alarm(3);
if ((fd = open(INIT_FIFO, O_WRONLY)) >= 0) {
......@@ -2869,11 +2868,9 @@ int main(int argc, char **argv)