After a restart or power cut

What starts Chezak by itself after the phone or computer restarts, how to check it, and how to turn it on.

After a power cut or a restart, the printer helper must be running again before customers come. Set it up once so it starts by itself. Each morning Chezak also tells you if it isn't running 10 minutes after your shop opens.

What starts by itself

Check it after a restart

Restart the phone or computer, wait two minutes, then run the doctor check (the line for your device is below). The Printers page should turn green by itself.

Android phone (Termux)
chezak doctor
Windows (PowerShell)
cd ~\chezak; node bridge.mjs doctor
Mac (Terminal)
cd ~/chezak && node bridge.mjs doctor
Linux (Terminal)
cd ~/chezak && node bridge.mjs doctor

Android phone

Why two apps? Termux runs Chezak, but only while Termux is open. After the phone restarts (a power cut, an update, a flat battery), nothing opens Termux again, so Chezak stays off until someone opens it. Termux:Boot is a small companion app that Android lets start when the phone turns on: it runs Chezak's start script, so Chezak comes back by itself without anyone touching the phone.

  1. Open Termux:Boot once, then close it. Android won't run an app's start-up step until the app has been opened once, so without this Chezak doesn't come back after a restart.
  2. Stop Android switching Termux and Termux:Boot off to save battery: find your phone below and do its taps.
  3. Keep the phone charging. To check, type the line below.
chezak autostart status

Android switches apps off in the background to save battery, and that would stop Chezak. Pick the phone and do its taps for Termux and for Termux:Boot.

When Chezak starts, Termux may ask Let Termux always run in background? Tap Allow: that is Termux's battery step in one tap. Termux:Boot and the phone's own extras still need the taps below.

Pixel

  1. Open Settings → Apps → See all apps → Termux.
  2. Tap App battery usage.
  3. Turn on Allow background usage, then tap those words and choose Unrestricted. (If the page already lists Unrestricted, just choose it.)
  4. Go back to See all apps and do the same for Termux:Boot.

Samsung

  1. Open Settings → Apps → Termux → Battery and choose Unrestricted. Do the same for Termux:Boot.
  2. Open Settings → Battery → Background usage limits (older phones: Settings → Battery and device care → Battery → Background usage limits).
  3. Turn off Put unused apps to sleep.
  4. Tap Never sleeping apps, tap +, tick Termux and Termux:Boot, then tap Add.

These menus may differ slightly on your phone. Look for the closest name.

Xiaomi, Redmi or POCO

  1. Open Settings → Apps → Manage apps → Termux.
  2. Turn on Autostart.
  3. Tap Battery saver and choose No restrictions.
  4. Do the same for Termux:Boot. Then open recent apps, press and hold Termux and tap the lock, so clearing recent apps doesn't close it.

These menus may differ slightly on your phone. Look for the closest name.

OnePlus

  1. Open Settings → Apps → App management → Termux.
  2. Tap Battery usage.
  3. Turn on Allow background activity and Allow auto launch.
  4. Do the same for Termux:Boot. Then open recent apps, press and hold Termux and tap Lock.

These menus may differ slightly on your phone. Look for the closest name.

Vivo or iQOO

  1. Open Settings → Battery → Background power consumption management and allow Termux and Termux:Boot (some phones call it High background power consumption).
  2. Open Settings → Apps → Termux → Battery and choose the setting without limits (Unrestricted or Allow background activity). Do the same for Termux:Boot.
  3. Turn on Autostart for Termux and Termux:Boot: Settings → Apps → Autostart (some phones: Settings → More settings → Applications → Autostart).
  4. Open recent apps, pull Termux down (or open its menu) and tap the lock, so clearing recent apps doesn't close it.

These menus may differ slightly on your phone. Look for the closest name.

Oppo or Realme

  1. Open Settings → Apps → App management → Termux.
  2. Tap Battery usage.
  3. Turn on Allow background activity and Allow auto launch.
  4. Do the same for Termux:Boot. Then open recent apps, press and hold Termux and tap Lock.

These menus may differ slightly on your phone. Look for the closest name.

Motorola

  1. Open Settings → Apps → See all apps → Termux.
  2. Tap App battery usage.
  3. Turn on Allow background usage, then tap those words and choose Unrestricted. (If the page already lists Unrestricted, just choose it.)
  4. Go back to See all apps and do the same for Termux:Boot.

Other

  1. Open Settings → Apps → Termux → Battery (on some phones App battery usage).
  2. Choose Unrestricted, No restrictions or Don't optimise, whichever your phone shows. If you see Autostart or Auto launch, turn it on.
  3. Do the same for Termux:Boot.

These menus may differ slightly on your phone. Look for the closest name.

Your phone's maker may hide more battery savers. dontkillmyapp.com has the steps for each phone, with pictures (in English).

Mac

Make Chezak start by itself, once per computer: after a restart or power cut, Chezak comes back without anyone opening it. The line from the Printers page turns it on during setup. If setup asked Start Chezak by itself when this computer starts? (Y/n) and you pressed Enter, it's already on too.

  1. Open Terminal and paste the line below. Chezak then runs in the background, with no Terminal window.
  2. If the Mac asks to let “node” find devices on your local network, click Allow.
  3. The Mac lists it under System Settings → General → Login Items. To stop it, run the same line with off in place of on.
cd ~/chezak && node bridge.mjs autostart on

Then check it with the doctor line: Start by itself should say OK.

cd ~/chezak && node bridge.mjs doctor

If you turned on start-by-itself, Chezak runs in the background and there's no window to keep open; otherwise leave the Chezak window open while the shop is open.

Windows

Make Chezak start by itself, once per computer: after a restart or power cut, Chezak comes back without anyone opening it. The line from the Printers page turns it on during setup. If setup asked Start Chezak by itself when this computer starts? (Y/n) and you pressed Enter, it's already on too.

  1. Open PowerShell and paste the line below. Chezak starts when you sign in, with no window (a task called Chezak in Task Scheduler, or a file in your Startup folder).
  2. No administrator rights are needed. To stop it, run the same line with off in place of on.
cd ~\chezak; node bridge.mjs autostart on

Then check it with the doctor line: Start by itself should say OK.

cd ~\chezak; node bridge.mjs doctor

If you turned on start-by-itself, Chezak runs in the background and there's no window to keep open; otherwise leave the Chezak window open while the shop is open.

Linux

Make Chezak start by itself, once per computer: after a restart or power cut, Chezak comes back without anyone opening it. The line from the Printers page turns it on during setup. If setup asked Start Chezak by itself when this computer starts? (Y/n) and you pressed Enter, it's already on too.

  1. Paste the line below in a terminal. It adds a systemd user service that starts Chezak when you log in, and again if it stops.
cd ~/chezak && node bridge.mjs autostart on

To start it before anyone logs in, an administrator can run loginctl enable-linger once for your user. Chezak never runs it.

Then check it with the doctor line: Start by itself should say OK.

cd ~/chezak && node bridge.mjs doctor

If you turned on start-by-itself, Chezak runs in the background and there's no window to keep open; otherwise leave the Chezak window open while the shop is open.

Don't let it sleep

Still not running after a restart? Send Chezak support the doctor report.

Still stuck? Send Chezak support your doctor report.

More about The printer helper

All help articles