Systemd/src/core
Franck Bui e9fd88f2e9 core: allow 'SetUnitProperties()' to run on inactive units too
'set-property' has been primarly designed to change some properties of
*active* units.

However it can easily work on inactive units as well. In that case
changes are only saved in a drop-in for futur uses and changes will be
effective when unit will be started.

Actually it already works on inactive units but that was not
documented and not fully supported. Indeed the inactive units had to
be known by the manager otherwise it was reported as not loaded:

 $ systemctl status my-test.service
 * my-test.service - My Testing Unit
    Loaded: loaded (/etc/systemd/system/my-test.service; static; vendor preset: disabled)
   Drop-In: /etc/systemd/system/my-test.service.d
    Active: inactive (dead)

 $ systemctl set-property my-test.service MemoryLimit=1000000
 Failed to set unit properties on my-test.service: Unit my-test.service is not loaded.

[ Note: that the unit load state reported by the 'status' command
  might be confusing since it claimed the unit as loaded but
  'set-property' reported the contrary. ]

One can possibily workaround this by making the unit a dependency of
another active unit so the manager will keep it around:

 $ systemctl add-wants multi-user.target my-test.service
 Created symlink from /etc/systemd/system/multi-user.target.wants/my-test.service to /etc/systemd/system/my-test.service.

 $ systemctl set-property my-test.service MemoryLimit=1000000

 $ systemctl status my-test.service
 * my-test.service - My Testing Unit
    Loaded: loaded (/etc/systemd/system/my-test.service; enabled; vendor preset: disabled)
   Drop-In: /etc/systemd/system/my-test.service.d
            `-50-MemoryLimit.conf
    Active: inactive (dead)

This patch simply forces 'SetUnitProperties()' to load the unit if
it's not already the case.

It also documents the fact that 'set-property' can be used on inactive
units.
2015-11-22 15:06:14 +01:00
..
.gitignore
audit-fd.c util-lib: split out fd-related operations into fd-util.[ch] 2015-10-25 13:19:18 +01:00
audit-fd.h
automount.c core: drop "override" flag when building transactions 2015-11-12 19:54:07 +01:00
automount.h Move all unit states to basic/ and extend systemctl --state=help 2015-09-28 15:09:34 -04:00
bus-endpoint.c util-lib: split out allocation calls into alloc-util.[ch] 2015-10-27 13:45:53 +01:00
bus-endpoint.h core: rearrange code so that libsystemd/sd-bus/ does not include header files from core 2014-12-23 19:15:27 +01:00
bus-policy.c util-lib: split out allocation calls into alloc-util.[ch] 2015-10-27 13:45:53 +01:00
bus-policy.h bus: add missing bus-policy.[ch] 2014-12-23 21:06:01 +01:00
busname.c core: drop "override" flag when building transactions 2015-11-12 19:54:07 +01:00
busname.h util-lib: split our string related calls from util.[ch] into its own file string-util.[ch] 2015-10-24 23:05:02 +02:00
cgroup.c util-lib: move inotify-related definitions to fs-util.[ch] 2015-10-27 14:58:05 +01:00
cgroup.h cgroup: add support for net_cls controllers 2015-09-16 00:21:55 +02:00
dbus-automount.c util-lib: split our string related calls from util.[ch] into its own file string-util.[ch] 2015-10-24 23:05:02 +02:00
dbus-automount.h remove unused includes 2015-02-23 23:53:42 +01:00
dbus-busname.c util-lib: split our string related calls from util.[ch] into its own file string-util.[ch] 2015-10-24 23:05:02 +02:00
dbus-busname.h remove unused includes 2015-02-23 23:53:42 +01:00
dbus-cgroup.c util-lib: split out allocation calls into alloc-util.[ch] 2015-10-27 13:45:53 +01:00
dbus-cgroup.h util-lib: split our string related calls from util.[ch] into its own file string-util.[ch] 2015-10-24 23:05:02 +02:00
dbus-device.c remove unused includes 2015-02-23 23:53:42 +01:00
dbus-device.h remove unused includes 2015-02-23 23:53:42 +01:00
dbus-execute.c execute: Add new PassEnvironment= directive 2015-11-11 07:55:23 -08:00
dbus-execute.h util-lib: split our string related calls from util.[ch] into its own file string-util.[ch] 2015-10-24 23:05:02 +02:00
dbus-job.c util-lib: split out allocation calls into alloc-util.[ch] 2015-10-27 13:45:53 +01:00
dbus-job.h util-lib: split our string related calls from util.[ch] into its own file string-util.[ch] 2015-10-24 23:05:02 +02:00
dbus-kill.c util: split out signal-util.[ch] from util.[ch] 2015-05-29 20:14:11 +02:00
dbus-kill.h util-lib: split our string related calls from util.[ch] into its own file string-util.[ch] 2015-10-24 23:05:02 +02:00
dbus-manager.c core: allow 'SetUnitProperties()' to run on inactive units too 2015-11-22 15:06:14 +01:00
dbus-manager.h core: emit changes for NFailedUnits property 2015-02-26 09:38:50 -05:00
dbus-mount.c core: remove SmackFileSystemRootLabel= again 2015-11-12 12:50:59 +01:00
dbus-mount.h util-lib: split our string related calls from util.[ch] into its own file string-util.[ch] 2015-10-24 23:05:02 +02:00
dbus-path.c util-lib: split our string related calls from util.[ch] into its own file string-util.[ch] 2015-10-24 23:05:02 +02:00
dbus-path.h remove unused includes 2015-02-23 23:53:42 +01:00
dbus-scope.c util-lib: split out allocation calls into alloc-util.[ch] 2015-10-27 13:45:53 +01:00
dbus-scope.h
dbus-service.c core: expose number of file descriptors in fd store on the bus 2015-11-02 23:44:05 +01:00
dbus-service.h
dbus-slice.c remove unused includes 2015-02-23 23:53:42 +01:00
dbus-slice.h
dbus-socket.c util-lib: split out allocation calls into alloc-util.[ch] 2015-10-27 13:45:53 +01:00
dbus-socket.h
dbus-swap.c util-lib: split our string related calls from util.[ch] into its own file string-util.[ch] 2015-10-24 23:05:02 +02:00
dbus-swap.h
dbus-target.c remove unused includes 2015-02-23 23:53:42 +01:00
dbus-target.h util-lib: split our string related calls from util.[ch] into its own file string-util.[ch] 2015-10-24 23:05:02 +02:00
dbus-timer.c util-lib: split out allocation calls into alloc-util.[ch] 2015-10-27 13:45:53 +01:00
dbus-timer.h timer: timer can be a transient unit 2014-12-08 16:28:56 +01:00
dbus-unit.c Introduce bus_unit_check_load_state() helper 2015-11-22 15:05:40 +01:00
dbus-unit.h Introduce bus_unit_check_load_state() helper 2015-11-22 15:05:40 +01:00
dbus.c core: drop "override" flag when building transactions 2015-11-12 19:54:07 +01:00
dbus.h core: pass details to polkit for some unit actions 2015-09-06 00:07:17 +10:00
device.c Merge pull request #1837 from poettering/grabbag2 2015-11-11 02:31:29 +01:00
device.h Move all unit states to basic/ and extend systemctl --state=help 2015-09-28 15:09:34 -04:00
execute.c execute: Add new PassEnvironment= directive 2015-11-11 07:55:23 -08:00
execute.h execute: Add new PassEnvironment= directive 2015-11-11 07:55:23 -08:00
failure-action.c core: unify code that warns about jobs we fail to enqueue 2015-11-12 20:14:06 +01:00
failure-action.h core: introduce "poweroff" as new failure action types 2014-08-22 18:10:31 +02:00
hostname-setup.c treewide: use the negative error codes returned by our functions 2015-11-05 13:44:06 +01:00
hostname-setup.h
ima-setup.c util-lib: move more file I/O related calls into fileio.[ch] 2015-10-27 13:25:55 +01:00
ima-setup.h
job.c core: drop "override" flag when building transactions 2015-11-12 19:54:07 +01:00
job.h core: drop "override" flag when building transactions 2015-11-12 19:54:07 +01:00
kill.c util-lib: move string table stuff into its own string-table.[ch] 2015-10-27 13:25:56 +01:00
kill.h core: extend KillUnit() to return error when no unit was killed 2015-09-21 10:05:49 +02:00
killall.c util-lib: split out allocation calls into alloc-util.[ch] 2015-10-27 13:45:53 +01:00
killall.h
kmod-setup.c src/basic: rename audit.[ch] → audit-util.[ch] and capability.[ch] → capability-util.[ch] 2015-10-27 13:25:57 +01:00
kmod-setup.h
load-dropin.c remove unused includes 2015-02-23 23:53:42 +01:00
load-dropin.h Move dropin listing to shared 2014-12-16 00:30:33 -05:00
load-fragment-gperf.gperf.m4 core: remove support for RequiresOverridable= and RequisiteOverridable= 2015-11-12 19:27:24 +01:00
load-fragment.c core: remove support for RequiresOverridable= and RequisiteOverridable= 2015-11-12 19:27:24 +01:00
load-fragment.h core: remove support for RequiresOverridable= and RequisiteOverridable= 2015-11-12 19:27:24 +01:00
locale-setup.c util-lib: split our string related calls from util.[ch] into its own file string-util.[ch] 2015-10-24 23:05:02 +02:00
locale-setup.h
loopback-setup.c util-lib: split our string related calls from util.[ch] into its own file string-util.[ch] 2015-10-24 23:05:02 +02:00
loopback-setup.h
machine-id-setup.c util-lib: split out allocation calls into alloc-util.[ch] 2015-10-27 13:45:53 +01:00
machine-id-setup.h machine-id-setup: add a machine_id_commit call to commit on disk a transient machine-id 2014-12-03 03:41:19 +01:00
macros.systemd.in rpm: add user macros 2014-10-27 22:34:09 -04:00
main.c core: make sure to reset the bus error struct before reusing it 2015-11-12 20:14:33 +01:00
Makefile
manager.c Merge pull request #1869 from poettering/kill-overridable 2015-11-13 14:04:34 +01:00
manager.h core: unify code that warns about jobs we fail to enqueue 2015-11-12 20:14:06 +01:00
mount-setup.c util-lib: split out allocation calls into alloc-util.[ch] 2015-10-27 13:45:53 +01:00
mount-setup.h mount-setup: remove mount_setup_late() 2014-11-14 15:18:56 +01:00
mount.c core: remove SmackFileSystemRootLabel= again 2015-11-12 12:50:59 +01:00
mount.h core: remove SmackFileSystemRootLabel= again 2015-11-12 12:50:59 +01:00
namespace.c util-lib: split out allocation calls into alloc-util.[ch] 2015-10-27 13:45:53 +01:00
namespace.h core: Private*/Protect* options with RootDirectory 2015-05-18 18:47:45 +02:00
org.freedesktop.systemd1.conf systemctl: add add-wants and add-requires verbs 2014-10-08 12:44:00 +02:00
org.freedesktop.systemd1.policy.in.in core: rework policykit hookup 2015-02-18 18:56:27 +01:00
org.freedesktop.systemd1.service
path.c core: drop "override" flag when building transactions 2015-11-12 19:54:07 +01:00
path.h Move all unit states to basic/ and extend systemctl --state=help 2015-09-28 15:09:34 -04:00
scope.c core: simplify things a bit by checking default_dependencies boolean in callee, not caller 2015-11-11 20:42:39 +01:00
scope.h Move all unit states to basic/ and extend systemctl --state=help 2015-09-28 15:09:34 -04:00
selinux-access.c util-lib: split out allocation calls into alloc-util.[ch] 2015-10-27 13:45:53 +01:00
selinux-access.h tree-wide: remove unused functions 2015-10-19 21:46:01 +02:00
selinux-setup.c util-lib: split our string related calls from util.[ch] into its own file string-util.[ch] 2015-10-24 23:05:02 +02:00
selinux-setup.h mac: add mac_ prefix to distinguish origin security apis 2014-10-28 14:31:48 +01:00
service.c core: drop "override" flag when building transactions 2015-11-12 19:54:07 +01:00
service.h core: add support for setting stdin/stdout/stderr for transient services 2015-10-08 12:55:15 +02:00
show-status.c util-lib: split out allocation calls into alloc-util.[ch] 2015-10-27 13:45:53 +01:00
show-status.h util-lib: move status printing stuff into src/core/ 2015-10-27 13:25:56 +01:00
shutdown.c util-lib: split out allocation calls into alloc-util.[ch] 2015-10-27 13:45:53 +01:00
slice.c core: simplify things a bit by checking default_dependencies boolean in callee, not caller 2015-11-11 20:42:39 +01:00
slice.h Move all unit states to basic/ and extend systemctl --state=help 2015-09-28 15:09:34 -04:00
smack-setup.c util-lib: split out allocation calls into alloc-util.[ch] 2015-10-27 13:45:53 +01:00
smack-setup.h mac: add mac_ prefix to distinguish origin security apis 2014-10-28 14:31:48 +01:00
socket.c core: drop "override" flag when building transactions 2015-11-12 19:54:07 +01:00
socket.h core: add support for naming file descriptors passed using socket activation 2015-10-06 11:52:48 +02:00
swap.c core: simplify things a bit by checking default_dependencies boolean in callee, not caller 2015-11-11 20:42:39 +01:00
swap.h util-lib: split our string related calls from util.[ch] into its own file string-util.[ch] 2015-10-24 23:05:02 +02:00
system.conf core: system.conf: add DefaultTasksAccounting 2015-10-08 17:48:45 +03:00
systemd.pc.in build-sys: move systemd.pc from pkgconfiglibdir back into pkgconfigdatadir 2015-04-21 20:35:17 +02:00
target.c core: remove support for RequiresOverridable= and RequisiteOverridable= 2015-11-12 19:27:24 +01:00
target.h Move all unit states to basic/ and extend systemctl --state=help 2015-09-28 15:09:34 -04:00
timer.c core: drop "override" flag when building transactions 2015-11-12 19:54:07 +01:00
timer.h Move all unit states to basic/ and extend systemctl --state=help 2015-09-28 15:09:34 -04:00
transaction.c core: drop "override" flag when building transactions 2015-11-12 19:54:07 +01:00
transaction.h core: drop "override" flag when building transactions 2015-11-12 19:54:07 +01:00
umount.c util-lib: split out allocation calls into alloc-util.[ch] 2015-10-27 13:45:53 +01:00
umount.h
unit-printf.c core: simplify handling of %u, %U, %s and %h unit file specifiers 2015-11-12 17:57:04 +01:00
unit-printf.h
unit.c Merge pull request #1869 from poettering/kill-overridable 2015-11-13 14:04:34 +01:00
unit.h Merge pull request #1837 from poettering/grabbag2 2015-11-11 02:31:29 +01:00
user.conf core: Support system.conf.d and user.conf.d directories in the usual search paths 2014-11-29 13:55:31 -05:00