I'd like my system to:
1. boot
2. run a command
3. shut down

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?

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.

- Kerrick

[1] If it's useful, the .service file is as follows:
[Unit]
Description=Sandboxed Checkerbox command
After=multi-user.target

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

[Install]
WantedBy=multi-user.target
_______________________________________________
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel

Reply via email to