roflcopter1101
roflcopter1101

Reputation: 333

Systemctl starting multiple commands

I'm trying to use systemctl to start 2 programs with one service (if that's what you call them). They're both python scripts, I tried the:

[service]
Type=simple
ExecStart=/usr/bin/python %i

In the service file. when I run

systemctl start security@/home/pi/pythonProject/p1.py security@/home/pi/pythonProject/p2.py

it fails to start it, and the error code says it tried to start

[email protected]

And same for p2.py . Can anyone offer any assistance for this?

Upvotes: 0

Views: 1962

Answers (1)

knanga333
knanga333

Reputation: 103

First, you need to fix [service] to [Service]. That is a syntax error. Second, you need to fix %i to %f. systemd escapes / in instance name to -. %f can get unescaped instance name.

More detail.

Upvotes: 1

Related Questions