Commit Graph

247 Commits

Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek 2e2ed88062 pid1,systemctl: allow symbolic exit code names 2019-07-29 15:54:53 +02:00
Anita Zhang 31cd5f63ce core: ExecCondition= for services
Closes #10596
2019-07-17 11:35:02 +02:00
Lennart Poettering bfcb9d3a7d man: be more explicit that Type=oneshot services are not "active" after starting
Fixes: #13000
2019-07-12 14:25:28 +02:00
Lennart Poettering 8c8208cb80 man: document new "systemctl clean…" operation 2019-07-11 12:18:51 +02:00
Lennart Poettering b30772a403 man: correct that Sockets= may not be undone
Fixes: #12415
2019-06-24 14:22:43 +02:00
Jan Klötzke dc653bf487 service: handle abort stops with dedicated timeout
When shooting down a service with SIGABRT the user might want to have a
much longer stop timeout than on regular stops/shutdowns. Especially in
the face of short stop timeouts the time might not be sufficient to
write huge core dumps before the service is killed.

This commit adds a dedicated (Default)TimeoutAbortSec= timer that is
used when stopping a service via SIGABRT. In all other cases the
existing TimeoutStopSec= is used. The timer value is unset by default
to skip the special handling and use TimeoutStopSec= for state
'stop-watchdog' to keep the old behaviour.

If the service is in state 'stop-watchdog' and the service should be
stopped explicitly we still go to 'stop-sigterm' and re-apply the usual
TimeoutStopSec= timeout.
2019-04-12 17:32:52 +02:00
Lennart Poettering 8e74bf7f9c man: document new OOMPolicy= setting 2019-04-09 11:17:58 +02:00
Lennart Poettering 438e6a48be man: add references from the .mount and .service man pages to systemd-{mount,run} pages
Fixes: #12235
2019-04-08 15:25:36 +02:00
Zbigniew Jędrzejewski-Szmek 3aaae27a75 man: clarify that ExecStop= is always called
Fixes #11744.
2019-03-22 16:28:43 +01:00
Zbigniew Jędrzejewski-Szmek 3a54a15760 man: use same header for all files
The "include" files had type "book" for some raeason. I don't think this
is meaningful. Let's just use the same everywhere.

$ perl -i -0pe 's^..DOCTYPE (book|refentry) PUBLIC "-//OASIS//DTD DocBook XML V4.[25]//EN"\s+"http^<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"\n  "http^gms' man/*.xml
2019-03-14 14:42:05 +01:00
Zbigniew Jędrzejewski-Szmek 0307f79171 man: standarize on one-line license header
No need to waste space, and uniformity is good.

$ perl -i -0pe 's|\n+<!--\s*SPDX-License-Identifier: LGPL-2.1..\s*-->|\n<!-- SPDX-License-Identifier: LGPL-2.1+ -->|gms' man/*.xml
2019-03-14 14:29:37 +01:00
Lennart Poettering 5763971014 man: be even more explicit that RestartPreventExitStatus= does not affect ExecStartPre=
The man page was already pretty clear about this, but apparently not
clear enough, let's hence extend this further.

Fixes: #11868
2019-03-14 08:11:12 +01:00
Anita Zhang 7ca69792e5 core: add ':' prefix to ExecXYZ= skip env var substitution 2019-02-20 17:58:14 +01:00
Yu Watanabe d1698b82e6 man: add referecne to systemd-system.conf 2019-02-01 12:31:51 +01:00
Zbigniew Jędrzejewski-Szmek 3f9a0a522f tree-wide: s/time-out/timeout/g
From WordNet (r) 3.0 (2006) [wn]:

  time-out
      n 1: a brief suspension of play; "each team has two time-outs left"

From The Free On-line Dictionary of Computing (18 March 2015) [foldoc]:

  timeout

     A period of time after which an error condition is raised if
     some event has not occured.  A common example is sending a
     message.  If the receiver does not acknowledge the message
     within some preset timeout period, a transmission error is
     assumed to have occured.
2018-12-14 11:17:52 +01:00
Lennart Poettering 899feb7225 man: let's deprecate PermissionsStartOnly=
The concept is redundant and predates the special chars that do the same
in ExecStar=. Let's settle on advertising just the latter, and hide
PermissionsStartOnly= from the docs (even if we continue supporting it).
2018-11-16 14:31:37 +01:00
Lennart Poettering a9353a5c5b core: log about /var/run/ prefix used in PIDFile=, patch it to be /run instead
In a way this is a follow-up for
a2d1fb882c, but adds a similar warning for
PIDFile=.

There's a much stronger case for doing this kind of notification in
tmpfiles.d (since it helps relating lines to each other for the purpose
of merging them). Doing this for PIDFile= is mostly about being
systematic and copying tmpfiles.d/ behaviour here.

While we are at it, let's also support relative filenames in PIDFile=
now, and prefix them with /run, to make them absolute.

Fixes: #10657
2018-11-10 19:17:00 +01:00
Anita Zhang c87700a133 Make Watchdog Signal Configurable
Allows configuring the watchdog signal (with a default of SIGABRT).
This allows an alternative to SIGABRT when coredumps are not desirable.

Appropriate references to SIGABRT or aborting were renamed to reflect
more liberal watchdog signals.

Closes #8658
2018-09-26 16:14:29 +02:00
Lennart Poettering 79905a246d man: document the new Type=exec type
And while we are at it, let's rearrange and extend the Type=
documentation a bit. Let's make it an itemized list, and let's add a
paragraph explaining which type best to use.
2018-07-25 22:48:11 +02:00
Lennart Poettering 6e0210908e man: clarify that prefixing ExecStart= lines with "-" won't cause systemd to not record non-zero exit statuses
See: #9588
2018-07-17 06:32:54 -07:00
Zbigniew Jędrzejewski-Szmek 514094f933 man: drop mode line in file headers
This is already included in .dir-locals, so we don't need it
in the files themselves.
2018-07-03 01:32:25 +02:00
Jan Synacek 9a6da355a0 man: correct the meaning of TimeoutStopSec= (#9325)
Fixes: #9325
2018-06-22 12:56:28 +02:00
Zbigniew Jędrzejewski-Szmek fdbbee37d5 man: drop unused <authorgroup> tags from man sources
Docbook styles required those to be present, even though the templates that we
use did not show those names anywhere. But something changed semi-recently (I
would suspect docbook templates, but there was only a minor version bump in
recent years, and the changelog does not suggest anything related), and builds
now work without those entries. Let's drop this dead weight.

Tested with F26-F29, debian unstable.

$ perl -i -0pe 's/\s*<authorgroup>.*<.authorgroup>//gms' man/*xml
2018-06-14 12:22:18 +02:00
Lennart Poettering 0c69794138 tree-wide: remove Lennart's copyright lines
These lines are generally out-of-date, incomplete and unnecessary. With
SPDX and git repository much more accurate and fine grained information
about licensing and authorship is available, hence let's drop the
per-file copyright notice. Of course, removing copyright lines of others
is problematic, hence this commit only removes my own lines and leaves
all others untouched. It might be nicer if sooner or later those could
go away too, making git the only and accurate source of authorship
information.
2018-06-14 10:20:20 +02:00
Lennart Poettering 818bf54632 tree-wide: drop 'This file is part of systemd' blurb
This part of the copyright blurb stems from the GPL use recommendations:

https://www.gnu.org/licenses/gpl-howto.en.html

The concept appears to originate in times where version control was per
file, instead of per tree, and was a way to glue the files together.
Ultimately, we nowadays don't live in that world anymore, and this
information is entirely useless anyway, as people are very welcome to
copy these files into any projects they like, and they shouldn't have to
change bits that are part of our copyright header for that.

hence, let's just get rid of this old cruft, and shorten our codebase a
bit.
2018-06-14 10:20:20 +02:00
Michael Prokop 7fc97da0f8 man: fix typo 2018-06-06 12:22:47 +09:00
Lucas Werkmeister 90bc77af29 man: fix typo 2018-05-19 15:01:52 +09:00
Alan Jenkins 4330dc03a0 service: FileDescriptorStoreMax should also imply NotifyAccess
Commenting out "WatchdogTimeout=3min" in systemd-logind.service causes
NotifyAccess to go from "main" to "none", breaking support for logind
restart.  Let's fix that.
2018-05-15 12:33:56 +02:00
Lennart Poettering d28e92c3fc
Merge pull request #8735 from keszybz/small-docs-updates
Small docs updates
2018-04-18 11:50:56 +02:00
Zbigniew Jędrzejewski-Szmek aed5cb03db man: merge two sections into two subsections of one section
Those are very close subjects that are a good fit for one section.
2018-04-18 10:04:10 +02:00
Zbigniew Jędrzejewski-Szmek 75695fb798 man: describe unit templating explicitly
This patch is heavily based on the text suggested by
archenemies in #3791.

Fixes #3791.
2018-04-18 10:04:10 +02:00
Lennart Poettering 2cb36f7c1e
Merge pull request #8575 from keszybz/non-absolute-paths
Do not require absolute paths in ExecStart and friends
2018-04-17 15:54:10 +02:00
Zbigniew Jędrzejewski-Szmek e12d446b66 systemd-path: allow the default search path to be queried 2018-04-16 16:09:46 +02:00
Zbigniew Jędrzejewski-Szmek 5008da1ec1 systemd: do not require absolute paths in ExecStart
Absolute paths make everything simple and quick, but sometimes this requirement
can be annoying. A good example is calling 'test', which will be located in
/usr/bin/ or /bin depending on the distro. The need the provide the full path
makes it harder a portable unit file in such cases.

This patch uses a fixed search path (DEFAULT_PATH which was already used as the
default value of $PATH), and if a non-absolute file name is found, it is
immediately resolved to a full path using this search path when the unit is
loaded. After that, everything behaves as if an absolute path was specified. In
particular, the executable must exist when the unit is loaded.
2018-04-16 16:09:46 +02:00
Zbigniew Jędrzejewski-Szmek 11a1589223 tree-wide: drop license boilerplate
Files which are installed as-is (any .service and other unit files, .conf
files, .policy files, etc), are left as is. My assumption is that SPDX
identifiers are not yet that well known, so it's better to retain the
extended header to avoid any doubt.

I also kept any copyright lines. We can probably remove them, but it'd nice to
obtain explicit acks from all involved authors before doing that.
2018-04-06 18:58:55 +02:00
Oleander Reis 2d06ddb7b4 man:systemd.service(5): fix description of specifiers in command lines (#8146)
Command lines now accept specifiers within the first argument.

see issues #3061, #679 and pr #4835
2018-02-09 17:03:09 +01:00
Faalagorn ed10715af2 man: .service <filename> to <literal> (#8126)
Changed <filename>.service</filename> to <literal>.service</literal> to match style in other manual pages: man 5 systemd.socket, device, mount, automount, swap, target path, timer, slice and scope.
2018-02-08 09:14:55 +01:00
Lennart Poettering db256aab13 core: be stricter when handling PID files and MAINPID sd_notify() messages
Let's be more restrictive when validating PID files and MAINPID=
messages: don't accept PIDs that make no sense, and if the configuration
source is not trusted, don't accept out-of-cgroup PIDs. A configuratin
source is considered trusted when the PID file is owned by root, or the
message was received from root.

This should lock things down a bit, in case service authors write out
PID files from unprivileged code or use NotifyAccess=all with
unprivileged code. Note that doing so was always problematic, just now
it's a bit less problematic.

When we open the PID file we'll now use the CHASE_SAFE chase_symlinks()
logic, to ensure that we won't follow an unpriviled-owned symlink to a
privileged-owned file thinking this was a valid privileged PID file,
even though it really isn't.

Fixes: #6632
2018-01-11 15:12:16 +01:00
Alan Jenkins 3f2d136505 man: generalize "binary" to "program" (#7668)
Systemd services are permitted to be scripts, as well as binary
executables.

The same also applies to the underlying /sbin/mount and /sbin/swapon.
It is not necessary for the user to consider what type of program file
these are.  Nor is it necessary with systemd-nspawn, to distinguish between
init as a "binary" v.s. a user-specified "program".

Also fix a couple of grammar nits in the modified sentences.
2017-12-16 11:48:12 +01:00
Ken (Bitsko) MacLeod bd2538b50b man: Clarify when OnFailure= activates after restarts (#7646) 2017-12-15 11:10:41 +01:00
Daniel Black a327431bd1 core: add EXTEND_TIMEOUT_USEC={usec} - prevent timeouts in startup/runtime/shutdown (#7214)
With Type=notify services, EXTEND_TIMEOUT_USEC= messages will delay any startup/
runtime/shutdown timeouts.

A service that hasn't timed out, i.e, start time < TimeStartSec,
runtime < RuntimeMaxSec and stop time < TimeoutStopSec, may by sending
EXTEND_TIMEOUT_USEC=, allow the service to continue beyond the limit for
the execution phase (i.e TimeStartSec, RunTimeMaxSec and TimeoutStopSec).

EXTEND_TIMEOUT_USEC= must continue to be sent (in the same way as
WATCHDOG=1) within the time interval specified to continue to reprevent
the timeout from occuring.

Watchdog timeouts are also extended if a EXTEND_TIMEOUT_USEC is greater
than the remaining time on the watchdog counter.

Fixes #5868.
2017-12-14 12:17:43 +01:00
Lennart Poettering 53c35a766f core: generalize FailureAction= move it from service to unit
All kinds of units can fail, hence it makes sense to offer this as
generic concept for all unit types.
2017-11-20 16:37:22 +01:00
Zbigniew Jędrzejewski-Szmek 572eb058cf Add SPDX license identifiers to man pages 2017-11-19 19:08:15 +01:00
Lennart Poettering 8adf53582c man: document that ExecStop= is executed during restarts
Fixes: #7126
2017-11-17 11:25:02 +01:00
Lennart Poettering 78a263f432 man: add missing suffixing "=" for setting name 2017-11-17 11:25:02 +01:00
bleep_blop 132523e7f7 man: fix typo for !! in systemd.service (#7031)
!! must be very similar to !, not itself.
2017-10-08 22:01:08 +02:00
Zbigniew Jędrzejewski-Szmek 1245e4132b man: use "filename" not "file name" by default
We settled on "filename" and "file system", so change a couple of places for
consistency. The exception is when there's an adjective before "file" that
binds more strongly then "name": "password file name", "output file name", etc.
Those cases are left intact.
2017-09-15 17:18:29 +02:00
Zbigniew Jędrzejewski-Szmek 6e2f5000c7 man: delete note about propagating signal termination
That advice is generally apropriate for "user" programs, i.e. programs which
are run interactively and used pipelines and such. But it makes less sense for
daemons to propagate the exit signal. For example, if a process receives a SIGTERM,
it is apropriate for it to exit with 0 code. So let's just delete the whole
paragraph, since this page doesn't seem to be the right place for the longer
discussion which would be required to mention all the caveats and considerations.

Fixes #6415.
2017-09-15 09:33:25 +02:00
John Lin 45f09f939b man: explicitly distinguish "implicit dependencies" and "default dependencies"
Fixes: #6793
2017-09-13 11:39:09 +08:00
Jakub Wilk ee905de0d6 man: fix typos (#6739) 2017-09-04 22:25:59 +09:00