<div dir="ltr"><span style="font-family:arial,sans-serif;font-size:13px">I'd like my system to:</span><div style="font-family:arial,sans-serif;font-size:13px">1. boot</div><div style="font-family:arial,sans-serif;font-size:13px">

2. run a command</div><div style="font-family:arial,sans-serif;font-size:13px">3. shut down</div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">

I've implemented step 2 in a .service file [1], but I can't figure out how to automatically shut the system down once it's finished. shutdown.target conflicts with all services that don't set DefaultDependencies=false (which is most of them), so it seems I'm out of luck—there is no way to specify a target that requires both multi-user.target and shutdown.target. Is there some way to handle this situation?</div>

<div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">N.B. This is all running in an LXC; the overarching goal is to sandbox the command so it can't affect the rest of the system.</div>

<div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">- Kerrick</div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">

[1] If it's useful, the .service file is as follows:</div><div style="font-family:arial,sans-serif;font-size:13px"><div>[Unit]</div><div>Description=Sandboxed Checkerbox command</div><div>After=multi-user.target</div>

<div><br></div><div>[Service]</div><div>User=user</div><div>Type=simple</div><div>ExecStart=/bin/sh -c '/home/user/cmd </home/user/stdin >/home/user/stdout 2>/home/user/stderr'</div><div><br></div><div>[Install]</div>

<div>WantedBy=multi-user.target</div></div></div>