Michal Schmidt
34c38d2aaa
basic: nicer assert messages
...
Make sure the assert expression is not macro-expanded before
stringification. This makes several assertion failure messages more
readable.
As an example:
assert(streq("foo", "bar"));
I'd rather see this:
Assertion 'streq("foo", "bar")' failed at foo.c:5, function main(). Aborting.
...than this, though awesome, incomprehensible truncated mess:
Assertion '(__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p ((
"foo")) && __builtin_constant_p (("bar")) && (__s1_len = strlen (("foo")), __s2_
len = strlen (("bar")), (!((size_t)(const void *)((("foo")) + 1) - (size_t)(cons
t void *)(("foo")) == 1) || __s1_len >= 4) && (!((size_t)(const void *)((("bar")
) + 1) - (size_t)(const void *)(("bar")) == 1) || __s2_len >= 4)) ? __builtin_st
rcmp (("foo"), ("bar")) : (__builtin_constant_p (("foo")) && ((size_t)(const voi
d *)((("foo")) + 1) - (size_t)(const void *)(("foo")) == 1) && (__s1_len = strle
n (("foo")), __s1_len < 4) ? (__builtin_constant_p (("bar")) && ((size_t)(const
void *)((("bar")) + 1) - (size_t)(const void *)(("bar")) == 1) ? __builtin_strcm
p (("foo"), ("bar")) : (__extension__ ({ const unsigned char *__s2 = (const unsi
gned char *) (const char *) (("bar")); int __result = (((const unsigned char *)
(const char *) (("foo")))[0] - __s2[0]); if (__s1_len > 0 && __result == 0) { __
result = (((const unsigned char *) (const char *) (("foo")))[1] - __s2[1]); if (
__s1_len > 1 && __result == 0) { __result = (((const unsigned char *) (const cha
r *) (("foo")))[2] - __s2[2]); if (__s1_len > 2 && __result == 0) __result = (((
const unsigned char *) (const char *) (("foo")))[3] - __s2[3]); } } __result; })
)) : (__builtin_constant_p (("bar")) && ((size_t)(const void *)((("bar")) + 1) -
(size_t)(const void *)(("bar")) == 1) && (__s2_len = strlen (("bar")), __s2_len
< 4) ? (__builtin_constant_p (("foo")) && ((size_t)(const void *)((("foo")) + 1
) - (size_t)(const void *)(("foo")) == 1) ? __builtin_strcmp (("foo"), ("bar"))
: (- (__extension__ ({ const unsigned char *__s2 = (const unsigned char *) (cons
t char *) (("foo")); int __result = (((const unsigned char *) (const char *) (("
bar")))[0] - __s2[0]); if (__s2_len > 0 && __result == 0) { __result = (((const
unsigned char *) (const char *) (("bar")))[1] - __s2[1]); if (__s2_len > 1 && __
result == 0) { __result = (((const unsigned char *) (const char *) (("bar")))[2]
- __s2[2]); if (__s2_len > 2 && __result == 0)
2015-09-16 15:48:00 +02:00
Michal Schmidt
7f39a21045
basic: make sure argument of ELEMENTSOF is an array
...
Using ELEMENTSOF on a pointer will result in a compilation error.
2015-09-16 15:32:25 +02:00
Daniel Mack
ac2896bab6
Merge pull request #1270 from frandieguez/master
...
Add Galician translations
2015-09-15 11:16:06 +02:00
Fran Dieguez
4f95221612
Add Galician language to LINGUAS file
2015-09-15 00:20:51 +02:00
Fran Dieguez
fd59243cf1
Added Galician translations
2015-09-15 00:20:21 +02:00
Lennart Poettering
d801577473
Merge pull request #1250 from g2p/master
...
Hook more properties for transient units
2015-09-14 23:19:03 +02:00
Daniel Mack
e72b93fc7b
Merge pull request #1267 from systemd-mailing-devs/1442233013-14985-1-git-send-email-hdegoede@redhat.com
...
hwdb: Add Thinkpad X1 carbon 3rd gen to 70-pointingstick.hwdb
2015-09-14 17:27:11 +02:00
Hans de Goede
c01705b9ee
hwdb: Add Thinkpad X1 carbon 3rd gen to 70-pointingstick.hwdb
...
Like many other recent thinkpads the factory default pointingstick
sensitivity on these devices is quite low, making the pointingstick
very slow in moving the cursor.
This extends the existing hwdb rules for tweaking the sensitivity to
also apply to the X1 carbon 3rd gen model.
BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1200717
2015-09-14 15:05:05 +02:00
Daniel Mack
0d9f6d4f61
Merge pull request #1259 from martinpitt/master
...
keymap: Add Corsair K70
2015-09-14 10:02:36 +02:00
Martin Pitt
a2aa71a954
keymap: Add Corsair K70
2015-09-14 09:26:19 +02:00
Daniel Mack
5669ef3644
Merge pull request #1251 from poettering/cgroups-cleanup
...
cgroups cleanup + other fixes
2015-09-13 20:44:30 +02:00
Daniel Mack
2d0fd6e1c5
Merge pull request #1253 from victorenator/master
...
po: update Belarusian translation
2015-09-13 19:44:50 +02:00
Viktar Vauchkevich
47130da825
po: update Belarusian translation
2015-09-12 16:47:18 +03:00
Lennart Poettering
e7ab4d1ac9
cgroup: unify how we invalidate cgroup controller settings
...
Let's make sure that we follow the same codepaths when adjusting a
cgroup property via the dbus SetProperty() call, and when we execute the
StartupCPUShares= effect.
2015-09-11 18:31:50 +02:00
Lennart Poettering
1afaa7e8d2
transaction: clarify via void-casting that we ignore the pipe2() return value for a reason
2015-09-11 18:31:50 +02:00
Lennart Poettering
cd72bd8a46
core: invalidate idle pipe event source in manager_close_idle_pipe()
...
In all occasions when this function is called we do so anyway, so let's
move this inside, to make things easier.
2015-09-11 18:31:50 +02:00
Lennart Poettering
c7cc737fce
execute: fix return type from write()
2015-09-11 18:31:49 +02:00
Lennart Poettering
54eb2300ae
execute: invalidate idle pipe after use
...
Not strictly necessary, but makes clear the fds are invalidated. Make
sure we do the same here as in most other cases.
2015-09-11 18:31:49 +02:00
Lennart Poettering
5269eb6b32
core: allocate sets of startup and failed units on-demand
...
There's a good chance we never needs these sets, hence allocate them
only when needed.
2015-09-11 18:31:49 +02:00
Lennart Poettering
aa36007ca1
timesyncd: fix how we print a PID
2015-09-11 18:31:49 +02:00
Lennart Poettering
d53d94743c
core: refactor cpu shares/blockio weight cgroup logic
...
Let's stop using the "unsigned long" type for weights/shares, and let's
just use uint64_t for this, as that's what we expose on the bus.
Unify parsers, and always validate the range for these fields.
Correct the default blockio weight to 500, since that's what the kernel
actually uses.
When parsing the weight/shares settings from unit files accept the empty
string as a way to reset the weight/shares value. When getting it via
the bus, uniformly map (uint64_t) -1 to unset.
Open up StartupCPUShares= and StartupBlockIOWeight= to transient units.
2015-09-11 18:31:49 +02:00
Lennart Poettering
afc966e288
util: remove ring.[ch] + pty.[ch] and tests
...
This was used by consoled, which was removed, let's remove this too now.
2015-09-11 18:28:29 +02:00
Lennart Poettering
5738311653
TODO
2015-09-11 18:28:03 +02:00
Gabriel de Perthuis
b9c50073fc
Hook more properties for transient units
...
systemd-run can now launch units with PrivateTmp, PrivateDevices,
PrivateNetwork, NoNewPrivileges set.
2015-09-11 18:25:41 +02:00
Lennart Poettering
85bc8c64e9
Merge pull request #1248 from lnykryn/loginctl-show-v2
...
loginctl: print nontrivial properties in logictl show-*
2015-09-11 16:28:36 +02:00
Lukas Nykryn
2a998c7402
loginctl: print nontrivial properties in logictl show-*
2015-09-11 16:04:32 +02:00
Lennart Poettering
f20d2634e1
Merge pull request #1245 from evverx/kill-control-on-timeout
...
core: kill processes started due to the ExecReload= on timeout
2015-09-11 14:44:45 +02:00
Evgeny Vereshchagin
478b619281
core: kill processes started due to the ExecReload= on timeout
2015-09-11 11:43:27 +03:00
Lennart Poettering
3227b2bced
Merge pull request #1227 from intelfx/systemctl-legacy-tools-polkit
...
systemctl: fix various aspects of polkit authorization in legacy tools.
2015-09-10 19:53:31 +02:00
Daniel Mack
f70e152ec6
Merge pull request #1222 from poettering/image-ops-settings
...
machine: when removing, renaming, cloning images also care for .nspaw…
2015-09-10 19:18:18 +02:00
Daniel Mack
a18f3caa56
Merge pull request #1239 from poettering/cgroup-pids
...
core: add support for the "pids" cgroup controller
2015-09-10 19:11:29 +02:00
Daniel Mack
786c5bf957
Merge pull request #1242 from poettering/no-off_t
...
Drop usage of off_t
2015-09-10 19:01:25 +02:00
Lennart Poettering
03a7b521e3
core: add support for the "pids" cgroup controller
...
This adds support for the new "pids" cgroup controller of 4.3 kernels.
It allows accounting the number of tasks in a cgroup and enforcing
limits on it.
This adds two new setting TasksAccounting= and TasksMax= to each unit,
as well as a gloabl option DefaultTasksAccounting=.
This also updated "cgtop" to optionally make use of the new
kernel-provided accounting.
systemctl has been updated to show the number of tasks for each service
if it is available.
This patch also adds correct support for undoing memory limits for units
using a MemoryLimit=infinity syntax. We do the same for TasksMax= now
and hence keep things in sync here.
2015-09-10 18:41:06 +02:00
Lennart Poettering
e11d45682e
update TODO
2015-09-10 18:18:58 +02:00
Lennart Poettering
59f448cf15
tree-wide: never use the off_t unless glibc makes us use it
...
off_t is a really weird type as it is usually 64bit these days (at least
in sane programs), but could theoretically be 32bit. We don't support
off_t as 32bit builds though, but still constantly deal with safely
converting from off_t to other types and back for no point.
Hence, never use the type anymore. Always use uint64_t instead. This has
various benefits, including that we can expose these values directly as
D-Bus properties, and also that the values parse the same in all cases.
2015-09-10 18:16:18 +02:00
Lennart Poettering
15af581253
Merge pull request #1236 from evverx/systemctl-requisite-of
...
systemctl: add RequisiteOf* as inverses of Requisite and RequisiteOverridable
2015-09-10 16:40:04 +02:00
Lennart Poettering
78e28c98e9
Merge pull request #1238 from again4you/devel/fix_smack_mtab
...
smack: label /etc/mtab as "_" when '--with-smack-run-label' is enabled.
2015-09-10 16:36:07 +02:00
Sangjung Woo
1fab0cbafc
smack: label /etc/mtab as "_" when '--with-smack-run-label' is enabled.
...
/etc/mtab should be labeled as "_", even though systemd has its own
smack label using '--with-smack-run-label' configuration. This is mainly
because all processes could read that file and the origin of this file
(i.e. /proc/mounts) is labeled as "_". This labels /etc/mtab as "_" when
'--with-smack-run-label' is enabled.
2015-09-10 21:52:39 +09:00
Evgeny Vereshchagin
1143adf722
systemctl: add RequisiteOf* as inverses of Requisite and RequisiteOverridable
2015-09-10 14:49:29 +03:00
Daniel Mack
f33be31198
Merge pull request #1226 from poettering/coccinelle-fixes3
...
Third round of Coccinelle fixes
2015-09-10 13:46:14 +02:00
Ivan Shapovalov
58158dc765
systemctl: improve clarity of error messages in the logind path
2015-09-10 14:45:00 +03:00
Ivan Shapovalov
2ac3930f5b
systemctl: relax permission checks in halt_main()
...
Thus we allow (non-interactive) polkit auth to kick in for legacy commands
(halt, poweroff, reboot, telinit) as well.
Fixes (another aspect of) issue #213 .
2015-09-10 14:45:00 +03:00
Ivan Shapovalov
a9085ea356
systemctl: fix logind bus call error handling in halt_main()
...
Handle -EOPNOTSUPP and -EINPROGRESS like in start_special().
2015-09-10 14:44:59 +03:00
Ivan Shapovalov
4c315c2c7c
systemctl: minor: use IN_SET() instead of repeated equality checks.
2015-09-10 14:39:46 +03:00
Lennart Poettering
89921f6ed0
Merge pull request #1234 from medhefgo/master
...
cryptsetup-generator: Properly check return code
2015-09-10 12:10:44 +02:00
Jan Janssen
c802a7306b
cryptsetup-generator: Properly check return code
2015-09-10 10:23:49 +02:00
Martin Pitt
0018e4e479
Merge pull request #1230 from swem/master
...
Add microphone mute keymap for Dell Precision
2015-09-10 06:56:44 +02:00
Chen-Han Hsiao (Stanley)
6e675e278c
Add microphone mute keymap for Dell Precision
2015-09-10 11:30:57 +08:00
Ivan Shapovalov
16f017fa6e
systemctl: legacy tools shall never be interactive
...
Fixes (the main concern of) issue #213 .
2015-09-10 01:14:07 +03:00
Lennart Poettering
f24aa148ab
Merge pull request #1225 from mbiebl/remove-sphinx-leftover2
...
README: remove obsolete instructions regarding python-systemd/sphinx
2015-09-09 23:13:58 +02:00