# Service start/stop shortcut

A kiosk-style FR201 typically launches a fullscreen browser or dashboard on boot via a systemd service. That's great in production and miserable when you need to troubleshoot — every time you escape to a TTY, the service relaunches the dashboard before you can type anything useful.

The fix: drop two single-letter scripts (`s` to stop, `r` to restart) onto the device's `PATH`. When you break out to the console, you can stop the service in two keystrokes (`s`, <kbd>Enter</kbd>) before it has a chance to take the screen back.

## Create the shortcuts

Replace `kiosk.service` with the actual unit name on your device.

1. Write the `s` (stop) command to `/usr/local/bin/`:

    ```sh title="Create the stop shortcut"
    sudo tee /usr/local/bin/s > /dev/null << 'EOF'
    #!/bin/bash
    sudo systemctl stop kiosk.service
    echo "Kiosk service stopped"
    EOF
    ```

2. Write the `r` (restart) command:

    ```sh title="Create the restart shortcut"
    sudo tee /usr/local/bin/r > /dev/null << 'EOF'
    #!/bin/bash
    sudo systemctl restart kiosk.service
    echo "Kiosk service restarted"
    EOF
    ```

3. Mark both executable:

    ```sh title="Mark the shortcuts executable"
    sudo chmod +x /usr/local/bin/s /usr/local/bin/r
    ```

`/usr/local/bin/` is on every user's `PATH` by default, so any account on the device — including a non-`pi` kiosk user — can run `s` or `r` from anywhere.

## Use the shortcuts

When the dashboard is up and you need to break out:

1. Switch to a TTY (<kbd>Ctrl</kbd>+<kbd>Alt</kbd>+<kbd>F2</kbd> usually works) or kill the X session, depending on how the kiosk is configured.
2. Log in.
3. Type `s` and hit <kbd>Enter</kbd>. The service stops and stays stopped until you run `r`.

When you're done troubleshooting, type `r` to bring the dashboard back.

:::tip[Passwordless sudo]
If the shortcuts prompt for a password every time, give the kiosk user passwordless `systemctl` access for just those two units. Run `sudo visudo` and add:

```text
kioskuser ALL=NOPASSWD: /bin/systemctl stop kiosk.service, /bin/systemctl restart kiosk.service
```

Replace `kioskuser` with the actual username. Scoping the rule to those two specific commands keeps the door narrow.
:::