Skip to content

Commit

Permalink
tutorial: Update systemd user example docs
Browse files Browse the repository at this point in the history
- Add missing directories to Butane configuration
- Adjust file permissions in Butane configuration

Fixes: coreos#367

Signed-off-by: Erik Sjölund <[email protected]>
  • Loading branch information
eriksjolund authored and travier committed Sep 19, 2022
1 parent f946157 commit 57e0728
Showing 1 changed file with 55 additions and 3 deletions.
58 changes: 55 additions & 3 deletions modules/ROOT/pages/tutorial-user-systemd-unit-on-boot.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ storage:
hard: false
----

And finally we setup lingering for the systemd user level instance so that it gets started directly on boot and stays running:
We set up lingering for the systemd user level instance so that it gets started directly on boot and stays running:

[source,yaml]
----
Expand All @@ -80,6 +80,40 @@ storage:
mode: 0644
----

As the following directories do not exist yet, we will have to create them to tell Ignition to set the right ownership and permissions:

[source,yaml]
----
variant: fcos
version: 1.4.0
storage:
directories:
- path: /home/sleeper/.config
mode: 0755
user:
name: sleeper
group:
name: sleeper
- path: /home/sleeper/.config/systemd
mode: 0755
user:
name: sleeper
group:
name: sleeper
- path: /home/sleeper/.config/systemd/user
mode: 0755
user:
name: sleeper
group:
name: sleeper
- path: /home/sleeper/.config/systemd/user/default.target.wants
mode: 0755
user:
name: sleeper
group:
name: sleeper
----

== Writing the Butane config and converting to Ignition

The final Butane config, stored in `user.bu`, will be:
Expand All @@ -96,8 +130,26 @@ passwd:
- name: sleeper
storage:
directories:
- path: /home/sleeper/.config
mode: 0755
user:
name: sleeper
group:
name: sleeper
- path: /home/sleeper/.config/systemd
mode: 0755
user:
name: sleeper
group:
name: sleeper
- path: /home/sleeper/.config/systemd/user
mode: 0755
user:
name: sleeper
group:
name: sleeper
- path: /home/sleeper/.config/systemd/user/default.target.wants
mode: 0744
mode: 0755
user:
name: sleeper
group:
Expand All @@ -106,7 +158,7 @@ storage:
- path: /var/lib/systemd/linger/sleeper
mode: 0644
- path: /home/sleeper/.config/systemd/user/linger-example.service
mode: 0755
mode: 0644
contents:
inline: |
[Unit]
Expand Down

0 comments on commit 57e0728

Please sign in to comment.