This statement won't work as you'd expect. if `command == 'start'` fails, then it will check `if 'restart'` which will always return true.

You should do something like `if command in ('start', 'restart', 'foreground')`

Or even better you should have a list called `START_COMMANDS` and check `if command in START_COMMANDS`