From ee5762e3780c048b230e8c1e7659e40fc1f443bf Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Sat, 24 Jul 2010 00:53:33 +0200 Subject: systemctl: fold systemd-install into systemctl --- man/daemon.xml | 49 ++++--- man/systemctl.xml | 330 +++++++++++++++++++++++++++++++++++++----------- man/systemd-install.xml | 303 -------------------------------------------- man/systemd.unit.xml | 17 +-- man/systemd.xml | 21 +-- 5 files changed, 311 insertions(+), 409 deletions(-) delete mode 100644 man/systemd-install.xml (limited to 'man') diff --git a/man/daemon.xml b/man/daemon.xml index fb22e6c616..30d39d7be1 100644 --- a/man/daemon.xml +++ b/man/daemon.xml @@ -543,10 +543,10 @@ the hardware of the respective kind is plugged in or otherwise becomes available. In a new-style init system it is possible to bind - activation to hardware plug/unplug events. In systemd, - kernel devices appearing in the sysfs/udev - device tree can be exposed as units if they - are tagged with the string + activation to hardware plug/unplug events. In + systemd, kernel devices appearing in the + sysfs/udev device tree can be exposed as units + if they are tagged with the string "systemd". Like any other kind of unit they may then pull in other units when activated (i.e. Plugged in) and thus @@ -570,8 +570,9 @@ bluetoothd.service via controlling a bluetooth.target.wants/ - symlink uniformly with a tool like - systemd-install1 + symlink uniformly with a command like + enable of + systemctl1 instead of manipulating the udev ruleset. @@ -756,9 +757,9 @@ install their systemd unit files in the directory returned by pkg-config systemd - --variable=systemdsystemunitdir - (for system services), - resp. pkg-config systemd + --variable=systemdsystemunitdir (for + system services), resp. pkg-config + systemd --variable=systemdsessionunitdir (for session services). This will make the services available in the system on explicit @@ -767,8 +768,9 @@ installation (e.g. rpm -i by the administrator) symlinks should be created in the systemd configuration - directories via the - systemd-install1 + directories via the enable + command of the + systemctl1 tool, to activate them automatically on boot. @@ -823,20 +825,32 @@ endif package managers: %post -/usr/bin/systemd-install --realize enable foobar.service foobar.socket >/dev/null 2>&1 || : +if [ $1 -eq 1 ]; then + # Enable (but don't start) the units by default + /bin/systemctl enable foobar.service foobar.socket >/dev/null 2>&1 || : +fi %preun -if [ "$1" -eq 0 ]; then - /usr/bin/systemd-install --realize disable foobar.service foobar.socket >/dev/null 2>&1 || : +if [ $1 -eq 0 ]; then + # Disable and stop the units + /bin/systemctl disable foobar.service foobar.socket >/dev/null 2>&1 || : + /bin/systemctl stop foobar.service foobar.socket >/dev/null 2>&1 || : +fi + +%postun +if [ $1 -ge 1 ] ; then + # On upgrade, reload init system configuration if we changed unit files + /bin/systemctl daemon-reload >/dev/null 2>&1 || : + # On upgrade, restart the daemon + /bin/systemctl try-restart foobar.service >/dev/null 2>&1 || : fi Depending on whether your service should or should not be started/stopped/restarted during package installation, deinstallation or - upgrade, a different argument to - may be + upgrade, a different set of commands may be specified. See - systemd-install1 + systemctl1 for details. @@ -909,7 +923,6 @@ fi See Also systemd1, - systemd-install1, sd-daemon7, sd_listen_fds3, sd_notify3, diff --git a/man/systemctl.xml b/man/systemctl.xml index 678bf0b2ee..6e4b203d88 100644 --- a/man/systemctl.xml +++ b/man/systemctl.xml @@ -21,7 +21,7 @@ along with systemd; If not, see . --> - + systemctl @@ -96,8 +96,9 @@ When showing unit/job/manager information, limit - display to certain property names. If - not specified all set properties are + display to certain properties as + specified as argument. If not + specified all set properties are shown. The argument should be a property name, such as MainPID. If @@ -131,12 +132,48 @@ If the requested - operation conflicts with an existing - unfinished operation, fail the - command. If this is not specified the - requested operation will replace the - pending job if - necessary. + operation conflicts with a pending + unfinished job, fail the command. If + this is not specified the requested + operation will replace the pending job, + if necessary. + + + + + + + Suppress output to + STDOUT in + snapshot, + check, + enable and + disable. + + + + + + Do not synchronously wait for + the requested operation to finish. If this is + not specified the job will be verified, + enqueued and systemctl will + wait until it is completed. By passing this + argument it is only verified and + enqueued. + + + + + Talk to the systemd + system manager. (Default) + + + + + + Talk to the systemd + session manager of the calling user. @@ -166,46 +203,55 @@ - + - Talk to the systemd - system manager. (Default) + Don't send wall + message before + halt, power-off, reboot. - + - Talk to the systemd - session manager of the calling user. + When used with + enable and + disable, operate on the + global session configuĊ•ation + directory, thus enabling or disabling + a unit file globally for all future + sessions of all users. - + - Do not synchronously wait for - the requested operation to finish. If this is - not specified the job will be verified, - enqueued and systemctl will - wait until it is completed. By passing this - argument it is only verified and - enqueued. + When used with + enable and + disable, do not + implicitly reload daemon configuration + after executing the + changes. + - - + - Suppress output to - STDOUT for snapshot - and - check. + When used with + enable, override any + existing conflicting + symlinks. - + - Don't send wall - message before - halt, power-off, reboot. + When used with + disable, ensures + that only the symlinks created by + enable are removed, + not all symlinks pointing to the unit + file that shall be + disabled. @@ -220,29 +266,28 @@ start [NAME...] - Start one or more - units specified on the command + Start (activate) one + or more units specified on the command line. stop [NAME...] - Stop one or more units - specified on the command + Stop (deactivate) one + or more units specified on the command line. reload [NAME...] - Asks all services - whose units are listed on the command - line to reload their + Asks all units listed + on the command line to reload their configuration. Note that this will - reload the daemon configuration - itself, not the unit configuration - file of systemd. If you want systemd - to reload the configuration file of a - unit use the + reload the service-specific + configuration, not the unit + configuration file of systemd. If you + want systemd to reload the + configuration file of a unit use the daemon-reload command. In other words: for the example case of Apache, this will @@ -250,10 +295,12 @@ httpd.conf in the web server, not the apache.service - systemd unit file. This - command should not be confused with - the daemon-reload - or load + systemd unit file. + + This command should not be + confused with the + daemon-reload or + load commands. @@ -280,9 +327,14 @@ reload-or-try-restart [NAME...] Reload one or more - units if they support it. If not - restart them - instead. + units if they support it. If not, + restart them instead. Note that for + compatibility with SysV and Red Hat + init scripts + force-reload and + condrestart may be + used as equivalent commands to + reload-or-try-restart. isolate [NAME] @@ -293,12 +345,12 @@ others. - check [NAME...] + is-active [NAME...] Check whether any of the specified units is active - (i.e. running). Returns 0 if at least - one is active, non-zero + (i.e. running). Returns an exit code + 0 if at least one is active, non-zero otherwise. Unless is specified this will also print the current unit @@ -307,24 +359,36 @@ status [NAME...] - Show short status - information about one or more - units. This shows terse runtime - information about - units. + Show terse runtime + status information about one or more + units. This function is intended to + generate human-readable output. If you + are looking for computer-parsable + output, use show + instead. show [NAME...|JOB...] - Show properties of - one or more units, jobs or the manager + Show properties of one + or more units, jobs or the manager itself. If no argument is specified properties of the manager will be shown. If a unit name is specified - properties of the unit is shown, - and if a job id is specified - properties of the job is - shown. + properties of the unit is shown, and + if a job id is specified properties of + the job is shown. By default, empty + properties are suppressed. Use + to show those + too. To select specific properties to + show use + . This + command is intended to be used + whenever computer-parsable output is + required. Use + status if you are + looking for formatted human-readable + output. @@ -345,6 +409,133 @@ command. + + enable [NAME...] + + Enable one or more + unit files, as specified on the + command line. This will create a + number of symlinks as encoded in the + [Install] sections + of the unit files. After the symlinks + have been created the systemd + configuration is reloaded (in a way + that is equivalent to + daemon-reload) to + ensure the changes are taken into + account immediately. Note that this + does not have the effect that any of + the units enabled are also started at + the same time. If this is desired a + seperate start + command must be invoked for the + unit. + + This command will + print the actions executed. This + output may be suppressed by passing + . + + Note that this operation creates + only the suggested symlinks for the + units. While this command is the + recommended way to manipulate the unit + configuration directory, the + administrator is free to make + additional changes manually, by + placing or removing symlinks in the + directory. This is particular useful + to create configurations that deviate + from the suggested default + installation. In this case the + administrator must make sure to invoke + daemon-reload + manually as necessary, to ensure his + changes are taken into account. + + Enabling units should not be + confused with starting (activating) + units, as done by the + start + command. Enabling and starting units + is orthogonal: units may be enabled + without being started and started + without being enabled. Enabling simply + hooks the unit into various suggested + places (for example, so that the unit + is automatically started on boot or + when a particular kind of hardware is + plugged in). Starting actually spawns + the daemon process (in case of service + units), or binds the socket (in case + of socket units), and so + on. + + Depending on whether + , + or + is specified + this enables the unit for the system, + for sessions of the calling user only + or for all future session of all + users. Note that in the latter case no + systemd daemon configuration is + reloaded. + + + + + disable [NAME...] + + Disables one or more + units. This removes all symlinks to + the specified unit files from the unit + configuration directory, and hence + undoes the changes made by + enable. Note + however that this by default removes + all symlinks to the unit files + (i.e. including manual additions), not + just those actually created by + enable. If only the + symlinks that are suggested by default + shall be removed, pass + . This + implicitly reloads the systemd daemon + configuration after completing the + disabling of the units. Note that this + command does not implicitly stop the + units that is being disabled. If this + is desired an additional + stopcommand should + be executed afterwards. + + This command will print the + actions executed. This output may be + suppressed by passing + . + + + This command honours + , + , + in a similar + way as + enable. + + + + is-enabled [NAME...] + + Checks whether any of + the specified unit files is enabled + (as with + enable). Returns an + exit code of 0 if at least one is + enabled, non-zero + otherwise. + + load [NAME...] @@ -384,12 +575,7 @@ Cancel one or more jobs specified on the command line by their numeric job - IDs. - - - clear-jobs - - Cancel all jobs that are in progress. + IDs. If not job id is specified cancels all jobs that are pending. monitor diff --git a/man/systemd-install.xml b/man/systemd-install.xml deleted file mode 100644 index 228a916999..0000000000 --- a/man/systemd-install.xml +++ /dev/null @@ -1,303 +0,0 @@ - - - - - - - - - systemd-install - systemd - - - - Developer - Lennart - Poettering - lennart@poettering.net - - - - - - systemd-install - 1 - - - - systemd-install - Enable or disable a systemd unit - definition file - - - - - systemd-install OPTIONS enable NAME - - - systemd-install OPTIONS disable NAME - - - systemd-install OPTIONS realize NAME - - - systemd-install OPTIONS test NAME - - - - - Description - - systemd-install enables or - disables systemd units, or checks whether they are - enabled, according to the installation suggestions - included in the unit files. - - This command is useful to apply or undo the - installation instructions encoded in the [Install] - section of unit files. See - systemd.unit5 - for more information. - - Enabling units (as with systemd-install - enable) should not be confused with - activating units (as with systemctl - start). The former simply installs the unit - files in the configuration tree, but does not start - them. The latter equals starting them, but does not - necessarily require them to be enabled. - - Note that while - systemd-install is the recommended - tool to create or remove symlinks in the systemd - configuration directory the administrator can also - create links there manually, which is particularly - useful to use configurations that deviate from the - installation suggestions included in the unit - files. - - - - Options - - The following options are understood: - - - - - - Prints a short help - text and exits. - - - - - - Enable/disable a - service even if it conflicts - with/contradicts another service. This - might have the effect of disabling - another service that was - enabled. - - - - - - Enable/disable a - system service. - - - - - - Enable/disable a - session service for the calling - user. - - - - - - Enable/disable a - session service for all - users. - - - - - - After - enabling/disabling stop/restart/stop - the unit and reload manager - configuration. Optionally, takes one - of , - , - , - or - . If - is passed the - manager will not reload its - configuration and no service will be - started or stopped after - enabling/disabling of the unit - files. If is - passed the daemon configuration is - reloaded but the unit otherwise not - started/stopped/restarted. If - is passed and - a unit is being enabled it will also - be restarted should it already be - running. If a unit is being disabled - it will be stopped should it be - running. In either case the daemon - configuration is - reloaded. is - similar to this, but the unit will - also be started if it is being enabled - and any of the units listed in - WantedBy= in the - [Install] section - of the unit file is already - activated. Finally - starts the unit - unconditionally after enabling. This - setting defaults to - . If - is - specifieed but the mode value is - omitted defaults to - . This option - has no effect when - or - test is used, or - when systemd is not running or the - command is executed in a - chroot2 - environment. This option is implied if - the realize command - is used. - - - - - - If set makes sure that - all symlinks on the specified unit are - removed from the configuration - directory and its subdirectories, not - just those specified in the - [Install] - section. - - - - - - - Show what is done as - it is done. - - - - - The following commands are understood: - - - - enable - - Enable one or more - units. This will create a number of - symlinks as encoded in the - [Install] section - of a unit file. - - - - disable - - Disable or more - units. This will remove a number of - symlinks as encoded in the - [Install] section - of a unit file. - - - - realize - - Does not enable or - disable any unit. Checks whether any - of the units specified are enabled, - and then starts/stops/restarts the - units accordingly. This will check for - the existence of a number of symlinks - as encoded in the - [Install] section - of a unit file, and then executes the - action normally specified by - . If - is not - specified implies - mode. To - override this mode specify - in - addition to - realize. - - - - test - - Does not enable or - disable any unit. Checks whether any - of the units specified are - enabled. This will check for the - existence of a number of symlinks as - encoded in the - [Install] section - of a unit file, and return with an - exit code of 0 if a unit is enabled, 1 - otherwise. - - - - - - - - Exit status - - On success 0 is returned, a non-zero failure - code otherwise. - - - - See Also - - systemd1, - systemctl1, - systemd.unit5 - - - - diff --git a/man/systemd.unit.xml b/man/systemd.unit.xml index 7284524dbb..585145ab37 100644 --- a/man/systemd.unit.xml +++ b/man/systemd.unit.xml @@ -136,8 +136,8 @@ Wanted= see below. The preferred way to create symlinks in the .wants/ directory of a service is - with the - systemd-install1 + with the enable command of the + systemctl1 tool which reads information from the [Install] section of unit files. (See below.) @@ -539,7 +539,9 @@ section is not interpreted by systemd1 during runtime. It is used exclusively by the - systemd-install1 + enable and + disable commands of the + systemctl1 tool during installation of a unit: @@ -554,7 +556,7 @@ more than once, in which case all listed names are used. At installation time, - systemd-install + systemctl enable will create symlinks from these names to the unit file name. Note that this is different from the @@ -567,8 +569,8 @@ Alias= apply only if the unit has actually been installed with the - systemd-install - tool. Also, if systemd searches for a + systemctl enable + command. Also, if systemd searches for a unit, it will discover symlinked alias names as configured with Alias=, but not @@ -607,7 +609,7 @@ installed. If the user requests installation of a unit with this option configured, - systemd-install + systemctl enable will automatically install units listed in this option as well. @@ -621,7 +623,6 @@ systemd1, systemctl8, - systemd-install1, systemd.special7, systemd.service5, systemd.socket5, diff --git a/man/systemd.xml b/man/systemd.xml index c027b4f660..d2112b1bf0 100644 --- a/man/systemd.xml +++ b/man/systemd.xml @@ -448,9 +448,12 @@ --variable=systemdsystemconfdir returns the path of the system configuration directory. Packages - should alter the content of these directories - only with the - systemd-install1 + should alter the content of these + directories only with the + enable and + disable commands of + the + systemctl1 tool. @@ -469,11 +472,14 @@ unit files in the directory returned by pkg-config systemd --variable=systemdsessionunitdir. Global - configuration is done in the - directory reported by - pkg-config systemd + configuration is done in the directory + reported by pkg-config + systemd --variable=systemdsessionconfdir. The - systemd-install1 + enable and + disable commands of + the + systemctl1 tool can handle both global (i.e. for all users) and private (for one user) enabling/disabling of @@ -923,7 +929,6 @@ systemctl1, systemadm1, - systemd-install1, systemd-notify1, daemon7, sd-daemon7, -- cgit v1.2.3-54-g00ecf