1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-05 15:21:37 +03:00
The systemd System and Service Manager
Go to file
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
catalog catalog: move danish catalog into the right place, and drop DOS line breaks 2015-11-13 13:52:00 +01:00
coccinelle coccinelle: additional errno.cocci hunk 2015-11-09 20:01:06 +01:00
docs docs: add .gitignore 2015-07-06 17:47:38 +02:00
factory/etc factory: remove broken pam_limits 2014-07-30 15:21:54 +02:00
hwdb hwdb: add axis range corrections for Lenovo T510 2015-11-10 14:19:29 +10:00
m4 build-sys: Check behavior of -Werror=shadow before deciding to use it 2015-09-22 09:54:33 -07:00
man core: allow 'SetUnitProperties()' to run on inactive units too 2015-11-22 15:06:14 +01:00
network networkd: emit DNS/NTP/Timezone info via DHCP server by default 2015-08-27 16:47:26 +02:00
po Remove snapshot unit type 2015-11-10 19:33:06 -05:00
rules rfkill: rework and make it listen on /dev/rfkill 2015-10-01 16:21:09 +02:00
shell-completion execute: Add new PassEnvironment= directive 2015-11-11 07:55:23 -08:00
src core: allow 'SetUnitProperties()' to run on inactive units too 2015-11-22 15:06:14 +01:00
sysctl.d core: bump net.unix.max_dgram_qlen really early during boot 2015-11-02 23:44:05 +01:00
system-preset preset: enable machines.target by default 2014-12-29 17:36:57 +01:00
sysusers.d turn kdbus support into a runtime option 2015-06-17 18:01:49 +02:00
test tests: fix unstoppable service 2015-11-12 03:24:10 +00:00
tmpfiles.d tmpfiles.d: change all subvolumes to use quota 2015-10-22 01:59:25 +02:00
tools terminal: drop unfinished code 2015-07-27 20:15:34 +02:00
units core: remove SmackFileSystemRootLabel= again 2015-11-12 12:50:59 +01:00
xorg login: support user-bus on dbus1 2015-08-31 18:12:37 +02:00
.dir-locals.el Keep emacs configuration in one configuration file. 2011-03-08 01:53:46 +01:00
.gitattributes git: indicate that tabs are never OK in the systemd tree 2013-10-30 02:25:38 +01:00
.gitignore sd-pppoe: drop 2015-11-03 16:14:12 +01:00
.mailmap NEWS: add more stuff, and reorder things a bit 2015-11-13 13:59:50 +01:00
.travis.yml remove gudev and gtk-doc 2015-06-03 00:22:53 +02:00
.vimrc vimrc: disable -fdiagnostics-color output 2013-10-20 04:29:39 +02:00
.ycm_extra_conf.py ycm: update flag blacklist 2014-06-04 15:41:10 -04:00
autogen.sh terminal: drop unfinished code 2015-07-27 20:15:34 +02:00
CODING_STYLE CODING_STYLE: elaborate on usage of C99 fixed size integer types 2015-11-10 17:31:30 +01:00
configure.ac build-sys: temporarily lower libmount version check 2015-11-03 07:25:34 -06:00
DISTRO_PORTING build-sys: warn if people don't change the default NTP servers when building systemd 2015-07-11 14:24:29 -03:00
LICENSE.GPL2 relicense to LGPLv2.1 (with exceptions) 2012-04-12 00:24:39 +02:00
LICENSE.LGPL2.1 licence: remove references to old FSF address 2012-12-17 11:41:31 +01:00
Makefile-man.am Remove snapshot unit type 2015-11-10 19:33:06 -05:00
Makefile.am install: follow unit file symlinks in /usr, but not /etc when looking for [Install] data 2015-11-12 17:57:04 +01:00
NEWS NEWS: add more stuff, and reorder things a bit 2015-11-13 13:59:50 +01:00
README core: drop check for /etc/mtab 2015-11-02 10:05:20 -06:00
README.md README.md: add Coverity scan status badge 2015-06-08 13:26:54 +02:00
TODO Merge pull request #1869 from poettering/kill-overridable 2015-11-13 14:04:34 +01:00

systemd - System and Service Manager

Build Status
Coverity Scan Status

Details

  • General information about systemd can be found in the systemd Wiki
  • Information about build requirements are provided in the README file