((p "You want to provide a shared Zettelstore that can be used from your various devices." " " "Installing Zettelstore as a Linux service is not that hard.") (p "Grab the appropriate executable and copy it into the appropriate directory:") (pre (code (@ (class . "language-sh")) "# sudo mv zettelstore /usr/local/bin/zettelstore")) (p "Create a group named " (kbd "zettelstore") ":") (pre (code (@ (class . "language-sh")) "# sudo groupadd --system zettelstore")) (p "Create a system user of that group, named " (kbd "zettelstore") ", with a home folder:") (pre (code (@ (class . "language-sh")) "# sudo useradd --system --gid zettelstore \\\n --create-home --home-dir /var/lib/zettelstore \\\n --shell /usr/sbin/nologin \\\n --comment \"Zettelstore server\" \\\n zettelstore")) (p "Create a systemd service file and store it into " (kbd "/etc/systemd/system/zettelstore.service") ":") (pre (code (@ (class . "language-ini")) "[Unit]\nDescription=Zettelstore\nAfter=network.target\n\n[Service]\nType=simple\nUser=zettelstore\nGroup=zettelstore\nExecStart=/usr/local/bin/zettelstore run -d /var/lib/zettelstore\nWorkingDirectory=/var/lib/zettelstore\n\n[Install]\nWantedBy=multi-user.target")) (p "Double-check everything. Now you can enable and start the zettelstore as a service:") (pre (code (@ (class . "language-sh")) "# sudo systemctl daemon-reload\n# sudo systemctl enable zettelstore\n# sudo systemctl start zettelstore")) (p "Use the commands " (code (@ (class . "language-sh")) "systemctl") " and " (code (@ (class . "language-sh")) "journalctl") " to manage the service, e.g.:") (pre (code (@ (class . "language-sh")) "# sudo systemctl status zettelstore # verify that it is running\n# sudo journalctl -u zettelstore # obtain the output of the running zettelstore")))