- under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
+ under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.
systemd 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
(at your option) any later version.
systemd 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
- /* Enable that we get SIGINT on control-alt-del */
- if (reboot(RB_DISABLE_CAD) < 0)
+ /* Enable that we get SIGINT on control-alt-del. In containers
+ * this will fail with EPERM, so ignore that. */
+ if (reboot(RB_DISABLE_CAD) < 0 && errno != EPERM)
- if ((fd = open_terminal("/dev/tty0", O_RDWR|O_NOCTTY|O_CLOEXEC)) < 0)
- log_warning("Failed to open /dev/tty0: %m");
- else {
+ fd = open_terminal("/dev/tty0", O_RDWR|O_NOCTTY|O_CLOEXEC);
+ if (fd < 0) {
+ /* Support systems without virtual console */
+ if (fd != -ENOENT)
+ log_warning("Failed to open /dev/tty0: %m");
+ } else {
/* Enable that we get SIGWINCH on kbrequest */
if (ioctl(fd, KDSIGACCEPT, SIGWINCH) < 0)
log_warning("Failed to enable kbrequest handling: %s", strerror(errno));
/* Enable that we get SIGWINCH on kbrequest */
if (ioctl(fd, KDSIGACCEPT, SIGWINCH) < 0)
log_warning("Failed to enable kbrequest handling: %s", strerror(errno));
n = epoll_wait(m->epoll_fd, &event, 1, wait_msec);
if (n < 0) {
n = epoll_wait(m->epoll_fd, &event, 1, wait_msec);
if (n < 0) {
}
if (audit_log_user_comm_message(m->audit_fd, type, "", p, NULL, NULL, NULL, success) < 0) {
}
if (audit_log_user_comm_message(m->audit_fd, type, "", p, NULL, NULL, NULL, success) < 0) {
- * Then let's not retry again, to avoid
- * spamming the user with the same and same
- * messages over and over. */
-
+ * Then let's not retry again. */
void manager_check_finished(Manager *m) {
char userspace[FORMAT_TIMESPAN_MAX], initrd[FORMAT_TIMESPAN_MAX], kernel[FORMAT_TIMESPAN_MAX], sum[FORMAT_TIMESPAN_MAX];
void manager_check_finished(Manager *m) {
char userspace[FORMAT_TIMESPAN_MAX], initrd[FORMAT_TIMESPAN_MAX], kernel[FORMAT_TIMESPAN_MAX], sum[FORMAT_TIMESPAN_MAX];
- usec_t kernel_usec = 0, initrd_usec = 0, userspace_usec = 0, total_usec = 0;
+ usec_t kernel_usec, initrd_usec, userspace_usec, total_usec;