I'm configuring systemd in a cloud-config file for CoreOS. If I understand this correctly, I have two ways of starting a unit at boot:
Alternative 1, use the [Install]-section (as described in digital oceans guides):
- name: initialize_data
content: |
[Unit]
Description=Run a command
[Service]
Type=oneshot
ExecStart=/usr/bin/mkdir /foo
[Install]
WantedBy=multi-user.target
Alternative 2, drop the [Install]-section and use command: start:
- name: initialize_data
command: start
content: |
[Unit]
Description=Run a command
[Service]
Type=oneshot
ExecStart=/usr/bin/mkdir /foo
Is there any drawbacks of starting the unit using command: start? I get that I can't control which unit it will start after, but anything else? Will it honour [Unit]-directives such as Requires= and After=?