61 Commits

Author SHA1 Message Date
52ed774c23 docs: generate-systemd: add clarification statement
Based on user feedback, I think it's time to clarify that there are no
plans to remove generate-systemd.  Deprecation here means that the
command will not receive new features but only urgent bug fixes.

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2024-03-11 09:03:36 +01:00
44f159ed31 Deprecate podman generate systemd
Now that Quadlets are fully supported, it is time to Depracate
podman generate systemd command.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-08-03 06:58:53 -04:00
d4cfc498d7 Remove unnecessary use of the word "please".
Only use the word "please" in these situations:

- reader is asked to do something inconvenient
- reader is asked for permission
- reader is asked for forgiveness

Remove other uses of the word "please" to
make the language more efficient.

[NO NEW TESTS NEEDED]

Signed-off-by: Erik Sjölund <erik.sjolund@gmail.com>
2023-07-23 17:31:29 +02:00
32c2cea0f9 Remove future tense from man pages
Remove all will, would, could, should and use present tense.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-05-16 15:10:33 -04:00
497be102ad fix: don't output "ago" when container is currently up and running
Closes #17250

Signed-off-by: Daniel Lublin <daniel@lublin.se>
2023-01-27 12:32:15 +01:00
7665bbc127 Remove 'you' from man pages
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2022-12-07 09:29:29 -05:00
d76bf4cb5e man pages: assorted underscore fixes
Underscore is special in markdown. We usually escape them
properly, but these are a few that we missed. Found using:

   $ ack '[A-Z]\\fI[A-Z]' docs/build/man

(plus one that I found by accident).

If anyone has ideas on how to add a commit check for these,
please speak up. I'm at a complete loss to automate this.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2022-10-31 06:43:57 -06:00
622638b72b docs: generate systemd: point to kube template
Point to the kube template in the notes of `--new`.

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2022-10-24 10:14:34 +02:00
fb3d55006f Improve generate systemd format
Fixes: https://github.com/containers/podman/issues/14897

Followup to #13814

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2022-09-21 05:10:55 -04:00
0ea5080c91 generate systemd: warn on --restart without --new
Emit a warning to the user when generating a unit with --new on a
container that was created with a custom --restart policy. As shown
in #15284, a custom --restart policy in that case can lead to issues
on system shutdown where systemd attempts to nuke the unit but Podman
keeps on restarting the container.

Fixes: #15284
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2022-09-13 10:59:57 +02:00
2f555c0c74 Merge pull request #15621 from ventifus/fix-manpage-header
[CI:DOCS] Fix manpage header formatting
2022-09-06 19:26:53 +02:00
63c779a857 Fix manpage headers
Signed-off-by: Andrew Denton <adenton@redhat.com>
2022-09-06 09:37:13 -07:00
a9a411f8a8 Add generate systemd -e/--env option
-e/--env option sets environment variables to the systemd unit files.

Fixes: #15523

Signed-off-by: Toshiki Sonoda <sonoda.toshiki@fujitsu.com>
2022-09-06 20:17:11 +09:00
61d842a183 Fix template name inconsistency
Signed-off-by: Stefano Figura <stefano@figura.im>
2022-08-26 15:34:05 +02:00
1b099eec8e [CI:DOCS] podman-generate-systemd.1.md: document --sdnotify
* Document why the default value for --sdnotify is overridden.
  Some was included text from
  https://github.com/containers/podman/issues/15029#issuecomment-1192244755

* Document that --sdnotify=ignore is overridden.

Fixes #15029

Co-authored-by: Valentin Rothberg <vrothberg@redhat.com>
Co-authored-by: Tom Sweeney <tsweeney@redhat.com>
Signed-off-by: Erik Sjölund <erik.sjolund@gmail.com>
2022-07-26 07:16:09 +02:00
ad7c54e13a man page checker: enforce stricter options format
Followup to #14906, in which a nonexistent option was found
in a man page. The xref script was designed to catch that,
but I was too lax in my parsing: the option was documented
using wrong syntax, and the script didn't catch it.

Solution: do not allow *any* unrecognized cruft in the
option description lines. And fix all improperly-written
entries to conform to the rule:

    **--option**=*value(s)*

Two asterisks around option, which must have two dashes. One
asterisk around value(s).

This is going to cause headaches for some people adding new
options, but I don't think I can fix that: there are many
factors that make an unparseable line. Adding 'hint' code
would make the script even more complex than it is. I have
to assume that our contributors are smart enough to look
at surrounding context and figure out the right way to
specify options.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2022-07-14 06:35:51 -06:00
e08a77ce64 Add "podman kube play" cmd
The "podman kube play" command is designed to be a replacement for the
"podman play kube" command.
It performs the same function as "play kube"  while also still working with the same flags and options.
The "podman play kube" command is still functional as an alias of "kube play".

Closes #12475
Signed-off-by: Niall Crowe <nicrowe@redhat.com>
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2022-07-13 15:27:03 +01:00
9c658f4907 docs: mention the podman-kube template
Mention the template in the docs for play-kube and generate-systemd.

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2022-06-30 17:09:53 +02:00
fb4fc03ec4 Pretty print systemd services file
Fixes: #13337

I added newline only on options IE Begin with "-"

[NO NEW TESTS NEEDED]

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2022-04-12 06:02:48 -04:00
d4bf6b4d78 clarifying "loginctl enable-linger" section in doc
Signed-off-by: Adam Maryniuk <adamaze@gmail.com>
2022-03-24 12:33:05 -04:00
9b0c8d23bd man pages: sort flags, and keep them that way
Command flags (OPTIONS) in man pages have to date been in
haphazard order. Sometimes that order is sensible, e.g.,
most-important options first, but more often they're
just in arbitrary places. This makes life hard for users.

Here, I update the man-page-check Makefile script so it
checks and enforces alphabetical order in OPTIONS sections.
Then -- the hard part -- update all existing man pages to
conform to this requirement.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2022-03-23 13:49:42 -06:00
e1b2981665 docs: generate-systemd: pod requires an infra container
Generating unit files for a pod requires the pod to be created with an
infra container (see `--infra=true`).  An infra container runs across
the entire lifespan of a pod and is hence required for systemd to manage
the life cycle of the pod's main unit.

This issue came up on the mailing list.

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2022-02-24 10:58:18 +01:00
6365437871 Clarify remote client means Mac and Windows
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2022-01-28 08:14:05 -05:00
b9a2d8698a Handlers for generate systemd with custom dependencies
This commit includes:
* Handlers for generate systemd unit
  with manually defined dependencies such as:
  Wants=, After= and Requires=

* The new unit and e2e tests for checking generated systemd units
  for container and pod with custom dependencies

* Documented descriptions for custom dependencies options

Signed-off-by: Eugene (Evgenii) Shubin <esendjer@gmail.com>
2022-01-19 21:46:16 +05:00
c9ad1da51c Add restart-sec option to systemd generate
Signed-off-by: Ondra Machacek <omachace@redhat.com>
2021-12-03 12:11:28 +01:00
9a10e2124b systemd: replace multi-user with default.target
Replace `multi-user.target` with `default.target` across the code base.
It seems like the multi-user one is not available for (rootless) users
on F35 anymore is causing issues in all kinds of ways, for instance,
enabling the podman.service or generated systemd units.

Fixes: #12438
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-11-30 14:37:25 +01:00
566b78dd02 generate systemd: add --start-timeout flag
Add a new flag to set the start timeout for a generated systemd unit.
To make naming consistent, add a new --stop-timeout flag as well and let
the previous --time map to it.

Fixes: #11618
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-11-23 09:38:51 +01:00
e9d8ca22b8 Merge pull request #11076 from boaz0/closes_10275
Support template unit files in podman generate systemd
2021-11-15 16:30:38 +01:00
6236be4ff9 [CI:DOCS] Add CI check for SEE ALSO in man pages
Add new CI check to confirm that links and references
in SEE ALSO sections are properly formatted and that
links are valid (at least in theory: we do no actual
URL fetching to test for 404).

The check is piggybacked into existing xref-helpmsgs-manpages
script. It could conceivably be more elegant to write a
separate tool for this purpose, but I don't wish to duplicate
the logic for finding and reading markdown files.

Script identified various problems, which I fix in this PR:

  . missing '**' (asterisks) around some references, or '**'
    in the wrong place.

  . links pointing to github.com/.../tree/ instead of /blob/
    (github redirects those automatically, but I like
    consistency)

  . a few copy-paste errors, e.g. subgid linking to subuid.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2021-11-10 09:03:40 -07:00
2720156fa5 Add links to all SEE ALSO sections
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-11-10 09:29:21 -05:00
ece0c7e5d3 Support template unit files in podman generate systemd
Signed-off-by: Boaz Shuster <boaz.shuster.github@gmail.com>
2021-10-22 04:19:18 +03:00
f9a689f3ed generate systemd: clarify limitations of --new
`generate systemd --new` is looking at the "create command" of the
container/pod which is simply the os.Args at creation time.

It does not work on containers or pods created via the REST API since
the create command is not set.  `--new` does work on such containers and
pods since there is no reliable way to reverse-map their configs to
command-line arguments of podman.

Fixes: #11370
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-09-01 08:50:03 +02:00
6f1c7a0b6b systemd: require network*-online*.target
Require the network to be online in all (generated) systemd units to
make sure that containers and Podman run only after the network has been
fully configured.

Fixes: #10655
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-07-16 14:58:08 +02:00
5307218419 generate systemd: make mounts portable
Commit 748826fc88fc fixed a bug where slow mounting of the runroot was
causing issues when the units are started at boot.  The fix was to add
the container's runroot to the required mounts; the graph root has been
added as well.

Hard-coding the run- and graphroot to the required mounts, however,
breaks the portability of units generated with --now.  Those units are
intended to be running on any machine as, theoreticaly, any user.

Make the mounts portable by using the `%t` macro for the run root.
Since the graphroot's location varies across root and ordinary users,
drop it from the list of required mounts.  The graphroot was not causing
issues.

Fixes: #10493
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-05-31 11:31:27 +02:00
379df7f2c4 docs: generate systemd: XDG_RUNTIME_DIR
A conversation on the customer portal suggests that to add an extra note
about the requirement of XDG_RUNTIME_DIR to be set.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-05-19 09:15:48 +02:00
30e731ecc8 Revert escaped double dash man page flag syntax
Commit 800a2e2d35 introduced a way to disable the conversion of `--`into
an en dash on docs.podman.io, so the ugly workaround of escaping the
dashes is no longer necessary.

Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
2021-05-07 18:30:00 +02:00
bdbce9bcb1 Add documentation on short-names
Once we settle on the wording for short-names in podman-pull, I will
add the same section to all of the podman commands that use pull.

Also ran through all man pages with a spell checker.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-05-07 09:00:35 -04:00
63fd3a3fca Add more documentation on conmon
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-04-27 11:57:19 -04:00
bc48211924 Fix long option format on docs.podman.io
Escape the two dashes, otherwise they are combined into one long dash.
I tested that this change is safe and still renders correctly on github
and with the man pages.

This commit also contains a small change to make it build locally.
Assuming you have the dependencies installed you can do:
```
cd docs
make html
```
Preview the html files in docs/build/html with
`python -m http.server 8000 --directory build/html`.

Fixes containers/podman.io#373

Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
2021-03-29 14:38:25 +02:00
748826fc88 Add RequiresMountsFor= to systemd generate
It is rare but possible that storage locations for the graphroot and the
runroot are not mounted at boot time, and therefore might race when
doing container operations.  An example we've seen in the wild is that a
slow tmpfs mount for the runroot would suddenly mount over /run, causing
the container to lose all currently-running data, requiring a system
refresh to get it back.

This patch adds RequiresMountsFor= to the systemd.unit header to ensure
the paths for both the graphroot and runroot are mounted prior to
starting any generated unit files.

Signed-off-by: Robb Manes <rmanes@redhat.com>
2021-03-26 08:53:26 -04:00
9eac4a7f7b podman-remote build does not support volumes
Remove --volume option from podman-remote since it is
not supported, also add information to podman-build man page
indicating options not supported over remote connections.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-03-08 13:46:42 -05:00
d2f3098c6f --no-header flag implementation for generate systemd
Signed-off-by: Jakub Guzik <jakubmguzik@gmail.com>
2021-02-22 14:48:33 +01:00
94f96c78a6 Add a notice to remove pod before starting service
Signed-off-by: xcffl <2216902+xcffl@users.noreply.github.com>
2021-01-22 18:28:19 +08:00
bf5d184325 Fix spelling mistakes
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-12-09 06:00:04 -05:00
52a8694705 Add anchors for flag names on docs.podman.io
Change the docs markdown so that flag names will be h4 headers.
Sphinx will automatically add anchors to headers. Add css to
make sure the flag names are not to big compared to the text.

The man pages also still renders fine but it looks a bit different.

Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
2020-11-10 15:27:08 +01:00
88bc133dac Make man page headings more consistent
Signed-off-by: Jordan Christiansen <xordspar0@gmail.com>
2020-10-16 15:06:33 -05:00
526f01cdf5 Fix up errors found by codespell
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-09-11 06:14:25 -04:00
ebfea2f4f8 APIv2 add generate systemd endpoint
Add support for generating systemd units
via the api and podman-remote.

Change the GenerateSystemdReport type to return the
units as map[string]string with the unit name as key.

Add `--format` flag to `podman generate systemd`
to allow the output to be formatted as json.

Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
2020-09-02 22:06:19 +02:00
c90ad68fa1 Change recommended systemd unit path for root.
`/usr/lib/systemd/system` should only be used by the package manager
administrators should use: `/etc/systemd/system` or
`/usr/local/lib/systemd/system`

see: man systemd.unit

Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
2020-08-01 14:55:48 +02:00
d2d4523be0 "pod" was being truncated to "po" in the names of the generated systemd unit files.
s/po/pod

Signed-off-by: Gavin Campbell <gavin@gavincampbell.dev>
2020-06-21 18:19:19 +01:00