Systemd/src
Zbigniew Jędrzejewski-Szmek 8b89628a10 core/execute: set HOME, USER also for root users
This changes the environment for services running as root from:

LANG=C.utf8
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin
INVOCATION_ID=ffbdec203c69499a9b83199333e31555
JOURNAL_STREAM=8:1614518

to

LANG=C.utf8
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin
HOME=/root
LOGNAME=root
USER=root
SHELL=/bin/sh
INVOCATION_ID=15a077963d7b4ca0b82c91dc6519f87c
JOURNAL_STREAM=8:1616718

Making the environment special for the root user complicates things
unnecessarily. This change simplifies both our logic (by making the setting
of the variables unconditional), and should also simplify the logic in
services (particularly scripts).

Fixes #5124.
2017-02-03 11:49:22 -05:00
..
ac-power
activate tree-wide: set SA_RESTART for signal handlers we install 2016-12-01 12:41:17 +01:00
analyze analyze: fix build without seccomp 2016-11-10 10:12:31 +01:00
ask-password
backlight tree-wide: drop NULL sentinel from strjoin 2016-10-23 11:43:27 -04:00
basic time-util: Fix overflow check introduce in commit f977849 (#5216) 2017-02-03 16:13:55 +01:00
binfmt
boot Revert "Trivial typo fixes and code refactorings (#5191)" 2017-02-01 10:26:50 -05:00
cgls cgls: --machine= expects an argument, indicate that in log messages 2017-02-02 20:12:32 +01:00
cgroups-agent
cgtop cgtop: use common function to query cgroup root 2017-02-01 20:29:09 -05:00
core core/execute: set HOME, USER also for root users 2017-02-03 11:49:22 -05:00
coredump coredump: really extract container cmdline (#5167) 2017-01-31 11:04:20 -05:00
cryptsetup Revert "Trivial typo fixes and code refactorings (#5191)" 2017-02-01 10:26:50 -05:00
dbus1-generator
debug-generator util-lib: various improvements to kernel command line parsing 2016-12-21 19:09:08 +01:00
delta tree-wide: replace all readdir cycles with FOREACH_DIRENT{,_ALL} (#4853) 2016-12-09 10:04:30 +01:00
detect-virt detect-virt: add --private-users switch to check if a userns is active 2016-10-26 20:12:51 -04:00
dissect dissect: make using a generic partition as root partition optional 2016-12-21 19:09:30 +01:00
escape tree-wide: drop NULL sentinel from strjoin 2016-10-23 11:43:27 -04:00
firstboot util-lib: various improvements to kernel command line parsing 2016-12-21 19:09:08 +01:00
fsck util-lib: various improvements to kernel command line parsing 2016-12-21 19:09:08 +01:00
fstab-generator verity: add support for setting up verity-protected root disks in the initrd 2016-12-21 19:09:30 +01:00
getty-generator
gpt-auto-generator fs-util: unify code we use to check if dirent's d_name is "." or ".." 2017-02-02 00:06:18 +01:00
hibernate-resume util-lib: various improvements to kernel command line parsing 2016-12-21 19:09:08 +01:00
hostname build-sys,hostnamed: allow distributions to override the "localhost" fallback 2017-01-27 23:36:01 -05:00
hwdb hwdb: emit warning when matches are specified at the very end of file 2016-12-11 18:01:26 -05:00
import importd: automatically download .roothash in addition to .nspawn for raw downloads 2016-12-21 19:09:31 +01:00
initctl Rename formats-util.h to format-util.h 2016-11-07 10:15:08 -05:00
journal Merge pull request #5204 from keszybz/masked-warning-cleanup 2017-02-02 11:47:30 +01:00
journal-remote Merge pull request #5166 from keszybz/gcc7 2017-02-01 12:02:50 +03:00
kernel-install kernel-install: avoid process substitution 2017-01-11 15:34:54 -05:00
libsystemd Consistently use ERFKILL for masked units 2017-02-01 19:47:23 -05:00
libsystemd-network tree-wide: adjust fall through comments so that gcc is happy 2017-01-31 14:04:55 -05:00
libudev udev-event: use in-place whitespace replacement 2017-01-27 07:58:00 -05:00
locale tree-wide: drop NULL sentinel from strjoin 2016-10-23 11:43:27 -04:00
login logind: Don't try to emit a change signal for the 'Sessions' property (#5211) 2017-02-02 20:39:26 -05:00
machine shared/cgroup-show: extract funtion to query unit cgroup path 2017-02-01 20:31:50 -05:00
machine-id-setup machine-id-setup: --print --commit respects the --root option 2016-12-13 13:03:13 +00:00
modules-load util-lib: various improvements to kernel command line parsing 2016-12-21 19:09:08 +01:00
mount tree-wide: drop NULL sentinel from strjoin 2016-10-23 11:43:27 -04:00
network networkd: Allow ':' in label 2017-01-25 00:07:52 +05:30
notify Rename formats-util.h to format-util.h 2016-11-07 10:15:08 -05:00
nspawn nspawn: shown exec() command is misleading 2017-02-02 20:10:28 +01:00
nss-myhostname
nss-mymachines nss: when we encounter an invalid user/group name or UID/GID, don't return EINVAL 2016-12-27 18:09:58 +01:00
nss-resolve nss-resolve: be a bit more careful with returning NSS_STATUS_NOTFOUND 2016-10-24 19:04:43 +02:00
nss-systemd nss: when we encounter an invalid user/group name or UID/GID, don't return EINVAL 2016-12-27 18:09:58 +01:00
path
quotacheck qutoacheck,gpt-auto-generator: trivial coding style improvements 2016-12-21 19:09:28 +01:00
random-seed
rc-local-generator tree-wide: drop NULL sentinel from strjoin 2016-10-23 11:43:27 -04:00
remount-fs tree-wide: always invoke setmntent() with "re" mode 2016-12-20 20:00:09 +01:00
reply-password
resolve fs-util: unify code we use to check if dirent's d_name is "." or ".." 2017-02-02 00:06:18 +01:00
rfkill tree-wide: drop NULL sentinel from strjoin 2016-10-23 11:43:27 -04:00
run Rename formats-util.h to format-util.h 2016-11-07 10:15:08 -05:00
shared Merge pull request #5213 from keszybz/systemctl-root-cat 2017-02-03 11:02:28 +01:00
sleep
socket-proxy socket-proxyd: fix --connections-max help message and docs (#5044) 2017-01-10 08:55:50 +01:00
stdio-bridge
sysctl sysctl: minor simplification 2016-11-02 11:39:48 -06:00
system-update-generator system-update-generator: warn if the command line blocks updates (#5173) 2017-02-01 21:50:03 +01:00
systemctl Merge pull request #5213 from keszybz/systemctl-root-cat 2017-02-03 11:02:28 +01:00
systemd Add sd_is_socket_sockaddr (#4885) 2016-12-14 11:51:26 +01:00
sysusers Rename formats-util.h to format-util.h 2016-11-07 10:15:08 -05:00
sysv-generator sysv-generator: properly translate sysv facilities 2016-12-14 18:29:30 +01:00
test time-util: refuse formatting/parsing times that we can't store 2017-02-02 20:12:31 +01:00
timedate
timesync build-sys: add check for gperf lookup function signature (#5055) 2017-01-10 08:39:05 +01:00
tmpfiles fs-util: unify code we use to check if dirent's d_name is "." or ".." 2017-02-02 00:06:18 +01:00
tty-ask-password-agent core: when determining whether a process exit status is clean, consider whether it is a command or a daemon 2016-10-10 22:57:01 +02:00
udev udev-event: use in-place whitespace replacement 2017-01-27 07:58:00 -05:00
update-done update-done: minor clean-ups 2016-10-24 17:29:51 +02:00
update-utmp Rename formats-util.h to format-util.h 2016-11-07 10:15:08 -05:00
user-sessions
vconsole Merge pull request #4448 from msoltyspl/vcfix 2016-10-26 20:55:18 -04:00
veritysetup tree-wide: remove consecutive duplicate words in comments (#5148) 2017-01-24 21:45:30 -05:00
volatile-root fstab-generator: add support for volatile boots 2016-12-21 19:09:29 +01:00
.gitignore
Makefile