systemd service

systemd service

This guide explains how to configure and manage the gosuki daemon using systemd. It covers setting up the service file, enabling and starting the service, and configuring debug levels.

1. Service File Configuration

Create a systemd service file at ~/.config/systemd/user/gosuki.service with the following content:

[Unit]
Description=gosuki bookmark manager daemon

[Service]
Environment="GOSUKI_DEBUG=2"
ExecStart=%h/projects/gosuki/gosuki/build/gosuki start
TimeoutStartSec=10
PIDFile=%t/gosuki.pid

[Install]
WantedBy=basic.target
  • Make sure to start the service without the --tui flag.

2. Enable and Start the Service

After creating the service file, enable and start it using the following commands:

# Enable the service (starts on boot)
systemctl --user enable gosuki

# Start the service immediately
systemctl --user start gosuki

# Check the status
systemctl --user status gosuki

3. Debug Level Configuration

You can control the debug level in several ways:

  • Command-line flag: Use the --debug <level> flag when starting the service.
  • Environment variable: Set the GOSUKI_DEBUG=<level> environment variable.

Available debug levels:

  • 0: silent
  • 1: warning
  • 2: info
  • 3: debug