summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTollef Fog Heen <tfheen@err.no>2011-01-14 22:04:37 +0100
committerTollef Fog Heen <tfheen@err.no>2011-01-14 22:04:37 +0100
commit0acc99ff21bb48f5fd54163bf716250df979c8a7 (patch)
treed078b0b18981886c2919c86d412f2748d0ae95ba
parentce258ceb473ceeef9f82d8f8723fe166767886e1 (diff)
parentc292c495fbf67c86a89685b879bd13d7d56b333c (diff)
downloadsystemd-0acc99ff21bb48f5fd54163bf716250df979c8a7.tar.gz
Merge commit 'v16'
-rw-r--r--Makefile.am57
-rw-r--r--README9
-rw-r--r--TODO90
-rw-r--r--configure.ac23
-rw-r--r--man/daemon.xml4
-rw-r--r--man/modules-load.d.xml4
-rw-r--r--man/os-release.xml2
-rw-r--r--man/pam_systemd.xml4
-rw-r--r--man/shutdown.xml2
-rw-r--r--man/systemctl.xml75
-rw-r--r--man/systemd.conf.xml6
-rw-r--r--man/systemd.exec.xml13
-rw-r--r--man/systemd.service.xml8
-rw-r--r--man/systemd.unit.xml6
-rw-r--r--man/tmpfiles.d.xml6
-rw-r--r--src/cryptsetup-generator.c8
-rw-r--r--src/device.c20
-rw-r--r--src/execute.c5
-rw-r--r--src/gnome-ask-password-agent.vala14
-rw-r--r--src/hostname-setup.c4
-rw-r--r--src/load-fragment.c32
-rw-r--r--src/locale-setup.c20
-rw-r--r--src/logger.c22
-rw-r--r--src/macro.h3
-rw-r--r--src/mount-setup.c8
-rw-r--r--src/pam-module.c2
-rw-r--r--src/path.c10
-rw-r--r--src/quotacheck.c2
-rw-r--r--src/readahead-collect.c4
-rw-r--r--src/readahead-replay.c11
-rw-r--r--src/service.c92
-rw-r--r--src/shutdown.c1
-rw-r--r--src/strv.c23
-rw-r--r--src/strv.h2
-rw-r--r--src/sysctl.c4
-rw-r--r--src/systemctl.c105
-rw-r--r--src/test-env-replace.c62
-rw-r--r--src/test-strv.c12
-rw-r--r--src/tmpfiles.c8
-rw-r--r--src/umount.c26
-rw-r--r--src/util.c81
-rw-r--r--src/util.h3
-rw-r--r--src/vconsole-setup.c13
-rw-r--r--systemd.pc.in4
-rw-r--r--units/getty@.service.m47
-rw-r--r--units/hwclock-load.service2
-rw-r--r--units/serial-getty@.service.m42
47 files changed, 744 insertions, 177 deletions
diff --git a/Makefile.am b/Makefile.am
index 471954bf68..91bcb0f0a4 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -76,12 +76,19 @@ AM_CPPFLAGS += \
-DKBD_SETFONT=\"/usr/bin/setfont\" \
-DDEFAULT_FONT=\"LatArCyrHeb-16\"
else
+if TARGET_FRUGALWARE
+AM_CPPFLAGS += \
+ -DKBD_LOADKEYS=\"/usr/bin/loadkeys\" \
+ -DKBD_SETFONT=\"/usr/bin/setfont\" \
+ -DDEFAULT_FONT=\"LatArCyrHeb-16\"
+else
AM_CPPFLAGS += \
-DKBD_LOADKEYS=\"/bin/loadkeys\" \
-DKBD_SETFONT=\"/bin/setfont\" \
-DDEFAULT_FONT=\"latarcyrheb-sun16\"
endif
endif
+endif
rootbin_PROGRAMS = \
systemd \
@@ -357,7 +364,8 @@ dist_polkitpolicy_DATA = \
noinst_LTLIBRARIES = \
libsystemd-basic.la \
- libsystemd-core.la
+ libsystemd-core.la \
+ libsystemd-daemon.la
libsystemd_basic_la_SOURCES = \
src/util.c \
@@ -443,6 +451,9 @@ libsystemd_core_la_LIBADD = \
$(PAM_LIBS) \
$(AUDIT_LIBS)
+libsystemd_daemon_la_SOURCES = \
+ src/sd-daemon.c
+
# This is needed because automake is buggy in how it generates the
# rules for C programs, but not Vala programs. We therefore can't
# list the .h files as dependencies if we want make dist to work.
@@ -450,6 +461,7 @@ libsystemd_core_la_LIBADD = \
EXTRA_DIST += \
${libsystemd_basic_la_SOURCES:.c=.h} \
${libsystemd_core_la_SOURCES:.c=.h} \
+ ${libsystemd_daemon_la_SOURCES:.c=.h} \
src/macro.h \
src/ioprio.h \
src/missing.h \
@@ -458,7 +470,6 @@ EXTRA_DIST += \
src/linux/auto_dev-ioctl.h \
src/linux/fanotify.h \
src/initreq.h \
- src/sd-daemon.h \
src/sd-readahead.h \
src/special.h \
src/dbus-common.h \
@@ -595,11 +606,11 @@ test_hostname_LDADD = \
libsystemd-basic.la
test_daemon_SOURCES = \
- src/test-daemon.c \
- src/sd-daemon.c
+ src/test-daemon.c
test_daemon_LDADD = \
- libsystemd-basic.la
+ libsystemd-basic.la \
+ libsystemd-daemon.la
test_cgroup_SOURCES = \
src/test-cgroup.c \
@@ -621,7 +632,8 @@ test_env_replace_LDADD = \
libsystemd-basic.la
test_strv_SOURCES = \
- src/test-strv.c
+ src/test-strv.c \
+ src/specifier.c
test_strv_CFLAGS = \
$(AM_CFLAGS)
@@ -631,16 +643,15 @@ test_strv_LDADD = \
systemd_logger_SOURCES = \
src/logger.c \
- src/sd-daemon.c \
src/tcpwrap.c
systemd_logger_LDADD = \
libsystemd-basic.la \
+ libsystemd-daemon.la \
$(LIBWRAP_LIBS)
systemd_initctl_SOURCES = \
src/initctl.c \
- src/sd-daemon.c \
src/dbus-common.c
systemd_initctl_CFLAGS = \
@@ -649,6 +660,7 @@ systemd_initctl_CFLAGS = \
systemd_initctl_LDADD = \
libsystemd-basic.la \
+ libsystemd-daemon.la \
$(DBUS_LIBS)
systemd_update_utmp_SOURCES = \
@@ -677,14 +689,14 @@ systemd_random_seed_LDADD = \
systemd_shutdownd_SOURCES = \
src/utmp-wtmp.c \
- src/sd-daemon.c \
src/shutdownd.c
systemd_shutdownd_CFLAGS = \
$(AM_CFLAGS)
systemd_shutdownd_LDADD = \
- libsystemd-basic.la
+ libsystemd-basic.la \
+ libsystemd-daemon.la
systemd_shutdown_SOURCES = \
src/mount-setup.c \
@@ -836,21 +848,20 @@ systemd_cgroups_agent_LDADD = \
systemd_kmsg_syslogd_SOURCES = \
src/kmsg-syslogd.c \
- src/sd-daemon.c \
src/fdset.c
systemd_kmsg_syslogd_CFLAGS = \
$(AM_CFLAGS)
systemd_kmsg_syslogd_LDADD = \
- libsystemd-basic.la
+ libsystemd-basic.la \
+ libsystemd-daemon.la
systemctl_SOURCES = \
src/systemctl.c \
src/utmp-wtmp.c \
src/dbus-common.c \
src/path-lookup.c \
- src/sd-daemon.c \
src/cgroup-show.c \
src/cgroup-util.c \
src/exit-status.c \
@@ -862,15 +873,16 @@ systemctl_CFLAGS = \
systemctl_LDADD = \
libsystemd-basic.la \
+ libsystemd-daemon.la \
$(DBUS_LIBS)
systemd_notify_SOURCES = \
src/notify.c \
- src/sd-daemon.c \
src/sd-readahead.c
systemd_notify_LDADD = \
- libsystemd-basic.la
+ libsystemd-basic.la \
+ libsystemd-daemon.la
systemd_ask_password_SOURCES = \
src/ask-password.c \
@@ -887,7 +899,6 @@ systemd_reply_password_LDADD = \
systemd_readahead_collect_SOURCES = \
src/readahead-collect.c \
- src/sd-daemon.c \
src/readahead-common.c
systemd_readahead_collect_CFLAGS = \
@@ -895,11 +906,11 @@ systemd_readahead_collect_CFLAGS = \
systemd_readahead_collect_LDADD = \
libsystemd-basic.la \
+ libsystemd-daemon.la \
$(UDEV_LIBS)
systemd_readahead_replay_SOURCES = \
src/readahead-replay.c \
- src/sd-daemon.c \
src/readahead-common.c
systemd_readahead_replay_CFLAGS = \
@@ -907,6 +918,7 @@ systemd_readahead_replay_CFLAGS = \
systemd_readahead_replay_LDADD = \
libsystemd-basic.la \
+ libsystemd-daemon.la \
$(UDEV_LIBS)
systemd_cgls_SOURCES = \
@@ -962,7 +974,12 @@ systemd_gnome_ask_password_agent_VALAFLAGS = \
--pkg=gtk+-2.0 \
--pkg=linux \
--pkg=gio-unix-2.0 \
- --pkg=libnotify \
+ --pkg=libnotify
+if LIBNOTIFY07
+systemd_gnome_ask_password_agent_VALAFLAGS += \
+ -D LIBNOTIFY07
+endif
+systemd_gnome_ask_password_agent_VALAFLAGS += \
-g
systemd_gnome_ask_password_agent_LDADD = \
@@ -980,8 +997,7 @@ systemd_tty_ask_password_agent_LDADD = \
pam_systemd_la_SOURCES = \
src/pam-module.c \
- src/cgroup-util.c \
- src/sd-daemon.c
+ src/cgroup-util.c
pam_systemd_la_CFLAGS = \
$(AM_CFLAGS)
@@ -996,6 +1012,7 @@ pam_systemd_la_LDFLAGS = \
pam_systemd_la_LIBADD = \
libsystemd-basic.la \
+ libsystemd-daemon.la \
$(PAM_LIBS)
SED_PROCESS = \
diff --git a/README b/README
index 756622660c..e38c19b191 100644
--- a/README
+++ b/README
@@ -28,10 +28,11 @@ AUTHOR:
REQUIREMENTS:
Linux kernel >= 2.6.30 (with autofs4, devtmpfs, cgroups)
- libudev >= 160
- libcgroup >= 0.35
- vala >= 0.80
+ libudev >= 163
+ dbus >= 1.4.0
+ vala >= 0.10
+ util-linux > v2.18 (requires fsck -l, agetty -s)
+ sulogin (from sysvinit-tools)
gtk+ >= 2.20
- dbus >= 1.2.24
libcap
PAM >= 1.1.2 (optional)
diff --git a/TODO b/TODO
index 61e4cb3cb5..8d4981018a 100644
--- a/TODO
+++ b/TODO
@@ -1,12 +1,80 @@
-* check if bind mounts work:
- https://bugzilla.novell.com/show_bug.cgi?id=652762
+* figure out what happened to bluez patch
+
+* in pam_systemd: add option to kill normal user sessions on logout but only those with uid != 0
+
+* introduce StandardOutput=syslog+console and StandardOutput=kmsg+console to support fsck output at boot
+
+* Patch systemd-fsck to use -C and pass console fd to it
+
+* sometimes processes seem to remain when we kill a service
+ http://lists.fedoraproject.org/pipermail/devel/2011-January/147559.html
+
+* when launching pager, take number of columns first
+
+* support remote/ssh systemctl/systemadm, and local privileged access
+
+* finish syslog socket stuff
+
+* when starting systemd --user we get "Failed to set udev event buffer size."
+
+* configurable jitter for timer events
+
+* dbus should run with oom adjust set
+
+* support caching password questions in plymouth and on the console
+ https://bugzilla.redhat.com/show_bug.cgi?id=655538
+
+* dep loop when using encrypted swap
+ https://bugzilla.redhat.com/show_bug.cgi?id=657234
+
+* exclude java hsp files by default
+ https://bugzilla.redhat.com/show_bug.cgi?id=527425
+
+* load EnvironmentFile= when starting services, not when reloading configuration
+ https://bugzilla.redhat.com/show_bug.cgi?id=661282
+
+* somehow some /etc/fstab supplied mount params are never applied to api fs
+ https://bugzilla.redhat.com/show_bug.cgi?id=663108
+
+* automount units can cause a segfault:
+ https://bugs.freedesktop.org/show_bug.cgi?id=32076
+
+* support globs in systemd-tmpfiles
+
+* drop IN_ATTRIB from inotify watches for .path units where possible to avoid
+ lots of wakeups due to /dev changing when we watch a subdir of /dev.
+
+* Support ProcessNeededForShutdown=true to allow stuff like mdmon
+ to be killed very late after the rootfs is read only
+
+* Integrate "mdadm --wait-clean". Maybe just let SIGTERM to mdmon trigger the
+ needed action
+
+* bind mounts with 'fsck' fail and block for a minute:
+ /foo /bar none bind 1 1
+ (requesting fsck is wrong, but why do we block for a minute
+ instead of just handling the error)
* oneshot services which do not remain: 'exited' instead of 'dead'?
- it should be visible in 'systemctl' that they have been run
+ it should be visible in 'systemctl' that they have been run?
* dot output for --test showing the 'initial transaction'
* calendar time support in timer, iCalendar semantics for the timer stuff (RFC2445)
+ - check timerfd() patch: http://lkml.org/lkml/2010/11/23/290
+
+* systemd --user
+ - get PR_SET_ANCHOR merged: http://lkml.org/lkml/2010/2/2/165
+
+* add VT tracking:
+ - provide CK functionality
+ - start getty only when actual vt switch happens (same model as
+ socket on-demand activation). allocate the next free tty and
+ start a getty there. this way, pressing alt-f[1-12] will switch
+ through running X and getty sessions, and any unallocated
+ activated tty will start a new getty. the hardcoding of
+ getty[1-6] will entirely go away.
+ - http://git.kernel.org/?p=linux/kernel/git/gregkh/tty-2.6.git;a=commitdiff;h=fbc92a3455577ab17615cbcb91826399061bd789
* implicitly import "defaults" settings file into all types
@@ -42,13 +110,6 @@
* suspend, resume
-* systemctl auto-pager a la git
-
-* merge CK
-
-* start getty 2-6 only when actual vt switch happens
- (same model as socket on-demand activation)
-
* readahead: btrfs/LVM SSD detection
* when processes remain in a service even though the start command failed enter active
@@ -64,19 +125,19 @@
* allow runtime changing of log level and target
* automatically determine TERM= based on tty name even for /dev/console
+ http://git.kernel.org/?p=linux/kernel/git/gregkh/tty-2.6.git;a=commitdiff;h=fbc92a3455577ab17615cbcb91826399061bd789
+ http://git.kernel.org/?p=linux/kernel/git/gregkh/tty-2.6.git;a=commitdiff;h=b7b8de087384cc1954a8cd075af3f9e5977caa2e
* fix hotplug transactions
* isolate multi-user.target doesn't start a getty@tty1 if we run it from graphical.target
-* alsa rule file, alsa service files, alsa state file → /var/lib, sequencer soll by device node ladbar
-
-* place introspection data in ELF sections, read them with objcopy
-
* sendmail.service doesn't get rid PID file, fails to kill everything on stop
* global defaults for StandardOuput=xxx
+* mkswap/mke2fs is called on wrong devices in crypto devices.
+
Fedora:
* obsolete readhead in systemd pkg
@@ -92,6 +153,7 @@ External:
* patch kernel for xattr support in /dev, /proc/, /sys and /sys/fs/cgroup.
* patch kernel for cpu feature modalias for autoloading aes/kvm/...
+ http://git.kernel.org/?p=linux/kernel/git/ak/linux-misc-2.6.git;a=shortlog;h=refs/heads/cpuid-match
* place /etc/inittab with explaining blurb.
diff --git a/configure.ac b/configure.ac
index 5a6f3c7d6e..e4520e7821 100644
--- a/configure.ac
+++ b/configure.ac
@@ -17,7 +17,7 @@
AC_PREREQ(2.63)
-AC_INIT([systemd],[15],[systemd-devel@lists.freedesktop.org])
+AC_INIT([systemd],[16],[systemd-devel@lists.freedesktop.org])
AC_CONFIG_SRCDIR([src/main.c])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_HEADERS([config.h])
@@ -259,12 +259,15 @@ if test "$have_gtk" = "yes"; then
AC_SUBST(DBUSGLIB_CFLAGS)
AC_SUBST(DBUSGLIB_LIBS)
- PKG_CHECK_MODULES(LIBNOTIFY, [ libnotify >= 0.7.0 ])
+ PKG_CHECK_MODULES(LIBNOTIFY, [ libnotify ])
+ PKG_CHECK_EXISTS([ libnotify >= 0.7.0 ], [ libnotify07=yes ])
+
AC_SUBST(LIBNOTIFY_CFLAGS)
AC_SUBST(LIBNOTIFY_LIBS)
fi
+AM_CONDITIONAL(LIBNOTIFY07, [ test "$libnotify07" = "yes" ])
-AM_PROG_VALAC([0.11])
+AM_PROG_VALAC([0.10])
AC_SUBST(VAPIDIR)
AM_CONDITIONAL(HAVE_VALAC, test x"$VALAC" != x)
@@ -287,6 +290,7 @@ if test "z$with_distro" = "z"; then
AC_CHECK_FILE(/etc/arch-release,with_distro="arch")
AC_CHECK_FILE(/etc/gentoo-release,with_distro="gentoo")
AC_CHECK_FILE(/etc/slackware-version,with_distro="slackware")
+ AC_CHECK_FILE(/etc/frugalware-release,with_distro="frugalware")
fi
if test "z$with_distro" = "z"; then
with_distro=`uname -s`
@@ -359,6 +363,12 @@ case $with_distro in
AC_DEFINE(TARGET_SLACKWARE, [], [Target is Slackware])
M4_DISTRO_FLAG=-DTARGET_SLACKWARE=1
;;
+ frugalware)
+ SYSTEM_SYSVINIT_PATH=/etc/rc.d
+ SYSTEM_SYSVRCND_PATH=/etc/rc.d
+ AC_DEFINE(TARGET_FRUGALWARE, [], [Target is Frugalware])
+ M4_DISTRO_FLAG=-DTARGET_FRUGALWARE=1
+ ;;
other)
AS_IF([test "x$with_syslog_service" = "x"],
[AC_MSG_ERROR([With --distro=other, you must pass --with-syslog-service= to configure])])
@@ -400,6 +410,12 @@ else
SYSTEM_SYSV_COMPAT="no"
fi
+AC_ARG_WITH([tty-gid],
+ [AS_HELP_STRING([--with-tty-gid=GID],
+ [Specify the numeric GID of the 'tty' group])],
+ [AC_DEFINE_UNQUOTED(TTY_GID, [$withval], [GID of the 'tty' group])],
+ [])
+
AM_CONDITIONAL(TARGET_FEDORA, test x"$with_distro" = xfedora)
AM_CONDITIONAL(TARGET_SUSE, test x"$with_distro" = xsuse)
AM_CONDITIONAL(TARGET_DEBIAN, test x"$with_distro" = xdebian)
@@ -408,6 +424,7 @@ AM_CONDITIONAL(TARGET_DEBIAN_OR_UBUNTU, test x"$with_distro" = xdebian -o x"$wit
AM_CONDITIONAL(TARGET_ARCH, test x"$with_distro" = xarch)
AM_CONDITIONAL(TARGET_GENTOO, test x"$with_distro" = xgentoo)
AM_CONDITIONAL(TARGET_SLACKWARE, test x"$with_distro" = xslackware)
+AM_CONDITIONAL(TARGET_FRUGALWARE, test x"$with_distro" = xfrugalware)
AC_DEFINE_UNQUOTED(SPECIAL_SYSLOG_SERVICE, ["$SPECIAL_SYSLOG_SERVICE"], [Syslog service name])
diff --git a/man/daemon.xml b/man/daemon.xml
index f592e7d6e2..7e7039e07a 100644
--- a/man/daemon.xml
+++ b/man/daemon.xml
@@ -115,7 +115,7 @@
<listitem><para>In the child, call
<function>fork()</function> again, to
- ensure the daemon can never re-aquire
+ ensure the daemon can never re-acquire
a terminal again.</para></listitem>
<listitem><para>Call <function>exit()</function> in the
@@ -644,7 +644,7 @@
to the CPU and IO schedulers. If a process
executed by the init system shall not
negatively impact the amount of CPU or IO
- bandwith available to other processes, it
+ bandwidth available to other processes, it
should be configured with
<varname>CPUSchedulingPolicy=idle</varname>
and/or
diff --git a/man/modules-load.d.xml b/man/modules-load.d.xml
index 47acc08e63..77a2860553 100644
--- a/man/modules-load.d.xml
+++ b/man/modules-load.d.xml
@@ -57,7 +57,7 @@
kernel modules to load during boot in a static list.
Each configuration file is named in the style of
<filename>/etc/modules-load.d/&lt;program&gt;.conf</filename>. Note
- that it is usally a better idea to use the automatic
+ that it is usually a better idea to use the automatic
module loading by PCI ID, by DMI ID or similar
triggers configured in the kernel modules themselves
instead of relying on static configuration like
@@ -68,7 +68,7 @@
<title>Configuration Format</title>
<para>The configuration files should simply contain a
- list of kernel modul names to load, seperated by
+ list of kernel module names to load, separated by
newlines. Empty lines and lines whose first
non-whitespace character is # or ; are ignored.</para>
diff --git a/man/os-release.xml b/man/os-release.xml
index b5f42b2eec..759c04d320 100644
--- a/man/os-release.xml
+++ b/man/os-release.xml
@@ -173,7 +173,7 @@
<para>Note that operating system vendors may choose
not to provide version information, for example to
- accomodate for rolling releases. In this case VERSION
+ accommodate for rolling releases. In this case VERSION
and VERSION_ID may be unset. Applications should not
rely on these fields to be set.</para>
</refsect1>
diff --git a/man/pam_systemd.xml b/man/pam_systemd.xml
index d43ed231f2..cd806da931 100644
--- a/man/pam_systemd.xml
+++ b/man/pam_systemd.xml
@@ -205,9 +205,9 @@
<term><option>controllers=</option></term>
<listitem><para>Takes a comma
- seperated list of cgroup controllers
+ separated list of cgroup controllers
in which hierarchies a user/session
- cgroup will be created by defautl for
+ cgroup will be created by default for
each user logging in. If ommited,
defaults to 'cpu', meaning that in
addition to creating per-user and
diff --git a/man/shutdown.xml b/man/shutdown.xml
index d6bdad37fa..c8c4b54620 100644
--- a/man/shutdown.xml
+++ b/man/shutdown.xml
@@ -76,7 +76,7 @@
implied.</para>
<para>Note that to specify a wall message you must
- speciy a time argument, too.</para>
+ specify a time argument, too.</para>
<para>If the time argument is used, 5 minutes
before the system goes down the
diff --git a/man/systemctl.xml b/man/systemctl.xml
index 844d218877..c21ed85565 100644
--- a/man/systemctl.xml
+++ b/man/systemctl.xml
@@ -154,7 +154,7 @@
<listitem><para>Suppress output to
STDOUT in
<command>snapshot</command>,
- <command>check</command>,
+ <command>is-active</command>,
<command>enable</command> and
<command>disable</command>.</para></listitem>
</varlistentry>
@@ -171,6 +171,13 @@
enqueued.</para></listitem> </varlistentry>
<varlistentry>
+ <term><option>--no-pager</option></term>
+
+ <listitem><para>Do not pipe output into a
+ pager.</para></listitem>
+ </varlistentry>
+
+ <varlistentry>
<term><option>--system</option></term>
<listitem><para>Talk to the systemd
@@ -224,7 +231,7 @@
<listitem><para>When used with
<command>enable</command> and
<command>disable</command>, operate on the
- global user configuŕation
+ global user configuration
directory, thus enabling or disabling
a unit file globally for all future
logins of all users.</para></listitem>
@@ -257,7 +264,7 @@
<command>systemctl</command> will
query the user on the terminal for the
necessary secrets. Use this option to
- switch this behaviour off. In this
+ switch this behavior off. In this
case the password must be supplied by
some other means (for example
graphical password agents) or the
@@ -276,7 +283,7 @@
<option>process</option> to select
whether to kill the entire control
group, the process group or only the
- selected process itself. If ommitted
+ selected process itself. If omitted
defaults to
<option>control-group</option> if
<option>--kill-who=all</option> is
@@ -296,22 +303,22 @@
<option>all</option> to select whether
to kill only the main process of the
unit, the control process or all
- processes of the unit. If ommitted
+ processes of the unit. If omitted
defaults to
<option>all</option>.</para></listitem>
</varlistentry>
<varlistentry>
- <term><option>---signal=</option></term>
+ <term><option>--signal=</option></term>
<term><option>-s</option></term>
<listitem><para>When used with
<command>kill</command>, choose which
signal to send to selected
processes. Must be one of the well
- know signal specifiers such as
+ known signal specifiers such as
SIGTERM, SIGINT or SIGSTOP. If
- ommitted defaults to
+ omitted defaults to
<option>SIGTERM</option>.</para></listitem>
</varlistentry>
@@ -416,21 +423,31 @@
units specified on the command
line. If the units are not running yet
the operation will
- fail.</para></listitem>
+ fail. Note that for compatibility
+ with Red Hat init scripts
+ <command>condrestart</command> is
+ equivalent to this command.</para></listitem>
</varlistentry>
<varlistentry>
<term><command>reload-or-restart [NAME...]</command></term>
+
+ <listitem><para>Reload one or more
+ units if they support it. If not,
+ restart them instead. If the units
+ are not running yet they will be
+ started.</para></listitem>
+ </varlistentry>
+ <varlistentry>
<term><command>reload-or-try-restart [NAME...]</command></term>
<listitem><para>Reload one or more
units if they support it. If not,
- restart them instead. Note that for
- compatibility with SysV and Red Hat
- init scripts
- <command>force-reload</command> and
- <command>condrestart</command> may be
- used as equivalent commands to
- <command>reload-or-try-restart</command>.</para></listitem>
+ restart them instead. If the units
+ are not running yet the operation
+ will fail. Note that for
+ compatibility with SysV init scripts
+ <command>force-reload</command> is
+ equivalent to this command.</para></listitem>
</varlistentry>
<varlistentry>
<term><command>isolate [NAME]</command></term>
@@ -469,7 +486,7 @@
<term><command>is-active [NAME...]</command></term>
<listitem><para>Check whether any of
- the specified units is active
+ the specified units are active
(i.e. running). Returns an exit code
0 if at least one is active, non-zero
otherwise. Unless
@@ -569,7 +586,7 @@
administrator is free to make
additional changes manually, by
placing or removing symlinks in the
- directory. This is particular useful
+ directory. This is particularly useful
to create configurations that deviate
from the suggested default
installation. In this case the
@@ -641,7 +658,7 @@
<option>--quiet</option>.</para>
</listitem>
- <para>This command honours
+ <para>This command honors
<option>--system</option>,
<option>--user</option>,
<option>--global</option> in a similar
@@ -700,7 +717,7 @@
<listitem><para>Cancel one or more
jobs specified on the command line by
their numeric job
- IDs. If not job id is specified cancels all jobs that are pending.</para></listitem>
+ IDs. If no job id is specified, cancel all pending jobs.</para></listitem>
</varlistentry>
<varlistentry>
<term><command>monitor</command></term>
@@ -756,7 +773,7 @@
<para>A snapshot refers to a saved
state of the systemd manager. It is
- implemented itself as unit that is
+ implemented itself as a unit that is
generated dynamically with this
command and has dependencies on all
units active at the time. At a later
@@ -881,8 +898,8 @@
users. If
combined with <option>--force</option>
shutdown of all running services is
- skipped, however all processes killed
- and all file systems unmounted or
+ skipped, however all processes are killed
+ and all file systems are unmounted or
mounted read-only, immediately
followed by the
system halt.</para></listitem>
@@ -898,8 +915,8 @@
users. If
combined with <option>--force</option>
shutdown of all running services is
- skipped, however all processes killed
- and all file systems unmounted or
+ skipped, however all processes are killed
+ and all file systems are unmounted or
mounted read-only, immediately
followed by the
powering off.</para></listitem>
@@ -915,8 +932,8 @@
users. If
combined with <option>--force</option>
shutdown of all running services is
- skipped, however all processes killed
- and all file systems unmounted or
+ skipped, however all processes are killed
+ and all file systems are unmounted or
mounted read-only, immediately
followed by the
reboot.</para></listitem>
@@ -931,8 +948,8 @@
a wall message to all users. If
combined with <option>--force</option>
shutdown of all running services is
- skipped, however all processes killed
- and all file systems unmounted or
+ skipped, however all processes are killed
+ and all file systems are unmounted or
mounted read-only, immediately
followed by the
reboot.</para></listitem>
diff --git a/man/systemd.conf.xml b/man/systemd.conf.xml
index 32eae2b8e0..54a8398d43 100644
--- a/man/systemd.conf.xml
+++ b/man/systemd.conf.xml
@@ -85,7 +85,7 @@
<listitem><para>Configures various
parameters of basic manager
operation. These options may be
- overriden by the respective command
+ overridden by the respective command
line arguments. See
<citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>
for details about these command line
@@ -121,10 +121,10 @@
create per-service cgroups
automatically, in addition to the
name=systemd named hierarchy. Defaults
- to 'cpu'. Takes a space seperated list
+ to 'cpu'. Takes a space separated list
of controller names. Pass an empty
string to ensure that systemd does not
- touch any hiearchies but its
+ touch any hierarchies but its
own.</para></listitem>
</varlistentry>
</variablelist>
diff --git a/man/systemd.exec.xml b/man/systemd.exec.xml
index 7c8005c9c0..d6ac5aed89 100644
--- a/man/systemd.exec.xml
+++ b/man/systemd.exec.xml
@@ -275,8 +275,13 @@
contain new-line separated variable
assignments. Empty lines and lines
starting with ; or # will be ignored,
- which may be used for
- commenting.</para></listitem>
+ which may be used for commenting. The
+ argument passed should be an absolute
+ file name, optionally prefixed with
+ "-", which indicates that if the file
+ does not exist it won't be read and no
+ error or warning message is
+ logged.</para></listitem>
</varlistentry>
<varlistentry>
@@ -382,7 +387,7 @@
available options are identical to
those of
<varname>StandardOutput=</varname>,
- whith one exception: if set to
+ with one exception: if set to
<option>inherit</option> the file
descriptor used for standard output is
duplicated for standard error. This
@@ -678,7 +683,7 @@
restricting access with these options
does not extend to submounts of a
directory. You must list submounts
- separately in these setttings to
+ separately in these settings to
ensure the same limited access. These
options may be specified more than
once in which case all directories
diff --git a/man/systemd.service.xml b/man/systemd.service.xml
index c77992d07c..e4fa6bcc7c 100644
--- a/man/systemd.service.xml
+++ b/man/systemd.service.xml
@@ -271,11 +271,11 @@
<literal>-</literal> an exit code of
the command normally considered a
failure (i.e. non-zero exit status or
- abormal exit due to signal) is ignored
+ abnormal exit due to signal) is ignored
and considered success. If both
<literal>-</literal> and
<literal>@</literal> are used for the
- same command the former must preceed
+ same command the former must precede
the latter. Unless
<varname>Type=forking</varname> is
set, the process started via this
@@ -314,7 +314,7 @@
after the other,
serially. Alternatively, these
directives may be specified more than
- once whith the same effect. However,
+ once with the same effect. However,
the latter syntax is not recommended
for compatibility with parsers
suitable for XDG
@@ -441,7 +441,7 @@
i.e. terminated with an exit code of
0. If set to
<option>on-failure</option> it will be
- restared only when it exited with an
+ restarted only when it exited with an
exit code not equalling 0, or when
terminated by a signal. If set to
<option>on-abort</option> it will be
diff --git a/man/systemd.unit.xml b/man/systemd.unit.xml
index 968ee58be3..14ec4561b2 100644
--- a/man/systemd.unit.xml
+++ b/man/systemd.unit.xml
@@ -598,7 +598,7 @@
exist. <varname>ConditionDirectoryNotEmpty=</varname>
is similar to
<varname>ConditionPathExists=</varname>
- but verifies whether a cetrain path is
+ but verifies whether a certain path is
exists and is a non-empty
directory. Similarly
<varname>ConditionKernelCommandLine=</varname>
@@ -607,7 +607,7 @@
set (or if prefixed with the
exclamation mark unset). The argument
must either be a single word, or an
- assignment (i.e. two words, seperated
+ assignment (i.e. two words, separated
by the equality sign). In the former
case the kernel command line is
searched for the word appearing as is,
@@ -624,7 +624,7 @@
will always fail, otherwise
succeed. If multiple conditions are
specified the unit will be executed
- iff at least one of them applies
+ if at least one of them applies
(i.e. a logical OR is
applied).</para></listitem>
</varlistentry>
diff --git a/man/tmpfiles.d.xml b/man/tmpfiles.d.xml
index 1df4a043e8..e6b4c1bfac 100644
--- a/man/tmpfiles.d.xml
+++ b/man/tmpfiles.d.xml
@@ -116,7 +116,7 @@ d /var/run/user 0755 root root 10d</programlisting>
<title>Mode</title>
<para>The file access mode to use for this
- file or directory. If ommited or when set to -
+ file or directory. If omitted or when set to -
the default is used: 0755 for directories,
0644 for files.</para>
</refsect2>
@@ -127,7 +127,7 @@ d /var/run/user 0755 root root 10d</programlisting>
<para>The user and group to use for this file
or directory. This may either be a numeric
user/group ID or a user or group name. If
- ommited or when set to - the default 0 is
+ omitted or when set to - the default 0 is
used.</para>
</refsect2>
@@ -155,7 +155,7 @@ d /var/run/user 0755 root root 10d</programlisting>
<para>If multiple integers and units are specified the time values are summed up.</para>
- <para>The age field only applies to lines starting with d, D and x. If ommited or set to - no automatic clean-up is done.</para>
+ <para>The age field only applies to lines starting with d, D and x. If omitted or set to - no automatic clean-up is done.</para>
</refsect2>
diff --git a/src/cryptsetup-generator.c b/src/cryptsetup-generator.c
index c5e54d0988..2bc4f566a6 100644
--- a/src/cryptsetup-generator.c
+++ b/src/cryptsetup-generator.c
@@ -122,13 +122,13 @@ static int create_disk(
if (options && has_option(options, "tmp"))
fprintf(f,
- "ExecStartPost=/sbin/mke2fs '%s'",
- u);
+ "ExecStartPost=/sbin/mke2fs '/dev/mapper/%s'",
+ name);
if (options && has_option(options, "swap"))
fprintf(f,
- "ExecStartPost=/sbin/mkswap '%s'",
- u);
+ "ExecStartPost=/sbin/mkswap '/dev/mapper/%s'",
+ name);
fflush(f);
diff --git a/src/device.c b/src/device.c
index 5c18d996ea..b36bfc1ad1 100644
--- a/src/device.c
+++ b/src/device.c
@@ -468,6 +468,11 @@ static int device_enumerate(Manager *m) {
goto fail;
}
+ /* This will fail if we are unprivileged, but that
+ * should not matter much, as user instances won't run
+ * during boot. */
+ udev_monitor_set_receive_buffer_size(m->udev_monitor, 128*1024*1024);
+
if (udev_monitor_filter_add_match_tag(m->udev_monitor, "systemd") < 0) {
r = -ENOMEM;
goto fail;
@@ -524,10 +529,21 @@ void device_fd_event(Manager *m, int events) {
const char *action;
assert(m);
- assert(events == EPOLLIN);
+
+ if (events != EPOLLIN) {
+ static RATELIMIT_DEFINE(limit, 10*USEC_PER_SEC, 5);
+
+ if (!ratelimit_test(&limit))
+ log_error("Failed to get udev event: %m");
+ if (!(events & EPOLLIN))
+ return;
+ }
if (!(dev = udev_monitor_receive_device(m->udev_monitor))) {
- log_error("Failed to receive device.");
+ /*
+ * libudev might filter-out devices which pass the bloom filter,
+ * so getting NULL here is not neccessarily an error
+ */
return;
}
diff --git a/src/execute.c b/src/execute.c
index 05abd5aaac..1e8dfaf770 100644
--- a/src/execute.c
+++ b/src/execute.c
@@ -1303,6 +1303,8 @@ int exec_spawn(ExecCommand *command,
goto fail;
}
+ final_env = strv_env_clean(final_env);
+
execve(command->path, final_argv, final_env);
r = EXIT_EXEC;
@@ -1404,6 +1406,9 @@ void exec_context_done(ExecContext *c) {
if (c->cpuset)
CPU_FREE(c->cpuset);
+
+ free(c->utmp_id);
+ c->utmp_id = NULL;
}
void exec_command_done(ExecCommand *c) {
diff --git a/src/gnome-ask-password-agent.vala b/src/gnome-ask-password-agent.vala
index 6cab6f96a7..61bbba0f7c 100644
--- a/src/gnome-ask-password-agent.vala
+++ b/src/gnome-ask-password-agent.vala
@@ -38,8 +38,13 @@ public class PasswordDialog : Dialog {
set_default_response(ResponseType.OK);
set_icon_name(icon);
+#if LIBNOTIFY07
add_button(Stock.CANCEL, ResponseType.CANCEL);
add_button(Stock.OK, ResponseType.OK);
+#else
+ add_button(STOCK_CANCEL, ResponseType.CANCEL);
+ add_button(STOCK_OK, ResponseType.OK);
+#endif
Container content = (Container) get_content_area();
@@ -181,7 +186,12 @@ public class MyStatusIcon : StatusIcon {
set_visible(true);
+#if LIBNOTIFY07
Notification n = new Notification(title, message, icon);
+#else
+ Notification n = new Notification(title, message, icon, null);
+ n.attach_to_status_icon(this);
+#endif
n.set_timeout(5000);
n.show();
@@ -225,7 +235,11 @@ public class MyStatusIcon : StatusIcon {
OutputStream stream = new UnixOutputStream(to_process, true);
+#if LIBNOTIFY07
stream.write(password.data, null);
+#else
+ stream.write(password, password.length, null);
+#endif
}
}
diff --git a/src/hostname-setup.c b/src/hostname-setup.c
index ce7d2a1c11..0428a64fea 100644
--- a/src/hostname-setup.c
+++ b/src/hostname-setup.c
@@ -32,7 +32,7 @@
#if defined(TARGET_FEDORA)
#define FILENAME "/etc/sysconfig/network"
-#elif defined(TARGET_SUSE) || defined(TARGET_SLACKWARE)
+#elif defined(TARGET_SUSE) || defined(TARGET_SLACKWARE) || defined(TARGET_FRUGALWARE)
#define FILENAME "/etc/HOSTNAME"
#elif defined(TARGET_ARCH)
#define FILENAME "/etc/rc.conf"
@@ -137,7 +137,7 @@ finish:
fclose(f);
return r;
-#elif defined(TARGET_SUSE) || defined(TARGET_SLACKWARE)
+#elif defined(TARGET_SUSE) || defined(TARGET_SLACKWARE) || defined(TARGET_FRUGALWARE)
return read_and_strip_hostname(FILENAME, hn);
#else
return -ENOENT;
diff --git a/src/load-fragment.c b/src/load-fragment.c
index 1b23205a2f..261180d155 100644
--- a/src/load-fragment.c
+++ b/src/load-fragment.c
@@ -1348,19 +1348,31 @@ static int config_parse_env_file(
FILE *f;
int r;
char ***env = data;
+ bool ignore = false;
assert(filename);
assert(lvalue);
assert(rvalue);
assert(data);
+ if (rvalue[0] == '-') {
+ ignore = true;
+ rvalue++;
+ }
+
+ if (!path_is_absolute(rvalue)) {
+ log_error("[%s:%u] Path '%s' is not absolute, ignoring.", filename, line, rvalue);
+ return 0;
+ }
+
if (!(f = fopen(rvalue, "re"))) {
- log_error("[%s:%u] Failed to open environment file '%s', ignoring: %m", filename, line, rvalue);
+ if (!ignore)
+ log_error("[%s:%u] Failed to open environment file '%s', ignoring: %m", filename, line, rvalue);
return 0;
}
while (!feof(f)) {
- char l[LINE_MAX], *p;
+ char l[LINE_MAX], *p, *u;
char **t;
if (!fgets(l, sizeof(l), f)) {
@@ -1381,7 +1393,21 @@ static int config_parse_env_file(
if (strchr(COMMENTS, *p))
continue;
- t = strv_env_set(*env, p);
+ if (!(u = normalize_env_assignment(p))) {
+ log_error("Out of memory");
+ r = -ENOMEM;
+ goto finish;
+ }
+
+ t = strv_append(*env, u);
+ free(u);
+
+ if (!t) {
+ log_error("Out of memory");
+ r = -ENOMEM;
+ goto finish;
+ }
+
strv_free(*env);
*env = t;
}
diff --git a/src/locale-setup.c b/src/locale-setup.c
index b3375e99b1..086647b720 100644
--- a/src/locale-setup.c
+++ b/src/locale-setup.c
@@ -51,16 +51,16 @@ static const char * const variable_names[_VARIABLE_MAX] = {
[VARIABLE_LANG] = "LANG",
[VARIABLE_LC_CTYPE] = "LC_CTYPE",
[VARIABLE_LC_NUMERIC] = "LC_NUMERIC",
- [VARIABLE_LC_TIME] = "TIME",
- [VARIABLE_LC_COLLATE] = "COLLATE",
- [VARIABLE_LC_MONETARY] = "MONETARY",
- [VARIABLE_LC_MESSAGES] = "MESSAGE",
- [VARIABLE_LC_PAPER] = "PAPER",
- [VARIABLE_LC_NAME] = "NAME",
- [VARIABLE_LC_ADDRESS] = "ADDRESS",
- [VARIABLE_LC_TELEPHONE] = "TELEPHONE",
- [VARIABLE_LC_MEASUREMENT] = "MEASUREMENT",
- [VARIABLE_LC_IDENTIFICATION] = "IDENTIFICATION"
+ [VARIABLE_LC_TIME] = "LC_TIME",
+ [VARIABLE_LC_COLLATE] = "LC_COLLATE",
+ [VARIABLE_LC_MONETARY] = "LC_MONETARY",
+ [VARIABLE_LC_MESSAGES] = "LC_MESSAGE",
+ [VARIABLE_LC_PAPER] = "LC_PAPER",
+ [VARIABLE_LC_NAME] = "LC_NAME",
+ [VARIABLE_LC_ADDRESS] = "LC_ADDRESS",
+ [VARIABLE_LC_TELEPHONE] = "LC_TELEPHONE",
+ [VARIABLE_LC_MEASUREMENT] = "LC_MEASUREMENT",
+ [VARIABLE_LC_IDENTIFICATION] = "LC_IDENTIFICATION"
};
int locale_setup(void) {
diff --git a/src/logger.c b/src/logger.c
index 32c57f8f82..482ec41244 100644
--- a/src/logger.c
+++ b/src/logger.c
@@ -187,8 +187,28 @@ static int stream_log(Stream *s, char *p, usec_t ts) {
for (;;) {
ssize_t n;
- if ((n = sendmsg(s->server->syslog_fd, &msghdr, MSG_NOSIGNAL)) < 0)
+ if ((n = sendmsg(s->server->syslog_fd, &msghdr, MSG_NOSIGNAL)) < 0) {
+
+ if (errno == ESRCH) {
+ pid_t our_pid;
+
+ /* Hmm, maybe the process this
+ * line originates from is
+ * dead? Then let's patch in
+ * our own pid and retry,
+ * since we have nothing
+ * better */
+
+ our_pid = getpid();
+
+ if (ucred->pid != our_pid) {
+ ucred->pid = our_pid;
+ continue;
+ }
+ }
+
return -errno;
+ }
if (!s->server->syslog_is_stream ||
(size_t) n >= IOVEC_TOTAL_SIZE(iovec, ELEMENTSOF(iovec)))
diff --git a/src/macro.h b/src/macro.h
index 85a7fbccfd..996b7c2ed1 100644
--- a/src/macro.h
+++ b/src/macro.h
@@ -47,6 +47,9 @@
#define _weakref_(x) __attribute__((weakref(#x)))
#define _introspect_(x) __attribute__((section("introspect." x)))
+#define XSTRINGIFY(x) #x
+#define STRINGIFY(x) XSTRINGIFY(x)
+
/* Rounds up */
static inline size_t ALIGN(size_t l) {
return ((l + sizeof(void*) - 1) & ~(sizeof(void*) - 1));
diff --git a/src/mount-setup.c b/src/mount-setup.c
index 4adb86f157..64fb4765f6 100644
--- a/src/mount-setup.c
+++ b/src/mount-setup.c
@@ -35,6 +35,10 @@
#include "util.h"
#include "label.h"
+#ifndef TTY_GID
+#define TTY_GID 5
+#endif
+
typedef struct MountPoint {
const char *what;
const char *where;
@@ -48,8 +52,8 @@ static const MountPoint mount_table[] = {
{ "proc", "/proc", "proc", NULL, MS_NOSUID|MS_NOEXEC|MS_NODEV, true },
{ "sysfs", "/sys", "sysfs", NULL, MS_NOSUID|MS_NOEXEC|MS_NODEV, true },
{ "devtmpfs", "/dev", "devtmpfs", "mode=755", MS_NOSUID, true },
- { "tmpfs", "/dev/shm", "tmpfs", "mode=1777", MS_NOSUID|MS_NOEXEC|MS_NODEV, true },
- { "devpts", "/dev/pts", "devpts", NULL, MS_NOSUID|MS_NOEXEC, false },
+ { "tmpfs", "/dev/shm", "tmpfs", "mode=1777", MS_NOSUID|MS_NODEV, true },
+ { "devpts", "/dev/pts", "devpts", "mode=620,gid=" STRINGIFY(TTY_GID), MS_NOSUID|MS_NOEXEC, false },
{ "tmpfs", "/sys/fs/cgroup", "tmpfs", "mode=755", MS_NOSUID|MS_NOEXEC|MS_NODEV, true },
{ "cgroup", "/sys/fs/cgroup/systemd", "cgroup", "none,name=systemd", MS_NOSUID|MS_NOEXEC|MS_NODEV, true },
};
diff --git a/src/pam-module.c b/src/pam-module.c
index 54a7b451e8..6fbaecf51d 100644
--- a/src/pam-module.c
+++ b/src/pam-module.c
@@ -102,6 +102,7 @@ static int parse_argv(pam_handle_t *handle,
}
}
+#if 0
if (!controller_set && controllers) {
char **l;
@@ -112,6 +113,7 @@ static int parse_argv(pam_handle_t *handle,
*controllers = l;
}
+#endif
if (controllers)
strv_remove(*controllers, "name=systemd");
diff --git a/src/path.c b/src/path.c
index 0d59419777..77de32d1d6 100644
--- a/src/path.c
+++ b/src/path.c
@@ -189,7 +189,7 @@ static int path_watch_one(Path *p, PathSpec *s) {
};
bool exists = false;
- char *k;
+ char *k, *slash;
int r;
assert(p);
@@ -213,15 +213,15 @@ static int path_watch_one(Path *p, PathSpec *s) {
if ((s->primary_wd = inotify_add_watch(s->inotify_fd, k, flags_table[s->type])) >= 0)
exists = true;
- for (;;) {
+ do {
int flags;
- char *slash;
/* This assumes the path was passed through path_kill_slashes()! */
if (!(slash = strrchr(k, '/')))
break;
- *slash = 0;
+ /* Trim the path at the last slash. Keep the slash if it's the root dir. */
+ slash[slash == k] = 0;
flags = IN_DELETE_SELF|IN_MOVE_SELF|IN_ATTRIB;
if (!exists)
@@ -229,7 +229,7 @@ static int path_watch_one(Path *p, PathSpec *s) {
if (inotify_add_watch(s->inotify_fd, k, flags) >= 0)
exists = true;
- }
+ } while (slash != k);
return 0;
diff --git a/src/quotacheck.c b/src/quotacheck.c
index c7aaece984..5d61146d93 100644
--- a/src/quotacheck.c
+++ b/src/quotacheck.c
@@ -63,7 +63,7 @@ static int parse_proc_cmdline(void) {
static void test_files(void) {
#ifdef TARGET_FEDORA
/* This exists only on Fedora */
- if (access("/forcequoatcheck", F_OK) >= 0)
+ if (access("/forcequotacheck", F_OK) >= 0)
arg_force = true;
#endif
}
diff --git a/src/readahead-collect.c b/src/readahead-collect.c
index a9f544dd3a..ac46c7b3ea 100644
--- a/src/readahead-collect.c
+++ b/src/readahead-collect.c
@@ -92,6 +92,10 @@ static int pack_file(FILE *pack, const char *fn, bool on_btrfs) {
assert(fn);
if ((fd = open(fn, O_RDONLY|O_CLOEXEC|O_NOATIME|O_NOCTTY|O_NOFOLLOW)) < 0) {
+
+ if (errno == ENOENT)
+ return 0;
+
log_warning("open(%s) failed: %m", fn);
r = -errno;
goto finish;
diff --git a/src/readahead-replay.c b/src/readahead-replay.c
index ab0c8084c8..87f2e598b4 100644
--- a/src/readahead-replay.c
+++ b/src/readahead-replay.c
@@ -60,9 +60,12 @@ static int unpack_file(FILE *pack) {
char_array_0(fn);
truncate_nl(fn);
- if ((fd = open(fn, O_RDONLY|O_CLOEXEC|O_NOATIME|O_NOCTTY|O_NOFOLLOW)) < 0)
- log_warning("open(%s) failed: %m", fn);
- else if (file_verify(fd, fn, arg_file_size_max, &st) <= 0) {
+ if ((fd = open(fn, O_RDONLY|O_CLOEXEC|O_NOATIME|O_NOCTTY|O_NOFOLLOW)) < 0) {
+
+ if (errno != ENOENT)
+ log_warning("open(%s) failed: %m", fn);
+
+ } else if (file_verify(fd, fn, arg_file_size_max, &st) <= 0) {
close_nointr_nofail(fd);
fd = -1;
}
@@ -136,7 +139,7 @@ static int replay(const char *root) {
}
if ((!(pack = fopen(pack_fn, "re")))) {
- if (errno == -ENOENT)
+ if (errno == ENOENT)
log_debug("No pack file found.");
else {
log_error("Failed to open pack file: %m");
diff --git a/src/service.c b/src/service.c
index 429b53d4f8..a28eb8a6b9 100644
--- a/src/service.c
+++ b/src/service.c
@@ -65,7 +65,7 @@ static const struct {
{ "boot.d", SPECIAL_SYSINIT_TARGET, RUNLEVEL_SYSINIT },
#endif
-#if defined(TARGET_DEBIAN) || defined(TARGET_UBUNTU)
+#if defined(TARGET_DEBIAN) || defined(TARGET_UBUNTU) || defined(TARGET_FRUGALWARE)
/* Debian style rcS.d */
{ "rcS.d", SPECIAL_SYSINIT_TARGET, RUNLEVEL_SYSINIT },
#endif
@@ -237,17 +237,26 @@ static char *sysv_translate_name(const char *name) {
if (!(r = new(char, strlen(name) + sizeof(".service"))))
return NULL;
+#if defined(TARGET_DEBIAN) || defined(TARGET_UBUNTU)
+ if (endswith(name, ".sh"))
+ /* Drop Debian-style .sh suffix */
+ strcpy(stpcpy(r, name) - 3, ".service");
+#endif
+#ifdef TARGET_SUSE
if (startswith(name, "boot."))
/* Drop SuSE-style boot. prefix */
strcpy(stpcpy(r, name + 5), ".service");
- else if (endswith(name, ".sh"))
- /* Drop Debian-style .sh suffix */
- strcpy(stpcpy(r, name) - 3, ".service");
+#endif
#ifdef TARGET_ARCH
- else if (startswith(name, "@"))
+ if (startswith(name, "@"))
/* Drop Arch-style background prefix */
strcpy(stpcpy(r, name + 1), ".service");
#endif
+#ifdef TARGET_FRUGALWARE
+ if (startswith(name, "rc."))
+ /* Drop Frugalware-style rc. prefix */
+ strcpy(stpcpy(r, name + 3), ".service");
+#endif
else
/* Normal init scripts */
strcpy(stpcpy(r, name), ".service");
@@ -273,23 +282,24 @@ static int sysv_translate_facility(const char *name, const char *filename, char
"syslog", SPECIAL_SYSLOG_TARGET,
"time", SPECIAL_RTC_SET_TARGET,
- /* Debian extensions */
+ /* common extensions */
+ "mail-transfer-agent", SPECIAL_MAIL_TRANSFER_AGENT_TARGET,
+ "x-display-manager", SPECIAL_DISPLAY_MANAGER_SERVICE,
+ "null", NULL,
+
#if defined(TARGET_DEBIAN) || defined(TARGET_UBUNTU)
"mail-transport-agent", SPECIAL_MAIL_TRANSFER_AGENT_TARGET,
#endif
- "mail-transfer-agent", SPECIAL_MAIL_TRANSFER_AGENT_TARGET,
- "x-display-manager", SPECIAL_DISPLAY_MANAGER_SERVICE,
#ifdef TARGET_FEDORA
- /* Fedora extensions */
"MTA", SPECIAL_MAIL_TRANSFER_AGENT_TARGET,
"smtpdaemon", SPECIAL_MAIL_TRANSFER_AGENT_TARGET,
"httpd", SPECIAL_HTTP_DAEMON_TARGET,
#endif
- /* SuSE extensions */
- "null", NULL
-
+#ifdef TARGET_SUSE
+ "smtp", SPECIAL_MAIL_TRANSFER_AGENT_TARGET,
+#endif
};
unsigned i;
@@ -318,10 +328,13 @@ static int sysv_translate_facility(const char *name, const char *filename, char
/* If we don't know this name, fallback heuristics to figure
* out whether something is a target or a service alias. */
- if (*name == '$')
+ if (*name == '$') {
+ if (!unit_prefix_is_valid(n))
+ return -EINVAL;
+
/* Facilities starting with $ are most likely targets */
r = unit_name_build(n, NULL, ".target");
- else if (filename && streq(name, filename))
+ } else if (filename && streq(name, filename))
/* Names equalling the file name of the services are redundant */
return 0;
else
@@ -674,10 +687,14 @@ static int service_load_sysv_path(Service *s, const char *path) {
}
r = sysv_translate_facility(n, file_name_from_path(path), &m);
- free(n);
- if (r < 0)
- goto finish;
+ if (r < 0) {
+ log_error("[%s:%u] Failed to translate LSB dependency %s, ignoring: %s", path, line, n, strerror(-r));
+ free(n);
+ continue;
+ }
+
+ free(n);
if (r == 0)
continue;
@@ -849,11 +866,22 @@ static int service_load_sysv_name(Service *s, const char *name) {
assert(s);
assert(name);
- /* For SysV services we strip the boot. or .sh
+ /* For SysV services we strip the boot.*, rc.* and *.sh
* prefixes/suffixes. */
- if (startswith(name, "boot.") ||
- endswith(name, ".sh.service"))
+#if defined(TARGET_DEBIAN) || defined(TARGET_UBUNTU)
+ if (endswith(name, ".sh.service"))
return -ENOENT;
+#endif
+
+#ifdef TARGET_SUSE
+ if (startswith(name, "boot."))
+ return -ENOENT;
+#endif
+
+#ifdef TARGET_FRUGALWARE
+ if (startswith(name, "rc."))
+ return -ENOENT;
+#endif
STRV_FOREACH(p, s->meta.manager->lookup_paths.sysvinit_path) {
char *path;
@@ -867,24 +895,42 @@ static int service_load_sysv_name(Service *s, const char *name) {
r = service_load_sysv_path(s, path);
+#if defined(TARGET_DEBIAN) || defined(TARGET_UBUNTU)
if (r >= 0 && s->meta.load_state == UNIT_STUB) {
- /* Try Debian style xxx.sh source'able init scripts */
+ /* Try Debian style *.sh source'able init scripts */
strcat(path, ".sh");
r = service_load_sysv_path(s, path);
}
-
+#endif
free(path);
+#ifdef TARGET_SUSE
if (r >= 0 && s->meta.load_state == UNIT_STUB) {
- /* Try SUSE style boot.xxx init scripts */
+ /* Try SUSE style boot.* init scripts */
if (asprintf(&path, "%s/boot.%s", *p, name) < 0)
return -ENOMEM;
+ /* Drop .service suffix */
+ path[strlen(path)-8] = 0;
+ r = service_load_sysv_path(s, path);
+ free(path);
+ }
+#endif
+
+#ifdef TARGET_FRUGALWARE
+ if (r >= 0 && s->meta.load_state == UNIT_STUB) {
+ /* Try Frugalware style rc.* init scripts */
+
+ if (asprintf(&path, "%s/rc.%s", *p, name) < 0)
+ return -ENOMEM;
+
+ /* Drop .service suffix */
path[strlen(path)-8] = 0;
r = service_load_sysv_path(s, path);
free(path);
}
+#endif
if (r < 0)
return r;
diff --git a/src/shutdown.c b/src/shutdown.c
index 11c7544fc7..10d8413092 100644
--- a/src/shutdown.c
+++ b/src/shutdown.c
@@ -362,7 +362,6 @@ int main(int argc, char *argv[]) {
r = -errno;
error:
- sync();
log_error("Critical error while doing system shutdown: %s", strerror(-r));
freeze();
diff --git a/src/strv.c b/src/strv.c
index d9aef98224..d1c7b2c32d 100644
--- a/src/strv.c
+++ b/src/strv.c
@@ -380,7 +380,7 @@ static int env_append(char **r, char ***k, char **a) {
/* Add the entries of a to *k unless they already exist in *r
* in which case they are overriden instead. This assumes
- * there is enough space in the r */
+ * there is enough space in the r array. */
for (; *a; a++) {
char **j;
@@ -556,3 +556,24 @@ char *strv_env_get_with_length(char **l, const char *name, size_t k) {
char *strv_env_get(char **l, const char *name) {
return strv_env_get_with_length(l, name, strlen(name));
}
+
+char **strv_env_clean(char **l) {
+ char **r, **ret;
+
+ for (r = ret = l; *l; l++) {
+ const char *equal;
+
+ equal = strchr(*l, '=');
+
+ if (equal && equal[1] == 0) {
+ free(*l);
+ continue;
+ }
+
+ *(r++) = *l;
+ }
+
+ *r = NULL;
+
+ return ret;
+}
diff --git a/src/strv.h b/src/strv.h
index 1103e194c3..5af84ee41f 100644
--- a/src/strv.h
+++ b/src/strv.h
@@ -63,6 +63,8 @@ char **strv_env_set(char **x, const char *p);
char *strv_env_get_with_length(char **l, const char *name, size_t k);
char *strv_env_get(char **x, const char *n);
+char **strv_env_clean(char **l);
+
#define STRV_FOREACH(s, l) \
for ((s) = (l); (s) && *(s); (s)++)
diff --git a/src/sysctl.c b/src/sysctl.c
index 6b0e9aa3ba..38ea2d18bc 100644
--- a/src/sysctl.c
+++ b/src/sysctl.c
@@ -53,7 +53,9 @@ static void apply_sysctl(const char *property, const char *value) {
*n = '/';
if ((r = write_one_line_file(p, value)) < 0) {
- log_warning("Failed to write '%s' to '%s': %s", value, p, strerror(-r));
+
+ log_full(r == -ENOENT ? LOG_DEBUG : LOG_WARNING,
+ "Failed to write '%s' to '%s': %s", value, p, strerror(-r));
if (r != -ENOENT)
exit_code = r;
diff --git a/src/systemctl.c b/src/systemctl.c
index 4768fb20ad..4f4ee96172 100644
--- a/src/systemctl.c
+++ b/src/systemctl.c
@@ -65,6 +65,7 @@ static bool arg_user = false;
static bool arg_global = false;
static bool arg_immediate = false;
static bool arg_no_block = false;
+static bool arg_no_pager = false;
static bool arg_no_wtmp = false;
static bool arg_no_sync = false;
static bool arg_no_wall = false;
@@ -109,11 +110,20 @@ static enum dot {
static bool private_bus = false;
+static pid_t pager_pid = 0;
+
static int daemon_reload(DBusConnection *bus, char **args, unsigned n);
+static void pager_open(void);
static bool on_tty(void) {
static int t = -1;
+ /* Note that this is invoked relatively early, before we start
+ * the pager. That means the value we return reflects whether
+ * we originally were started on a tty, not if we currently
+ * are. But this is intended, since we want color, and so on
+ * when run in our own pager. */
+
if (_unlikely_(t < 0))
t = isatty(STDOUT_FILENO) > 0;
@@ -418,6 +428,8 @@ static int list_units(DBusConnection *bus, char **args, unsigned n) {
assert(bus);
+ pager_open();
+
if (!(m = dbus_message_new_method_call(
"org.freedesktop.systemd1",
"/org/freedesktop/systemd1",
@@ -764,6 +776,8 @@ static int list_jobs(DBusConnection *bus, char **args, unsigned n) {
assert(bus);
+ pager_open();
+
if (!(m = dbus_message_new_method_call(
"org.freedesktop.systemd1",
"/org/freedesktop/systemd1",
@@ -2474,6 +2488,9 @@ static int show(DBusConnection *bus, char **args, unsigned n) {
show_properties = !streq(args[0], "status");
+ if (show_properties)
+ pager_open();
+
if (show_properties && n <= 1) {
/* If not argument is specified inspect the manager
* itself */
@@ -2857,6 +2874,8 @@ static int dump(DBusConnection *bus, char **args, unsigned n) {
dbus_error_init(&error);
+ pager_open();
+
if (!(m = dbus_message_new_method_call(
"org.freedesktop.systemd1",
"/org/freedesktop/systemd1",
@@ -3219,6 +3238,8 @@ static int show_enviroment(DBusConnection *bus, char **args, unsigned n) {
dbus_error_init(&error);
+ pager_open();
+
if (!(m = dbus_message_new_method_call(
"org.freedesktop.systemd1",
"/org/freedesktop/systemd1",
@@ -4110,6 +4131,7 @@ static int systemctl_help(void) {
" pending\n"
" -q --quiet Suppress output\n"
" --no-block Do not wait until operation finished\n"
+ " --no-pager Do not pipe output into a pager.\n"
" --system Connect to system manager\n"
" --user Connect to user service manager\n"
" --order When generating graph for dot, show only order\n"
@@ -4249,6 +4271,7 @@ static int systemctl_parse_argv(int argc, char *argv[]) {
ARG_SYSTEM,
ARG_GLOBAL,
ARG_NO_BLOCK,
+ ARG_NO_PAGER,
ARG_NO_WALL,
ARG_ORDER,
ARG_REQUIRE,
@@ -4272,6 +4295,7 @@ static int systemctl_parse_argv(int argc, char *argv[]) {
{ "system", no_argument, NULL, ARG_SYSTEM },
{ "global", no_argument, NULL, ARG_GLOBAL },
{ "no-block", no_argument, NULL, ARG_NO_BLOCK },
+ { "no-pager", no_argument, NULL, ARG_NO_PAGER },
{ "no-wall", no_argument, NULL, ARG_NO_WALL },
{ "quiet", no_argument, NULL, 'q' },
{ "order", no_argument, NULL, ARG_ORDER },
@@ -4348,6 +4372,10 @@ static int systemctl_parse_argv(int argc, char *argv[]) {
arg_no_block = true;
break;
+ case ARG_NO_PAGER:
+ arg_no_pager = true;
+ break;
+
case ARG_NO_WALL:
arg_no_wall = true;
break;
@@ -5274,6 +5302,81 @@ static int runlevel_main(void) {
return 0;
}
+static void pager_open(void) {
+ int fd[2];
+ const char *pager;
+
+ if (pager_pid > 0)
+ return;
+
+ if (!on_tty() || arg_no_pager)
+ return;
+
+ if ((pager = getenv("PAGER")))
+ if (!*pager || streq(pager, "cat"))
+ return;
+
+ if (pipe(fd) < 0) {
+ log_error("Failed to create pager pipe: %m");
+ return;
+ }
+
+ pager_pid = fork();
+ if (pager_pid < 0) {
+ log_error("Failed to fork pager: %m");
+ close_pipe(fd);
+ return;
+ }
+
+ /* In the child start the pager */
+ if (pager_pid == 0) {
+
+ dup2(fd[0], STDIN_FILENO);
+ close_pipe(fd);
+
+ setenv("LESS", "FRSX", 0);
+
+ prctl(PR_SET_PDEATHSIG, SIGTERM);
+
+ if (pager) {
+ execlp(pager, pager, NULL);
+ execl("/bin/sh", "sh", "-c", pager, NULL);
+ } else {
+ /* Debian's alternatives command for pagers is
+ * called 'pager'. Note that we do not call
+ * sensible-pagers here, since that is just a
+ * shell script that implements a logic that
+ * is similar to this one anyway, but is
+ * Debian-specific. */
+ execlp("pager", "pager", NULL);
+
+ execlp("less", "less", NULL);
+ execlp("more", "more", NULL);
+ }
+
+ log_error("Unable to execute pager: %m");
+ _exit(EXIT_FAILURE);
+ }
+
+ /* Return in the parent */
+ if (dup2(fd[1], STDOUT_FILENO) < 0)
+ log_error("Failed to duplicate pager pipe: %m");
+
+ close_pipe(fd);
+}
+
+static void pager_close(void) {
+ siginfo_t dummy;
+
+ if (pager_pid <= 0)
+ return;
+
+ /* Inform pager that we are done */
+ fclose(stdout);
+ wait_for_terminate(pager_pid, &dummy);
+ pager_pid = 0;
+}
+
int main(int argc, char*argv[]) {
int r, retval = EXIT_FAILURE;
DBusConnection *bus = NULL;
@@ -5354,5 +5457,7 @@ finish:
strv_free(arg_property);
+ pager_close();
+
return retval;
}
diff --git a/src/test-env-replace.c b/src/test-env-replace.c
index e8c9dbf736..4188c67dde 100644
--- a/src/test-env-replace.c
+++ b/src/test-env-replace.c
@@ -47,7 +47,7 @@ int main(int argc, char *argv[]) {
NULL
};
- char **i, **r;
+ char **i, **r, *t, **a, **b;
r = replace_env_argv((char**) line, (char**) env);
@@ -56,4 +56,64 @@ int main(int argc, char *argv[]) {
strv_free(r);
+ t = normalize_env_assignment("foo=bar");
+ printf("%s\n", t);
+ free(t);
+
+ t = normalize_env_assignment("=bar");
+ printf("%s\n", t);
+ free(t);
+
+ t = normalize_env_assignment("foo=");
+ printf("%s\n", t);
+ free(t);
+
+ t = normalize_env_assignment("=");
+ printf("%s\n", t);
+ free(t);
+
+ t = normalize_env_assignment("");
+ printf("%s\n", t);
+ free(t);
+
+ t = normalize_env_assignment("a=\"waldo\"");
+ printf("%s\n", t);
+ free(t);
+
+ t = normalize_env_assignment("a=\"waldo");
+ printf("%s\n", t);
+ free(t);
+
+ t = normalize_env_assignment("a=waldo\"");
+ printf("%s\n", t);
+ free(t);
+
+ t = normalize_env_assignment("a=\'");
+ printf("%s\n", t);
+ free(t);
+
+ t = normalize_env_assignment("a=\'\'");
+ printf("%s\n", t);
+ free(t);
+
+ a = strv_new("FOO=BAR", "WALDO=WALDO", "WALDO=", "PIEP", "SCHLUMPF=SMURF", NULL);
+ b = strv_new("FOO=KKK", "FOO=", "PIEP=", "SCHLUMPF=SMURFF", "NANANANA=YES", NULL);
+
+ r = strv_env_merge(2, a, b);
+ strv_free(a);
+ strv_free(b);
+
+ STRV_FOREACH(i, r)
+ printf("%s\n", *i);
+
+ printf("CLEANED UP:\n");
+
+ r = strv_env_clean(r);
+
+ STRV_FOREACH(i, r)
+ printf("%s\n", *i);
+
+ strv_free(r);
+
+ return 0;
}
diff --git a/src/test-strv.c b/src/test-strv.c
index cfbf7fddc9..1d577dfd3c 100644
--- a/src/test-strv.c
+++ b/src/test-strv.c
@@ -20,9 +20,17 @@
***/
#include <string.h>
+
#include "util.h"
+#include "specifier.h"
int main(int argc, char *argv[]) {
+ const Specifier table[] = {
+ { 'a', specifier_string, (char*) "AAAA" },
+ { 'b', specifier_string, (char*) "BBBB" },
+ { 0, NULL, NULL }
+ };
+
char *w, *state;
size_t l;
const char test[] = "test a b c 'd' e '' '' hhh '' ''";
@@ -50,5 +58,9 @@ int main(int argc, char *argv[]) {
printf("%s\n", default_term_for_tty("pts/0"));
printf("%s\n", default_term_for_tty("console"));
+ w = specifier_printf("xxx a=%a b=%b yyy", table, NULL);
+ printf("<%s>\n", w);
+ free(w);
+
return 0;
}
diff --git a/src/tmpfiles.c b/src/tmpfiles.c
index 120236c5cc..984eaf0de1 100644
--- a/src/tmpfiles.c
+++ b/src/tmpfiles.c
@@ -149,7 +149,7 @@ static int dir_cleanup(
DIR *sub_dir;
int q;
- sub_dir = xopendirat(dirfd(d), dent->d_name);
+ sub_dir = xopendirat(dirfd(d), dent->d_name, O_NOFOLLOW);
if (sub_dir == NULL) {
if (errno != ENOENT) {
log_error("opendir(%s/%s) failed: %m", p, dent->d_name);
@@ -591,6 +591,12 @@ static int parse_line(const char *fname, unsigned line, const char *buffer, cons
}
if ((r = hashmap_put(items, i->path, i)) < 0) {
+ if (r == -EEXIST) {
+ log_warning("Two or more conflicting lines for %s configured, ignoring.", i->path);
+ r = 0;
+ goto finish;
+ }
+
log_error("Failed to insert item %s: %s", i->path, strerror(-r));
goto finish;
}
diff --git a/src/umount.c b/src/umount.c
index 2ae8f86ecd..4fd6b22ad7 100644
--- a/src/umount.c
+++ b/src/umount.c
@@ -466,12 +466,24 @@ static int swap_points_list_off(MountPoint **head, bool *changed) {
static int loopback_points_list_detach(MountPoint **head, bool *changed) {
MountPoint *m, *n;
- int n_failed = 0;
+ int n_failed = 0, k;
+ struct stat root_st;
assert(head);
+ k = lstat("/", &root_st);
+
LIST_FOREACH_SAFE(mount_point, m, n, *head) {
int r;
+ struct stat loopback_st;
+
+ if (k >= 0 &&
+ major(root_st.st_dev) != 0 &&
+ lstat(m->path, &loopback_st) >= 0 &&
+ root_st.st_dev == loopback_st.st_rdev) {
+ n_failed ++;
+ continue;
+ }
if ((r = delete_loopback(m->path)) >= 0) {
@@ -490,13 +502,23 @@ static int loopback_points_list_detach(MountPoint **head, bool *changed) {
static int dm_points_list_detach(MountPoint **head, bool *changed) {
MountPoint *m, *n;
- int n_failed = 0;
+ int n_failed = 0, k;
+ struct stat root_st;
assert(head);
+ k = lstat("/", &root_st);
+
LIST_FOREACH_SAFE(mount_point, m, n, *head) {
int r;
+ if (k >= 0 &&
+ major(root_st.st_dev) != 0 &&
+ root_st.st_dev == m->devnum) {
+ n_failed ++;
+ continue;
+ }
+
if ((r = delete_dm(m->devnum)) >= 0) {
if (r > 0 && changed)
diff --git a/src/util.c b/src/util.c
index 0cd78f6561..67a75c5702 100644
--- a/src/util.c
+++ b/src/util.c
@@ -3047,12 +3047,20 @@ void status_welcome(void) {
#elif defined(TARGET_DEBIAN)
if (!pretty_name) {
- if ((r = read_one_line_file("/etc/debian_version", &pretty_name)) < 0) {
+ char *version;
+
+ if ((r = read_one_line_file("/etc/debian_version", &version)) < 0) {
if (r != -ENOENT)
log_warning("Failed to read /etc/debian_version: %s", strerror(-r));
- } else
- truncate_nl(pretty_name);
+ } else {
+ truncate_nl(version);
+ pretty_name = strappend("Debian ", version);
+ free(version);
+
+ if (!pretty_name)
+ log_warning("Failed to allocate Debian version string.");
+ }
}
if (!ansi_color)
@@ -3071,13 +3079,6 @@ void status_welcome(void) {
if (!ansi_color)
const_color = "0;33"; /* Orange/Brown for Ubuntu */
-#elif defined(TARGET_ARCH)
-
- if (!pretty_name)
- const_pretty = "Arch Linux";
-
- if (!ansi_color)
- const_color = "1;36"; /* Cyan for Arch */
#endif
if (!pretty_name && !const_pretty)
@@ -3089,6 +3090,9 @@ void status_welcome(void) {
status_printf("Welcome to \x1B[%sm%s\x1B[0m!\n",
const_color ? const_color : ansi_color,
const_pretty ? const_pretty : pretty_name);
+
+ free(ansi_color);
+ free(pretty_name);
}
char *replace_env(const char *format, char **env) {
@@ -3325,6 +3329,44 @@ char *unquote(const char *s, const char* quotes) {
return strdup(s);
}
+char *normalize_env_assignment(const char *s) {
+ char *name, *value, *p, *r;
+
+ p = strchr(s, '=');
+
+ if (!p) {
+ if (!(r = strdup(s)))
+ return NULL;
+
+ return strstrip(r);
+ }
+
+ if (!(name = strndup(s, p - s)))
+ return NULL;
+
+ if (!(p = strdup(p+1))) {
+ free(name);
+ return NULL;
+ }
+
+ value = unquote(strstrip(p), QUOTES);
+ free(p);
+
+ if (!value) {
+ free(p);
+ free(name);
+ return NULL;
+ }
+
+ if (asprintf(&r, "%s=%s", name, value) < 0)
+ r = NULL;
+
+ free(value);
+ free(name);
+
+ return r;
+}
+
int wait_for_terminate(pid_t pid, siginfo_t *status) {
assert(pid >= 1);
assert(status);
@@ -3378,6 +3420,8 @@ int wait_for_terminate_and_warn(const char *name, pid_t pid) {
}
void freeze(void) {
+ sync();
+
for (;;)
pause();
}
@@ -3394,8 +3438,19 @@ bool null_or_empty(struct stat *st) {
return false;
}
-DIR *xopendirat(int fd, const char *name) {
- return fdopendir(openat(fd, name, O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC));
+DIR *xopendirat(int fd, const char *name, int flags) {
+ int nfd;
+ DIR *d;
+
+ if ((nfd = openat(fd, name, O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC|flags)) < 0)
+ return NULL;
+
+ if (!(d = fdopendir(nfd))) {
+ close_nointr_nofail(nfd);
+ return NULL;
+ }
+
+ return d;
}
int signal_from_string_try_harder(const char *s) {
@@ -3518,7 +3573,7 @@ const char *default_term_for_tty(const char *tty) {
/* FIXME: Proper handling of /dev/console would be cool */
- return "TERM=vt100-nav";
+ return "TERM=vt100";
}
static const char *const ioprio_class_table[] = {
diff --git a/src/util.h b/src/util.h
index 7e1eacc687..e9ad881e9c 100644
--- a/src/util.h
+++ b/src/util.h
@@ -355,6 +355,7 @@ char *ellipsize(const char *s, unsigned length, unsigned percent);
int touch(const char *path);
char *unquote(const char *s, const char *quotes);
+char *normalize_env_assignment(const char *s);
int wait_for_terminate(pid_t pid, siginfo_t *status);
int wait_for_terminate_and_warn(const char *name, pid_t pid);
@@ -363,7 +364,7 @@ _noreturn_ void freeze(void);
bool null_or_empty(struct stat *st);
-DIR *xopendirat(int dirfd, const char *name);
+DIR *xopendirat(int dirfd, const char *name, int flags);
void dual_timestamp_serialize(FILE *f, const char *name, dual_timestamp *t);
void dual_timestamp_deserialize(const char *value, dual_timestamp *t);
diff --git a/src/vconsole-setup.c b/src/vconsole-setup.c
index 27e417886c..d05c277ad9 100644
--- a/src/vconsole-setup.c
+++ b/src/vconsole-setup.c
@@ -267,6 +267,19 @@ int main(int argc, char **argv) {
log_warning("Failed to read /etc/rc.conf: %s", strerror(-r));
}
+#elif defined(TARGET_FRUGALWARE)
+ if ((r = parse_env_file("/etc/sysconfig/keymap", NEWLINE,
+ "keymap", &vc_keymap,
+ NULL)) < 0) {
+ if (r != -ENOENT)
+ log_warning("Failed to read /etc/sysconfig/keymap: %s", strerror(-r));
+ }
+ if ((r = parse_env_file("/etc/sysconfig/font", NEWLINE,
+ "font", &vc_font,
+ NULL)) < 0) {
+ if (r != -ENOENT)
+ log_warning("Failed to read /etc/sysconfig/font: %s", strerror(-r));
+ }
#elif defined(TARGET_GENTOO)
if ((r = parse_env_file("/etc/rc.conf", NEWLINE,
"unicode", &vc_unicode,
diff --git a/systemd.pc.in b/systemd.pc.in
index b5230f6bf9..204991309b 100644
--- a/systemd.pc.in
+++ b/systemd.pc.in
@@ -8,9 +8,9 @@
prefix=@prefix@
exec_prefix=${prefix}
systemdsystemunitdir=@systemunitdir@
-systemdsessionunitdir=@pkgdatadir@/session
+systemduserunitdir=@pkgdatadir@/user
systemdsystemconfdir=@pkgsysconfdir@/system
-systemdsessionconfdir=@pkgsysconfdir@/session
+systemduserconfdir=@pkgsysconfdir@/user
Name: systemd
Description: systemd System and Service Manager
diff --git a/units/getty@.service.m4 b/units/getty@.service.m4
index 902ab6e053..74ec1f30d5 100644
--- a/units/getty@.service.m4
+++ b/units/getty@.service.m4
@@ -15,6 +15,9 @@ After=rc-local.service
m4_ifdef(`TARGET_ARCH',
After=rc-local.service
)m4_dnl
+m4_ifdef(`TARGET_FRUGALWARE',
+After=local.service
+)m4_dnl
# If additional gettys are spawned during boot then we should make
# sure that this is synchronized before getty.target, even though
@@ -29,6 +32,10 @@ RestartSec=0
UtmpIdentifier=%I
KillMode=process-group
+# Unset locale for the console getty since the console has problems
+# displaying some internationalized messages.
+Environment=LANG= LC_CTYPE= LC_NUMERIC= LC_TIME= LC_COLLATE= LC_MONETARY= LC_MESSAGE= LC_PAPER= LC_NAME= LC_ADDRESS= LC_TELEPHONE= LC_MEASUREMENT= LC_IDENTIFICATION=
+
# Some login implementations ignore SIGTERM, so we send SIGHUP
# instead, to ensure that login terminates cleanly.
KillSignal=SIGHUP
diff --git a/units/hwclock-load.service b/units/hwclock-load.service
index 4deb5c10c7..51f255e2ab 100644
--- a/units/hwclock-load.service
+++ b/units/hwclock-load.service
@@ -18,7 +18,7 @@ RemainAfterExit=yes
ExecStart=/sbin/hwclock --systz
StandardOutput=syslog
-# Note the weird semantics if hwclock and the kernel here: the first
+# Note the weird semantics of hwclock and the kernel here: the first
# settimeofday() invocation from userspace is special and may be used
# to set the offset from UTC of the system clock. It is independent
# of any specific RTC device. This is mostly a crufty hack to support
diff --git a/units/serial-getty@.service.m4 b/units/serial-getty@.service.m4
index b6ca80bc97..b3bc37ed2a 100644
--- a/units/serial-getty@.service.m4
+++ b/units/serial-getty@.service.m4
@@ -22,7 +22,7 @@ After=rc-local.service
Before=getty.target
[Service]
-Environment=TERM=vt100-nav
+Environment=TERM=vt100
m4_ifdef(`TARGET_FEDORA',
ExecStartPre=-/sbin/securetty %I
)m4_dnl