platform/upstream/systemd.git
2 years agobasic/cap-list: parse/print numerical capabilities 19/259319/1 accepted/tizen/unified/20210607.124406 submit/tizen/20210604.102811
Zbigniew Jędrzejewski-Szmek [Thu, 9 Jul 2020 21:15:47 +0000 (23:15 +0200)]
basic/cap-list: parse/print numerical capabilities

We would refuse to print capabilities which were didn't have a name
for. The kernel adds new capabilities from time to time, most recently
cap_bpf. 'systmectl show -p CapabilityBoundingSet ...' would fail with
"Failed to parse bus message: Invalid argument" because
capability_set_to_string_alloc() would fail with -EINVAL. So let's
print such capabilities in hexadecimal:

CapabilityBoundingSet=cap_chown cap_dac_override cap_dac_read_search
  cap_fowner cap_fsetid cap_kill cap_setgid cap_setuid cap_setpcap
  cap_linux_immutable cap_net_bind_service cap_net_broadcast cap_net_admin
  cap_net_raw cap_ipc_lock cap_ipc_owner 0x10 0x11 0x12 0x13 0x14 0x15 0x16
  0x17 0x18 0x19 0x1a ...

For symmetry, also allow capabilities that we don't know to be specified.

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1853736.

Change-Id: I9cb97a37024d9781fdf3bc741eb1cdc801e91bb5

3 years agoRevert "Description : adding force option to reboot command." 43/258343/1 accepted/tizen/unified/20210528.134728 submit/tizen/20210528.010751
Karol Lewandowski [Thu, 13 May 2021 14:28:15 +0000 (16:28 +0200)]
Revert "Description : adding force option to reboot command."

This reverts commit e03bd8dae27026782e1cf524b78f87637238cf5c.

Description is not enough to keep this, and quite likely the
problem is long gone.

Tizen uses it's own shutdown program (deviced-shutdown) from
around Tizen 5.x, which handles the shutdown sequence exactly
as wanted.

Right now it actually causes more harm than good, as it makes
impossible to run any action for two out of four "shutdown"
actions.

Change-Id: I871ffa573fefbb280a5b23e4cd62727dda478eb5

3 years agotizen: Do not use shutdown.target for shutdown 00/258100/1
Karol Lewandowski [Mon, 10 May 2021 13:58:27 +0000 (15:58 +0200)]
tizen: Do not use shutdown.target for shutdown

shutdown.target is special unit to which systemd automatically adds
Conflicts= with for every unit.

By removing the relation to this target in shutdown units we practically
change the shutdown to use only explicitly configured units.

Change-Id: I93a43cdb3875250920e3e49817ffcd6f7f7725b6

3 years agoRevert "Temporarily remove dlog_connect_fd()" 00/257200/1
Hyotaek Shim [Wed, 21 Apr 2021 05:39:48 +0000 (05:39 +0000)]
Revert "Temporarily remove dlog_connect_fd()"

This reverts commit 34e316b4345a71a353c0ff622975144e0af98515.

Change-Id: I4f86bdfda8dd0a4b99dcb02bd2ad0a32a0602f93

3 years agoTemporarily remove dlog_connect_fd() 69/257169/1 accepted/tizen/unified/20210421.101211 submit/tizen/20210420.085549
Hyotaek Shim [Tue, 20 Apr 2021 08:49:14 +0000 (17:49 +0900)]
Temporarily remove dlog_connect_fd()

Change-Id: Iba815676531a7561c4c4f7c12263464b1dba7f22
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
3 years agoUse new dlog-redirect-stdout api function 66/256766/1 submit/tizen/20210419.103606
Karol Lewandowski [Mon, 12 Apr 2021 12:51:17 +0000 (14:51 +0200)]
Use new dlog-redirect-stdout api function

Change-Id: I5bcc23a74950d2d8ae0db2ecabf5ea14d358b0ec

3 years agoAdd "dlog|journal" output redirection option 90/256590/1
Michal Bloch [Wed, 7 Apr 2021 12:54:42 +0000 (14:54 +0200)]
Add "dlog|journal" output redirection option

Journal seems to default to /dev/null even when not explicitly
specified, so there is no separate "dlog|journal|null".

Change-Id: I5682de7dce014f76f403406ef73c7bd5a9661d5e

3 years agoMerge "Basic PoC for DLog stdout redirector" into tizen accepted/tizen/unified/20210328.230635 submit/tizen/20210324.095642 submit/tizen/20210326.090524
Karol Lewandowski [Wed, 24 Mar 2021 21:16:40 +0000 (21:16 +0000)]
Merge "Basic PoC for DLog stdout redirector" into tizen

3 years agoBasic PoC for DLog stdout redirector 04/255204/3
Michal Bloch [Mon, 8 Feb 2021 14:06:03 +0000 (15:06 +0100)]
Basic PoC for DLog stdout redirector

Set Standard{Output,Error}=dlog in a service file,
or DefaultStandard{Output,Error}=dlog for global.

Note that setting the global default should only
really be done if DLog is working under the Android
Logger backend, since the Pipe backend daemon is
not really available early on which can make early
daemons fail.

Change-Id: Icf7224d1fabd4cdb45971ac9314ed4d19d220bbb

3 years agosystemd: Fix busctl crash on aarch64 when setting output table format 87/255687/1 accepted/tizen/unified/20210324.124406 submit/tizen/20210323.013050
Alin Popa [Fri, 14 Feb 2020 08:33:43 +0000 (09:33 +0100)]
systemd: Fix busctl crash on aarch64 when setting output table format

The enum used for column names is integer type while table_set_display() is parsing
arguments on size_t alignment which may result in assert in table_set_display() if
the size between types missmatch. This patch cast the enums to size_t.
It also fixes all other occurences for table_set_display() and
table_set_sort().

Change-Id: Ie225491ae3f9752183d6ea7993d02ef450ed6ab6

3 years agosystemd: Fix busctl crash on aarch64 when setting output table format 77/255677/1 submit/tizen/20210322.103524
Alin Popa [Fri, 14 Feb 2020 08:33:43 +0000 (09:33 +0100)]
systemd: Fix busctl crash on aarch64 when setting output table format

The enum used for column names is integer type while table_set_display() is parsing
arguments on size_t alignment which may result in assert in table_set_display() if
the size between types missmatch. This patch cast the enums to size_t.
An alternative solution would be to change the table_set_display() function
arguments to unsigned type.

Change-Id: I862db0168d58ecb3b7ee7dcf7f751be5a6121fd9

3 years agounit: fix serial console baudrate to 115200 24/254524/1 accepted/tizen/unified/20210309.140734 submit/tizen/20210308.075822
INSUN PYO [Thu, 4 Mar 2021 06:22:39 +0000 (15:22 +0900)]
unit: fix serial console baudrate to 115200

Due to noise coming into the serial console or other abnormal behavior,
agetty changes the baudrate in the following order: 115200, 38400, 9600.

Since tizen only uses 115200 baudrate, this is fixed.

It is reported in the DA.

Change-Id: Icf7224d1fabd4cdb45971ac9314ed4d19d220bb1

3 years agospec: depend on libdbuspolicy1 81/253481/1 accepted/tizen/unified/20210223.065504 submit/tizen/20210222.053410 submit/tizen/20210222.105934
Adrian Szyndela [Thu, 11 Feb 2021 08:08:26 +0000 (09:08 +0100)]
spec: depend on libdbuspolicy1

kdbus.h is being moved to libdbuspolicy1 package.

Change-Id: Ib9009bc7fdc5c407d6e9349a028a81322294d2d7

3 years agodelayed: rework dealyed service without capability of /usr/bin/touch 00/248900/3 accepted/tizen/unified/20201224.151528 submit/tizen/20201223.002921
INSUN PYO [Thu, 3 Dec 2020 06:07:43 +0000 (15:07 +0900)]
delayed: rework dealyed service without capability of /usr/bin/touch

VD security remove capability of /usr/bin/touch. (cap_dac_override=ei)

Change permision and group of /run/systemd/system
from 0755/root/root to 0775/root/systemf_fw.

Change-Id: I6e2189c2cd0d4a86db995651b43a4dcdc25fcabf

3 years agotizen: Search for configuration files in /hal dir 02/248702/7 accepted/tizen/unified/20201210.124556 submit/tizen/20201209.021155
Karol Lewandowski [Tue, 1 Dec 2020 11:34:31 +0000 (12:34 +0100)]
tizen: Search for configuration files in /hal dir

Since Tizen 6.5, a HAL image is mounted on the /hal directory,
which contains hardware-specific configurations and drivers,
for better portability of Tizen.

This is the priority of path searching for configuration file.
 1. /etc/
 2. /run/
 3. /usr/local/lib/
 4. /usr/lib/
 5. /hal/lib/

When the same file exists, the higher priority file is used.
In this case, "/etc" is the highest priority.

Because hal can never override platform,
hal has a lower priority than platform.

Change-Id: Ie5e6cf98e64b4317bda23d49571b5c0f60084569
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
[ Change search order for /hal to be searched last ]
Signed-off-by: Karol Lewandowski <k.lewandowsk@samsung.com>
3 years agosysctl: delete unnecessary sysctl-tizen-override.conf 14/249114/1
INSUN PYO [Mon, 7 Dec 2020 07:26:51 +0000 (16:26 +0900)]
sysctl: delete unnecessary sysctl-tizen-override.conf

/proc/sys/net/core/default_qdisc has only pfifo_fast values in all targets.
(TM1, TW2, TW3, RPI3, RPI4, ARTIK, EMUL)

If this conf does not exist, there is warning journal log and this is not harmful.
"Jan 01 11:36:16 localhost systemd-sysctl[208]: Couldn't write 'pfifo_fast' to 'net/core/default_qdisc', ignoring: No such file or directory"

Change-Id: I970dc97fc0771b1ef3fce1ef05b5f6a2d6b22778

3 years agodelayed: remove unused file 84/248884/1 accepted/tizen/unified/20201207.123254 submit/tizen/20201203.052657
INSUN PYO [Thu, 3 Dec 2020 04:30:38 +0000 (13:30 +0900)]
delayed: remove unused file

Change-Id: Ifacc46fcc5c7ec7bb52f9b4f47ed5ea98aa5fd5a

3 years agoDelayed target: add delaying the start of delayed.target #2 08/248408/3 submit/tizen/20201127.004502
INSUN PYO [Thu, 26 Nov 2020 05:21:57 +0000 (14:21 +0900)]
Delayed target: add delaying the start of delayed.target #2

Delay time is also applied to user systemd.
System systemd is already applied.

Change-Id: I8da0c1f224a74d45badd82f2ac1dda13cb8febbb

3 years agosd-device-enumerator: do not return error when a device is removed 61/248361/1
INSUN PYO [Thu, 19 Nov 2020 01:49:04 +0000 (10:49 +0900)]
sd-device-enumerator: do not return error when a device is removed

If /sys/class/OOO node is created and destroyed during booting (kernle driver initialization fails),
systemd-udev-trigger.service fails due to race condition.

***** race condition ***********************************************************************************
 1. kernel driver create /sys/class/OOO
 2. systemd-udev-trigger.service execues "/usr/bin/udevadm trigger --type=devices --action=add"

 3. device_enumerator_scan_devices() => enumerator_scan_devices_all() => enumerator_scan_dir("class") =>
    opendir("/sys/class") and iterate all subdirs ==> enumerator_scan_dir_and_add_devices("/sys/class/OOO")

 4. kernel driver fails and destroy /sys/class/OOO
 5. enumerator_scan_dir_and_add_devices("/sys/class/OOO") fails in opendir("/sys/class/OOO")

 6. "systemd-udev-trigger.service" fails
 7. udev coldplug fails and some device units not ready
 8. mount units asociated with device units fail
 9. local-fs.target fails
 10. enters emergency mode
********************************************************************************************************

***** status of systemd-udev-trigger.service unit ******************************************************
$ systemctl status systemd-udev-trigger.service
 systemd-udev-trigger.service - udev Coldplug all Devices
   Loaded: loaded (/usr/lib/systemd/system/systemd-udev-trigger.service; static; vendor preset: enabled)
   Active: failed (Result: exit-code) since Thu 2020-01-02 13:16:54 KST; 22min ago
     Docs: man:udev(7)
           man:systemd-udevd.service(8)
  Process: 2162 ExecStart=/usr/bin/udevadm trigger --type=subsystems --action=add (code=exited, status=0/SUCCESS)
  Process: 2554 ExecStart=/usr/bin/udevadm trigger --type=devices --action=add (code=exited, status=1/FAILURE)
  Main PID: 2554 (code=exited, status=1/FAILURE)

  Jan 02 13:16:54 localhost udevadm[2554]: Failed to scan devices: No such file or directory
  Jan 02 13:16:54 localhost systemd[1]: systemd-udev-trigger.service: Main process exited, code=exited, status=1/FAILURE
  Jan 02 13:16:54 localhost systemd[1]: systemd-udev-trigger.service: Failed with result 'exit-code'.
  Jan 02 13:16:54 localhost systemd[1]: Failed to start udev Coldplug all Devices.
*******************************************************************************************************

***** journal log with Environment=SYSTEMD_LOG_LEVEL=debug in systemd-udev-trigger.service  ***********
  Jan 01 21:57:20 localhost udevadm[2039]: sd-device-enumerator: Scanning /sys/bus
  Jan 01 21:57:20 localhost udevadm[2522]: sd-device-enumerator: Scan all dirs
  Jan 01 21:57:20 localhost udevadm[2522]: sd-device-enumerator: Scanning /sys/bus
  Jan 01 21:57:21 localhost udevadm[2522]: sd-device-enumerator: Scanning /sys/class
  Jan 01 21:57:21 localhost udevadm[2522]: sd-device-enumerator: Failed to scan /sys/class: No such file or directory
  Jan 01 21:57:21 localhost udevadm[2522]: Failed to scan devices: No such file or directory
*******************************************************************************************************

Change-Id: Iefc64406a72e5facf1f9c48ea2f36fdadf18891d

3 years agospec: fix typo in %postun script 80/247880/1
INSUN PYO [Wed, 18 Nov 2020 04:07:24 +0000 (13:07 +0900)]
spec: fix typo in %postun script

Change-Id: Ib4b6481a67646e02f59a622c42ca84f26616a394

3 years agoDelayed target: add delaying the start of delayed.target 75/246175/6 accepted/tizen/unified/20201113.130833 submit/tizen/20201112.063443
INSUN PYO [Mon, 26 Oct 2020 09:14:28 +0000 (18:14 +0900)]
Delayed target: add delaying the start of delayed.target

If /etc/systemd/delayed-target.conf exists and has DelayedTargetWait environment value,
delayed.target starts after DelayedTargetWait seconds.

If the /tmp/.systemd_delayed_target_wait file is created within the delayed time,
delayed.target starts immediately.

Change-Id: I4ad1ff6a8084ed9db7d630f533a9348b41decbf0

3 years agopackaging: Align alternatives setup with fedora-recommended scheme 95/246195/3 accepted/tizen/unified/20201106.130134 submit/tizen/20201103.015640 submit/tizen/20201104.011652
Karol Lewandowski [Mon, 26 Oct 2020 14:37:15 +0000 (15:37 +0100)]
packaging: Align alternatives setup with fedora-recommended scheme

Change-Id: I5ff9241180d32fb936a19dadfea9fa7d174a1dee

3 years agoAdd an api for early initialization of input udev 21/246321/3 accepted/tizen/unified/20201103.051952 submit/tizen/20201030.074029 submit/tizen/20201102.045342
Hyotaek Shim [Wed, 28 Oct 2020 07:36:05 +0000 (16:36 +0900)]
Add an api for early initialization of input udev

KERNEL[3.864698] add      /devices/virtual/rc/rc1/input2 (input)
DEVPATH=/devices/virtual/rc/rc1/input2
UDEV  [6.541278] add      /devices/virtual/rc/rc1/input2 (input)
DEVPATH=/devices/virtual/rc/rc1/input2

For fast input accessing, input udev should be set up early,
so that udev_device_get_is_initialized(input_udev_dev) check can be skipped before UDEV [6.541278].

Change-Id: I8182f856b0169f9c434bb360a49cfef109485c94
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
3 years agoRestore 'Default Dependendies' to system-default-target-done.service and system-delay... 31/245431/2 submit/tizen/20201027.002610
INSUN PYO [Thu, 8 Oct 2020 10:24:47 +0000 (19:24 +0900)]
Restore 'Default Dependendies' to system-default-target-done.service and system-delayed-target-trigger.service

Add 'Requires=sysinit.target' and 'After=sysinit.target basic.target'

Two dependencies prevent those service from running in emergency mode,
because sysinit.target always fails in emergency mode.

Change-Id: I7602100652f478b3d66fcba215659f39a63694e2

3 years agoEmergency mode: add emergency-target-holder.service 26/245326/4
INSUN PYO [Wed, 7 Oct 2020 03:13:45 +0000 (12:13 +0900)]
Emergency mode: add emergency-target-holder.service

The emergency-target-holder.service prevents emergency.target from completing.
If emergency.target is not completed,
other services that are not intended can not be run in emergency mode.

Detailed information.
============================================================================================================================
1. If local-fs.target fails, emergency.target is started by 'OnFailure=emergency.target'.

2. By 'OnFailureJobMode=replace-irreversibly' option,
   emergency.target cannot be canceled until completion.

3. When starting a new service by any activation(dbus, path, socket) in emergency mode,
   sysinit.target is always checked and started by 'DefaultDependency=yes'.

4. sysinit.target stops emergency.target because of the 'Conflicts=emergency.target' setting.

5. However, emergency.target can not be stopped
   because it started with 'replace-irreversibly' and not finished yet.

6. So sysinit.target can not be started.

7. New service can not be run because sysinit.target could not be started.
============================================================================================================================

Logs when running new services after applying this patch
=============================================================================================================================
bash-3.2# systemctl start deviced.service
Failed to start deviced.service: Transaction for deviced.service/start is destructive (emergency.target has 'start' job queued, but 'stop' is included in transaction).
See system logs and 'systemctl status deviced.service' for details.

bash-3.2# systemctl start sysinit.target
Failed to start sysinit.target: Transaction for sysinit.target/start is destructive (emergency.target has 'start' job queued, but 'stop' is included in transaction).
See system logs and 'systemctl status sysinit.target' for details.
==============================================================================================================================

Change-Id: I2cefadd7228d463fe1755e0c475f4563d98c8260

3 years agopackaging: Fixup removal of pamconsole-tmp.conf 25/245625/1
Karol Lewandowski [Tue, 13 Oct 2020 08:52:24 +0000 (10:52 +0200)]
packaging: Fixup removal of pamconsole-tmp.conf

Change-Id: Id8c736f5d00823a67446df98e19f8e9faa6536ca

3 years agoRemove unused file pamconsole-tmp.conf 23/245423/1
INSUN PYO [Thu, 8 Oct 2020 10:06:46 +0000 (19:06 +0900)]
Remove unused file pamconsole-tmp.conf

Change-Id: I0c737140c57588a2e8dc936b0e371040ab20e3d2

3 years agopackaging: Ensure systemd-shutdown is owned by systemd 73/245073/1 accepted/tizen_6.0_unified_hotfix tizen_6.0_hotfix accepted/tizen/6.0/unified/20201030.103459 accepted/tizen/6.0/unified/hotfix/20201103.045313 accepted/tizen/unified/20201005.101323 submit/tizen/20200930.122135 submit/tizen_6.0/20201029.205504 submit/tizen_6.0_hotfix/20201102.192904 submit/tizen_6.0_hotfix/20201103.115104 tizen_6.0.m2_release
Karol Lewandowski [Wed, 30 Sep 2020 11:37:47 +0000 (13:37 +0200)]
packaging: Ensure systemd-shutdown is owned by systemd

Change-Id: I37ced8706c8bb86e465226b01fffe9976edbf08c

3 years agopackaging: Drop unused kernel-install utility 79/244979/1
Karol Lewandowski [Mon, 28 Sep 2020 13:53:24 +0000 (15:53 +0200)]
packaging: Drop unused kernel-install utility

Change-Id: I73301481613fbefc77374fcc42297d10eebe3795

3 years agoAlternativize shutdown command et al. 80/244680/2
Mateusz Majewski [Thu, 17 Sep 2020 05:50:10 +0000 (07:50 +0200)]
Alternativize shutdown command et al.

Change-Id: I43030af64c1791ffbc99aeb3906a5517edbd3670

3 years agopackaging: Do not require WITH_... macros to be explicitly defined 35/244635/2 accepted/tizen/unified/20200925.140238 submit/tizen/20200924.053356
Karol Lewandowski [Tue, 22 Sep 2020 13:52:02 +0000 (15:52 +0200)]
packaging: Do not require WITH_... macros to be explicitly defined

Change-Id: I1496d79b626da11085caceec32e1748bb5b16836

3 years agospec: fix feature macro typo 23/244623/4
INSUN PYO [Tue, 22 Sep 2020 11:33:59 +0000 (20:33 +0900)]
spec: fix feature macro typo

Change-Id: Ifccdcf1561a32d04526d8ccf8ea76586b5a1c85c

3 years agoDisable virtualization feature 95/244395/5 accepted/tizen/unified/20200923.024119 submit/tizen/20200922.102932
INSUN PYO [Fri, 18 Sep 2020 06:04:53 +0000 (15:04 +0900)]
Disable virtualization feature

1. Tizen does not support continer and vm.

2. Resolving Smack error.
==========================================================================================
Jan 01 09:00:19 localhost audit[591]: AVC lsm=SMACK fn=smack_inode_permission action=denied subject="User" object="System::Privileged" requested=r pid=591 comm="systemd" name="sched" dev="proc" ino=12322
Jan 01 09:00:19 localhost audit[591]: AVC lsm=SMACK fn=smack_inode_permission action=denied subject="User" object="System::Privileged" requested=r pid=591 comm="systemd" name="sched" dev="proc" ino=12322
Jan 01 09:00:19 localhost audit[591]: AVC lsm=SMACK fn=smack_inode_permission action=denied subject="User" object="System::Privileged" requested=r pid=591 comm="systemd" name="sched" dev="proc" ino=12322

Jan 01 09:00:19 localhost audit[535]: AVC lsm=SMACK fn=smack_inode_permission action=denied subject="User" object="System::Privileged" requested=r pid=535 comm="tlm-sessiond" name="environ" dev="proc" ino=12572
Jan 01 09:00:19 localhost audit[535]: AVC lsm=SMACK fn=smack_inode_permission action=denied subject="User" object="System::Privileged" requested=r pid=535 comm="tlm-sessiond" name="sched" dev="proc" ino=12322

Jan 01 09:00:30 localhost audit[949]: AVC lsm=SMACK fn=smack_inode_permission action=denied subject="User" object="System::Privileged" requested=r pid=949 comm="systemctl" name="sched" dev="proc" ino=12322
==========================================================================================

Change-Id: I8b947a0de6c030fa7dd4f8d8b080b1f7783a4010

3 years agospec: disable ldconfig feature 70/244570/1
INSUN PYO [Tue, 22 Sep 2020 04:32:57 +0000 (13:32 +0900)]
spec: disable ldconfig feature

A ldconfig.service is not able to run because / is mounted as RO.

Change-Id: I36d579b147a74df2a2efb0349958f76f65f710a0

3 years agoAdd Conflicts=emergency.service in system-delayed-target-trigger.service 28/242528/1 accepted/tizen/unified/20200828.121457 submit/tizen/20200827.121012
Hyotaek Shim [Thu, 27 Aug 2020 11:42:09 +0000 (20:42 +0900)]
Add Conflicts=emergency.service in system-delayed-target-trigger.service

Change-Id: Ib742d57963db8cfba2a091d4de1562ab0b95fc7a
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
3 years agoDo not log reboots to utmp 18/241218/1 accepted/tizen/unified/20200820.034651 accepted/tizen/unified/20200824.025956 submit/tizen/20200819.013928 submit/tizen/20200820.014911
Karol Lewandowski [Tue, 18 Aug 2020 20:51:28 +0000 (22:51 +0200)]
Do not log reboots to utmp

This functionality is not used by Tizen services.  Users can find
reboots using standard log facilities (journal).

Change-Id: Ie8926606ebb386684ba321ef4560eaec9143e4cf

3 years agoFix wait-target-done.c 34/237934/4 sandbox/songinha/history accepted/tizen/unified/20200721.142303 submit/tizen/20200707.064531 submit/tizen/20200713.021000
Youngjae Cho [Mon, 6 Jul 2020 23:22:57 +0000 (08:22 +0900)]
Fix wait-target-done.c

1. Change inotify fd to nonblock.
2. Change timeout to use alarm(). And make it encompass
   the whole process, which now includes wd allocation.
3. Add dependency with tlm.service to
   system-delayed-target-trigger.service
4. Add journal log.

Change-Id: Ibec5e4f4030e26235dbba6610a5142d0e29e423f
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
3 years agoRemove unused systemd-remount-fs.service and systemd-fstab-generator 72/237072/1 accepted/tizen/unified/20200625.110525 accepted/tizen/unified/20200703.014557 submit/tizen/20200625.013725 submit/tizen/20200702.060520
INSUN PYO [Wed, 24 Jun 2020 23:57:14 +0000 (08:57 +0900)]
Remove unused systemd-remount-fs.service and systemd-fstab-generator

Tizen no longer uses /etc/fstab.
So we don't need systemd-remount-fs.service and systemd-fstab-generager to handle /etc/fstab.

Change-Id: I64a3655f69f80d161b00fad40aef6b0235e71977

3 years agospec: remove unused service 96/236696/2
INSUN PYO [Fri, 19 Jun 2020 10:05:51 +0000 (19:05 +0900)]
spec: remove unused service

 - /usr/lib/systemd/systemd-volatile-root
 - /usr/lib/systemd/system/systemd-volatile-root.service

Change-Id: Ib3cf266a5ed7bc53ee16a97d7514bfb0bcabd498

3 years agoApply SmackProcessLabel=System to system-update-cleanup.service 86/236686/1
INSUN PYO [Fri, 19 Jun 2020 08:38:02 +0000 (17:38 +0900)]
Apply SmackProcessLabel=System to system-update-cleanup.service

Change-Id: Ie8fd3b105508ff233d28c9f7e8f97beb12d1b1d7

3 years agoApply SmackProcessLabel=System to systemd-boot-check-no-failures.service 66/236666/1 accepted/tizen/unified/20200625.110600 submit/tizen/20200622.002220
INSUN PYO [Fri, 19 Jun 2020 07:07:05 +0000 (16:07 +0900)]
Apply SmackProcessLabel=System to systemd-boot-check-no-failures.service

Change-Id: I25ff0d8d40a64ee9e9faa87db5ff2ce09bc9e976

3 years agospec: disable hibernate feature 63/236663/1
INSUN PYO [Fri, 19 Jun 2020 06:44:15 +0000 (15:44 +0900)]
spec: disable hibernate feature

Change-Id: Iecb223fc98412d8635b724ca6fc8952457820e45

3 years agospec: disable EFI feature 68/236568/5
INSUN PYO [Thu, 18 Jun 2020 06:35:09 +0000 (15:35 +0900)]
spec: disable EFI feature

Change-Id: Ia4b0612f77c5bde4615af615bf8747168bb9abda

3 years agoApply SmackProcessLabel=System to systemd-OOO.service 66/236566/3
INSUN PYO [Thu, 18 Jun 2020 06:24:09 +0000 (15:24 +0900)]
Apply SmackProcessLabel=System to systemd-OOO.service

 - systemd-exit.service
 - systemd-poweroff.service
 - systemd-reboot.service

Change-Id: Ic5cde17a34fd75ca0157a56dc66534f23db62a15

3 years agoRevert: Mask individual .wants/.requires symlinks v2 58/236558/1 accepted/tizen/unified/20200619.121755 submit/tizen/20200618.104247
ingi2-kim [Wed, 10 Jun 2020 10:33:11 +0000 (19:33 +0900)]
Revert: Mask individual .wants/.requires symlinks v2

Fix issue that drop-in was not applied

Change-Id: I2ed5723a75cf0a5da6bd53faa9713a603985da7b
Signed-off-by: ingi2-kim <ingi2.kim@samsung.com>
3 years agoRevert "test: add test for prefix unit loading" 82/236082/3 submit/tizen/20200617.084905
Adrian Szyndela [Fri, 12 Jun 2020 13:06:54 +0000 (15:06 +0200)]
Revert "test: add test for prefix unit loading"

This reverts commit 7ce49e656b1377713ade999dfe381807a78313cd.

The previous revert (6927aa2bc09726ff1f071770a8ce0c2ea6430b6b)
reverts more than it is described within its description. As it is
a base for some of subsequent commits in the upstream, they are
silently removed, probably because of conflict resolving.

Prefix unit loading is a feature that is a victim of such silent removal.
Therefore, the feature test is also (temporarily, I hope) removed with
this commit.

Change-Id: Ie82e5a54852ea08c8b3f0561f304fab6f3434aaf

3 years agoRevert: Mask individual .wants/.requires symlinks 82/235882/4
ingi2-kim [Mon, 8 Jun 2020 08:11:34 +0000 (17:11 +0900)]
Revert: Mask individual .wants/.requires symlinks

Revert below patches due to performance issue (Avoid increasing IO count)

Refer : https://github.com/systemd/systemd/pull/5231
 - core/load-dropin: add more sanity checks on .wants/.requires symlinks
 - core: drop code that is now unused
 - core: implement masking of .wants/.requires symlinks
 - core: when loading .wants and .requires, follow the same logic as .d conf dropins

Change-Id: I9f6712d9df2c6bb25ab736ae6b6d1f5adbf2a691
Signed-off-by: ingi2-kim <ingi2.kim@samsung.com>
3 years agoRevert: Rework unit loading to take into account all aliases 73/236473/1
INSUN PYO [Tue, 9 Jun 2020 00:55:24 +0000 (09:55 +0900)]
Revert: Rework unit loading to take into account all aliases

Revert below patches due to increasing unit loading time (UnitsLoadFinishTimestamp - UnitsLoadStartTimestamp)

Refer: https://github.com/systemd/systemd/pull/13119/commits
 - test-unit-file: allow printing of information about specific units
 - pid1: drop unit caches only based on mtime
 - analyze: add "unit-files" to dump the unit fragment map
 - core: restore initialization of u->source_mtime
 - pid1: use a cache for all unit aliases
 - shared/unit-file: add a function to validate unit alias symlinks
 - TEST-15-DROPIN: add test for details of unit aliasing

Change-Id: I1bff89f5851544cda7522bd3ceb398499dac57d4

3 years agoApply ASLR for send-booting-done and wait-target-done 63/235863/2 accepted/tizen/unified/20200611.134758 submit/tizen/20200610.110735
Hyotaek Shim [Wed, 10 Jun 2020 10:56:29 +0000 (19:56 +0900)]
Apply ASLR for send-booting-done and wait-target-done

Change-Id: I80b6c67671a4c8ebb1cb4afa5d8065a164554800
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
4 years agoRevert "core/path: fix spurious triggering of PathExists= on restart/reload" 99/233699/1 accepted/tizen/unified/20200609.153536 submit/tizen/20200518.101955 submit/tizen/20200608.114627
INSUN PYO [Mon, 18 May 2020 09:21:13 +0000 (18:21 +0900)]
Revert "core/path: fix spurious triggering of PathExists= on restart/reload"

This reverts commit d7cf8c24d4ef6ed4c9d711ee82ba57a529baad34.

Change-Id: Ice828460a04862ad41495826566c0be1485bce63

4 years agoFix delayed.target 36/232536/6
Youngjae Cho [Wed, 6 May 2020 06:39:03 +0000 (15:39 +0900)]
Fix delayed.target

Add binary wait-target-done.c for waiting creation of *.done file.

Change-Id: I0d87c574086073b28aa52dccca3e760914e2abbd
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
4 years agoDelayed target: check interval is changed from 1 second to 0.2 seconds. 15/231315/1 submit/tizen/20200429.062821
INSUN PYO [Tue, 21 Apr 2020 07:11:15 +0000 (16:11 +0900)]
Delayed target: check interval is changed from 1 second to 0.2 seconds.

Change-Id: I2206ada9509d503ac02733d0cb0c1539d932b184
Signed-off-by: INSUN PYO <insun.pyo@samsung.com>
4 years agospec: fix indent in systemd.spec 88/230888/5
INSUN PYO [Thu, 16 Apr 2020 00:04:39 +0000 (09:04 +0900)]
spec: fix indent in systemd.spec

Change-Id: I7b48f4cd8e66e3c52a23305d48466c75e5443845
Signed-off-by: INSUN PYO <insun.pyo@samsung.com>
4 years agotest-bus-async-match: remove unused variables 76/230976/1
Adrian Szyndela [Thu, 16 Apr 2020 08:52:54 +0000 (10:52 +0200)]
test-bus-async-match: remove unused variables

Change-Id: I0b900a9b0b04767123110ebcb88174d45fdc8ca3

4 years agosdbus: kdbus tests: improve mt-safety 28/230828/4
Maciej Slodczyk [Tue, 14 Apr 2020 10:54:12 +0000 (12:54 +0200)]
sdbus: kdbus tests: improve mt-safety

Change-Id: I09d0eea89920d3af549f2e10b2a1dbdd7a9b4cf2
Signed-off-by: Maciej Slodczyk <m.slodczyk2@partner.samsung.com>
4 years agosdbus: kdbus tests: make sure all variables are initialized 16/230816/5
Maciej Slodczyk [Tue, 14 Apr 2020 09:02:12 +0000 (11:02 +0200)]
sdbus: kdbus tests: make sure all variables are initialized

Change-Id: Ide45b79c33bf0c15346801c36bd8695ca4ea2ec6
Signed-off-by: Maciej Slodczyk <m.slodczyk2@partner.samsung.com>
4 years agosdbus: kdbus tests: fix indent in tests 45/230845/3
Maciej Slodczyk [Tue, 14 Apr 2020 12:49:54 +0000 (14:49 +0200)]
sdbus: kdbus tests: fix indent in tests

Change-Id: I143ce8edf571a2a4a6899319c16b99dcafaff9b6
Signed-off-by: Maciej Slodczyk <m.slodczyk2@partner.samsung.com>
4 years agoChange file permission of org.tizen.system.conf to 644. 67/230267/1
INSUN PYO [Thu, 9 Apr 2020 05:17:05 +0000 (14:17 +0900)]
Change file permission of org.tizen.system.conf to 644.

Change-Id: Ibdf905f96c6f72951db4e90b761462e05a956232

4 years agodelayed: replace dbus-send with a dedicated program 19/229919/1
Adrian Szyndela [Mon, 6 Apr 2020 10:14:04 +0000 (12:14 +0200)]
delayed: replace dbus-send with a dedicated program

In release versions there can be no helper programs for sending
any messages over D-Bus. Thus, dbus-send, busctl etc. are removed.

This commit replaces dbus-send use cases with a specialized little
tool, which does what dbus-send did in those cases.

Change-Id: I54e51fc3fe563961f18b953215cee41c3bf4510e

4 years agologind: add SmackProcessLabel=System::Privileged to user-runtime-dir@.service 93/229693/1 accepted/tizen/unified/20200406.133157 submit/tizen/20200403.032411 submit/tizen/20200403.052058
INSUN PYO [Fri, 3 Apr 2020 01:37:48 +0000 (10:37 +0900)]
logind: add SmackProcessLabel=System::Privileged to user-runtime-dir@.service

To change smack label /run/user/5001/system_share to "*", we need System::Privileged.

Change-Id: Icd1e8c7794236670575df68d1fe35c35584f24f2

4 years agosocket: fix printing of size_t value 57/229657/1 submit/tizen/20200402.132326
Adrian Szyndela [Thu, 2 Apr 2020 12:32:02 +0000 (14:32 +0200)]
socket: fix printing of size_t value

Change-Id: I9a6fa9f3a15c091fdda0e738de96dcebca8ee1c3

4 years agoMerge upgrade-to-244 into tizen 38/229638/1 submit/tizen/20200402.112550
Adrian Szyndela [Thu, 2 Apr 2020 10:37:36 +0000 (12:37 +0200)]
Merge upgrade-to-244 into tizen

Change-Id: Id3fa41d3beb40586cf5eb4a9069c4a1ce39366c9

4 years agotest-bus-track: add possibility of succeeding with kdbus sandbox/adrians/upgrade-to-244 upgrade-to-244
Adrian Szyndela [Tue, 31 Mar 2020 10:21:31 +0000 (12:21 +0200)]
test-bus-track: add possibility of succeeding with kdbus

4 years agomeson.build: set a proper path for building in Tizen
Adrian Szyndela [Mon, 30 Mar 2020 11:16:30 +0000 (13:16 +0200)]
meson.build: set a proper path for building in Tizen

4 years agotest-copy: allow copy from symlinked dir
Adrian Szyndela [Mon, 30 Mar 2020 07:26:14 +0000 (09:26 +0200)]
test-copy: allow copy from symlinked dir

4 years agotests: make tests pass with non-utf8 locale
Adrian Szyndela [Fri, 27 Mar 2020 15:29:24 +0000 (16:29 +0100)]
tests: make tests pass with non-utf8 locale

4 years agoMerge v244 into tizen
Adrian Szyndela [Thu, 2 Apr 2020 09:48:41 +0000 (11:48 +0200)]
Merge v244 into tizen

systemd v244

4 years agoDisable shutdown watchdog as default 75/229275/3 submit/tizen/20200402.035744
INSUN PYO [Tue, 31 Mar 2020 02:01:58 +0000 (11:01 +0900)]
Disable shutdown watchdog as default

Change-Id: Ibef1d780d3a711b9251cddc41b16c91a154951e2

4 years agosdbus: kdbus: add test for adding async signal match sandbox/adrians/upgrade-to-243
Maciej Slodczyk [Mon, 30 Mar 2020 13:09:14 +0000 (15:09 +0200)]
sdbus: kdbus: add test for adding async signal match

Signed-off-by: Maciej Slodczyk <m.slodczyk2@partner.samsung.com>
4 years agosd-bus: kdbus: set read_counter in synthesized msgs
Adrian Szyndela [Tue, 24 Mar 2020 07:25:50 +0000 (08:25 +0100)]
sd-bus: kdbus: set read_counter in synthesized msgs

read_counter was not set for synthesized messages, this was
failing a match check at bus-match.c:297.

4 years agoudevd: add missing attr in SECLABEL rules parsing
Adrian Szyndela [Thu, 19 Mar 2020 06:57:09 +0000 (07:57 +0100)]
udevd: add missing attr in SECLABEL rules parsing

This caused failure of udevd workers, when they tried to execute
rules. When parsing, 'attr' was always passed as NULL, despite being
checked for non-emptiness. When executing, NULL was passed
unconditionally to strdup, and it caused segmentation fault.

4 years agounit: handle GetNameOwner when kdbus is present
Adrian Szyndela [Tue, 10 Mar 2020 14:13:39 +0000 (15:13 +0100)]
unit: handle GetNameOwner when kdbus is present

Change-Id: I24fb2027e6b8f1c37971e6013ab91f1157636d8d

4 years agomeson: workaround for lack of realpath
Adrian Szyndela [Fri, 6 Mar 2020 16:01:47 +0000 (17:01 +0100)]
meson: workaround for lack of realpath

Change-Id: I2472bcf422e6c3ccef1522c6f8733961b6556c0a

4 years agoRevert "Drop dbus activation stub service"
Adrian Szyndela [Fri, 6 Mar 2020 16:17:47 +0000 (17:17 +0100)]
Revert "Drop dbus activation stub service"

This reverts commit 07125d24eedb71693b3bf2b1f0730cd01aaac2dd.

The revert may be reverted with dbus update to version >= 1.10.10.

4 years agoMerge v243 into tizen
Adrian Szyndela [Fri, 27 Mar 2020 08:27:11 +0000 (09:27 +0100)]
Merge v243 into tizen

systemd v243

4 years agosd-bus: fix freeing kdbus messages sandbox/adrians/upgrade-to-242
Adrian Szyndela [Thu, 26 Mar 2020 07:13:50 +0000 (08:13 +0100)]
sd-bus: fix freeing kdbus messages

Version 242 introduced two kinds of references to messages: normal and queued.
This commit fixes this functionality for kdbus:
- (normal_)unreference messages when they are (queue_)referenced;
- fix freeing function to allow release of kdbus memory.

4 years ago(backport) linux: also import l2tp.h from kernel-5.0
Yu Watanabe [Sat, 13 Apr 2019 09:35:15 +0000 (18:35 +0900)]
(backport) linux: also import l2tp.h from kernel-5.0

The L2TP_ATTR_UDP_ZERO_CSUM6_{TX,RX} attributes are introduced by
6b649feafe10b293f4bd5a74aca95faf625ae525, which is included in
kernel-3.16. To support older kernel, let's import the header.

Fixes #12300.

Change-Id: I6153d93adaeb7ed21c9956125eac6d8928153bfa

4 years agoMerge v242 into tizen
Adrian Szyndela [Fri, 27 Mar 2020 08:11:55 +0000 (09:11 +0100)]
Merge v242 into tizen

systemd v242

4 years agoMerge v241 into tizen sandbox/adrians/upgrade-to-241
Adrian Szyndela [Fri, 27 Mar 2020 07:33:36 +0000 (08:33 +0100)]
Merge v241 into tizen

systemd 241

4 years agobus-message: fix gvariant array elements alignment computing sandbox/adrians/upgrade-to-240
Adrian Szyndela [Mon, 16 Mar 2020 11:08:04 +0000 (12:08 +0100)]
bus-message: fix gvariant array elements alignment computing

Commit f88214cf9d66c93f4d22c4c8980de9ee3ff45bab introduced correction
of computing of variable sized elements of arrays. However,
alignment was taken from outer signature instead of type of elements
in the array. For example, for signature "a(sasbttttuii)"
the alignment of elements of the inner array ("as"; should be 1) was computed
from the alignment of "sasbttttuii" (which is 8).

This commit corrects the alignment source.

4 years ago(backport) udev: do logging before setting variables to NULL
Zbigniew Jędrzejewski-Szmek [Tue, 15 Jan 2019 07:17:44 +0000 (08:17 +0100)]
(backport) udev: do logging before setting variables to NULL

gcc-9 diagnoses this as an error.
Reported by Jeff Law.

Change-Id: I737247b391a5ea6f2ef581bc32d99716782ce659

4 years ago(backport) capability: fix build without PR_CAP_AMBIENT
Fabrice Fontaine [Fri, 11 Jan 2019 15:07:00 +0000 (16:07 +0100)]
(backport) capability: fix build without PR_CAP_AMBIENT

systemd fails to build on kernel without PR_CAP_AMBIENT (< 4.3) since
https://github.com/systemd/systemd/commit/2a03bb3e65327c73008f1db485ffc75c432dc6b2

To fix this error, include missing_prctl.h in all files using
PR_CAP_AMBIENT

Fixes:
 - http://autobuild.buildroot.org/results/699c078aa078240c6741da4dbd0871450ceeca92

Change-Id: I4b0f0af732fbb0e15d129c5fe8538c0785261415
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
4 years ago(backport) linux: also import linux/in.h and in6.h from kernel-5.0
Yu Watanabe [Sat, 13 Apr 2019 09:46:40 +0000 (18:46 +0900)]
(backport) linux: also import linux/in.h and in6.h from kernel-5.0

Now linux/in.h has better conflict detection with glibc's
netinet/in.h. So, let's import the headers.

Note that our code already have many workarounds for the conflict,
but in this commit does not drop them. Let's do that in the later
commits if this really helps.

Change-Id: I8ddd8197a29cac1a0e0690d64c76aa240f9d2d3d

4 years ago(backport) tree-wide: drop several missing_*.h and import relevant headers from kerne...
Yu Watanabe [Wed, 10 Apr 2019 10:55:53 +0000 (19:55 +0900)]
(backport) tree-wide: drop several missing_*.h and import relevant headers from kernel-5.0

Change-Id: Icc04a53c32aa56a716feeeb783c12fb556652bb8

4 years agotree-wide: replace realpath with readlink -f
Adrian Szyndela [Thu, 5 Mar 2020 08:12:59 +0000 (09:12 +0100)]
tree-wide: replace realpath with readlink -f

Tizen's coreutils doesn't include 'realpath' utility, which was
introduced in coreutils 8.15. However, Tizen's coreutils includes 'readlink'
utility, which is very close to 'realpath' if called with '-f' param.

Change-Id: I08b6ed68fc6bf0c384b599f4de3724724345d5c7

4 years agoRevert (partial) "tree-wide: remove various unused functions"
Adrian Szyndela [Thu, 5 Mar 2020 09:52:04 +0000 (10:52 +0100)]
Revert (partial) "tree-wide: remove various unused functions"

This partially reverts commit 5dd9527883e0aa8705cf81448bc4bdb0456382fb.

bus_get_root_path() and sd_bus.cgroup_root are brought back.

Change-Id: Iad7b25472b3d877b1610b37e5473d9213fd661fc

4 years agoRevert "units: drop units/user/busnames.target"
Adrian Szyndela [Thu, 5 Mar 2020 08:30:26 +0000 (09:30 +0100)]
Revert "units: drop units/user/busnames.target"

This reverts commit df134443395f6e043e0cd2a45ab529583df96e4e.

4 years agoRevert "units: remove unused busnames.target"
Adrian Szyndela [Thu, 5 Mar 2020 08:28:16 +0000 (09:28 +0100)]
Revert "units: remove unused busnames.target"

This reverts commit 0ba89873372c3ab508852b4e0071da0719bcea0a.

4 years agoMerge v240 into tizen
Adrian Szyndela [Thu, 26 Mar 2020 15:35:12 +0000 (16:35 +0100)]
Merge v240 into tizen

systemd 240

4 years ago(backport) core: remove JoinControllers= configuration setting sandbox/adrians/upgrade-to-239
Lennart Poettering [Thu, 15 Nov 2018 20:07:43 +0000 (21:07 +0100)]
(backport) core: remove JoinControllers= configuration setting

This removes the ability to configure which cgroup controllers to mount
together. Instead, we'll now hardcode that "cpu" and "cpuacct" are
mounted together as well as "net_cls" and "net_prio".

The concept of mounting controllers together has no future as it does
not exist to cgroupsv2. Moreover, the current logic is systematically
broken, as revealed by the discussions in #10507. Also, we surveyed Red
Hat customers and couldn't find a single user of the concept (which
isn't particularly surprising, as it is broken...)

This reduced the (already way too complex) cgroup handling for us, since
we now know whenever we make a change to a cgroup for one controller to
which other controllers it applies.

Change-Id: I0eadd5f685980bd006134991310c0688ba7a86c5

4 years ago(backport) fs-util: make symlink_idempotent() optionally create relative link
Yu Watanabe [Sun, 23 Sep 2018 07:17:03 +0000 (16:17 +0900)]
(backport) fs-util: make symlink_idempotent() optionally create relative link

Change-Id: I24d38ca9a7e0f63095cd8fdf33b9686206ebf6a5

4 years ago(backport) nspawn: Move cgroup mount stuff from nspawn-mount.c to nspawn-cgroup.c
Luke Shumaker [Fri, 7 Jul 2017 22:57:08 +0000 (18:57 -0400)]
(backport) nspawn: Move cgroup mount stuff from nspawn-mount.c to nspawn-cgroup.c

Change-Id: Iaf44ed696c287b1cc0aa7a8c79773095a3c1ecc6

4 years ago(backport) nspawn: Simplify tmpfs_patch_options() usage, and trickle that up
Luke Shumaker [Tue, 13 Jun 2017 22:06:09 +0000 (18:06 -0400)]
(backport) nspawn: Simplify tmpfs_patch_options() usage, and trickle that up

One of the things that tmpfs_patch_options does is take an (optional) UID,
and insert "uid=${UID},gid=${UID}" into the options string.  So we need a
uid_t argument, and a way of telling if we should use it.  Fortunately,
that is built in to the uid_t type by having UID_INVALID as a possible
value.

So this is really a feature that requires one argument.  Yet, it is somehow
taking 4!  That is absurd.  Simplify it to only take one argument, and have
that trickle all the way up to mount_all()'s usage.

Now, in may of the uses, the argument becomes

    uid_shift == 0 ? UID_INVALID : uid_shift

because it used to treat uid_shift=0 as invalid unless the patch_ids flag
was also set.  This keeps the behavior the same.  Note that in all cases
where it is invoked, if !use_userns (sometimes called !userns), then
uid_shift is 0; we don't have to add any checks for that.

That said, I'm pretty sure that "uid=0" and not setting "uid=" are the
same, but Christian Brauner seemed to not think so when implementing the
cgns support.  https://github.com/systemd/systemd/pull/3589

Change-Id: I1b44d4415c10611b89423145f90b83e0d72eb4bc

4 years agoMerge v239 into tizen
Adrian Szyndela [Thu, 26 Mar 2020 15:27:17 +0000 (16:27 +0100)]
Merge v239 into tizen

systemd 239

4 years agosd-bus: fix fcntl flag for duplicating fd sandbox/adrians/upgrade-to-238
Adrian Szyndela [Thu, 26 Mar 2020 10:19:37 +0000 (11:19 +0100)]
sd-bus: fix fcntl flag for duplicating fd

4 years ago(backport) meson: unify linux/stat.h check with other checks and use _GNU_SOURCE
Zbigniew Jędrzejewski-Szmek [Wed, 18 Jul 2018 15:26:17 +0000 (17:26 +0200)]
(backport) meson: unify linux/stat.h check with other checks and use _GNU_SOURCE

Using _GNU_SOURCE is better because that's how we include the headers in the
actual build, and some headers define different stuff when it is defined.
sys/stat.h for example defines 'struct statx' conditionally.

Change-Id: I7cb80dc4339aa05d1a5dbebf483168c7dcce84d9

4 years ago(backport) build-sys: Detect whether struct statx is defined in sys/stat.h
Filipe Brandenburger [Mon, 16 Jul 2018 05:43:35 +0000 (22:43 -0700)]
(backport) build-sys: Detect whether struct statx is defined in sys/stat.h

Starting with glibc 2.27.9000-36.fc29, include file sys/stat.h will have a
definition for struct statx, in which case include file linux/stat.h should be
avoided, in order to prevent a duplicate definition.

    In file included from ../src/basic/missing.h:18,
     from ../src/basic/util.h:28,
     from ../src/basic/hashmap.h:10,
     from ../src/shared/bus-util.h:12,
     from ../src/libsystemd/sd-bus/bus-creds.c:11:
    /usr/include/linux/stat.h:99:8: error: redefinition of ‘struct statx’
     struct statx {
    ^~~~~
    In file included from /usr/include/sys/stat.h:446,
     from ../src/basic/util.h:19,
     from ../src/basic/hashmap.h:10,
     from ../src/shared/bus-util.h:12,
     from ../src/libsystemd/sd-bus/bus-creds.c:11:
    /usr/include/bits/statx.h:36:8: note: originally defined here
     struct statx
    ^~~~~

Extend our meson.build to look for struct statx when only sys/stat.h is
included and, in that case, do not include linux/stat.h anymore.

Tested that systemd builds correctly when using a glibc version that includes a
definition for struct statx.

glibc Fedora RPM update:
https://src.fedoraproject.org/rpms/glibc/c/28cb5d31fc1e5887912283c889689c47076278ae

glibc upstream commit:
https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=fd70af45528d59a00eb3190ef6706cb299488fcd

Change-Id: I830760b930f8ebe51198b0e9bdb00d7049b395a8

4 years agoMerge v238 into tizen
Adrian Szyndela [Thu, 26 Mar 2020 15:03:37 +0000 (16:03 +0100)]
Merge v238 into tizen

systemd 238

4 years agosd-bus: kdbus: fix callbacks for matches sandbox/adrians/upgrade-to-237
Adrian Szyndela [Mon, 23 Mar 2020 15:39:04 +0000 (16:39 +0100)]
sd-bus: kdbus: fix callbacks for matches

Add callbacks for matches to reply_callbacks to perform
them after processing synchronous response to asynchronous
calls to AddMatch.

4 years agosd-bus: kdbus: decouple creating message from enqueuing
Adrian Szyndela [Mon, 23 Mar 2020 15:18:03 +0000 (16:18 +0100)]
sd-bus: kdbus: decouple creating message from enqueuing

This separates creating replies from enqueuing them. This way we can use
enqueueing function for other replies.

No functional changes.