I’m running Kopia on my headless server exposing the WebUI inside my VPN to have access to it via my laptop.
I created a systemd unit file running as unprivileged user with the following
[Unit]
Description=Kopia server
[Service]
ExecStart=/usr/bin/kopia server start --insecure --without-password --disable-csrf-token-checks --kopiaui-notifications --enable-actions --address="http://10.1.1.1:51515"
[Install]
WantedBy=default.target
For some reason, the server keeps shutting itself down and somehow restarting, even though there is no restart policy in the systemd unit.
Here is the output of journalctl --user -u kopia:
May 05 20:05:05 icebox systemd[22054]: Started Kopia server.
May 05 20:05:14 icebox bash[22064]: SERVER ADDRESS: http://10.1.1.1:51515
May 05 20:05:14 icebox bash[22064]: Open the address above in a web browser to use the UI.
May 05 20:05:15 icebox bash[22064]: Running full maintenance...
May 05 20:05:25 icebox bash[22064]: GC found 82 unused contents (123.9 KB)
May 05 20:05:25 icebox bash[22064]: GC found 0 unused contents that are too recent to delete (0 B)
May 05 20:05:25 icebox bash[22064]: GC found 295050 in-use contents (79 GB)
May 05 20:05:25 icebox bash[22064]: GC found 12 in-use system-contents (6.3 KB)
May 05 20:05:25 icebox bash[22064]: GC undeleted 0 contents (0 B)
May 05 20:06:35 icebox bash[22064]: Compacting an eligible uncompacted epoch...
May 05 20:06:35 icebox bash[22064]: Advancing epoch markers...
May 05 20:06:35 icebox bash[22064]: Attempting to compact a range of epoch indexes ...
May 05 20:06:36 icebox bash[22064]: Cleaning up unneeded epoch markers...
May 05 20:06:36 icebox bash[22064]: Cleaning up old index blobs which have already been compacted...
May 05 20:06:45 icebox bash[22064]: Cleaned up 0 logs.
May 05 20:06:45 icebox bash[22064]: Finished full maintenance.
May 05 20:08:49 icebox bash[22064]: Shutting down HTTP server ...
May 05 20:08:49 icebox systemd[22054]: Stopping Kopia server...
May 05 20:08:50 icebox systemd[22054]: Stopped Kopia server.
May 05 20:08:50 icebox systemd[22054]: kopia.service: Consumed 12.419s CPU time over 3min 45.909s wall clock time, 676.2M memory peak.
May 05 20:09:05 icebox systemd[22054]: Started Kopia server.
May 05 20:09:14 icebox kopia[22269]: SERVER ADDRESS: http://10.1.1.1:51515
May 05 20:09:14 icebox kopia[22269]: Open the address above in a web browser to use the UI.
May 05 20:25:20 icebox kopia[22269]: Shutting down HTTP server ...
May 05 20:25:20 icebox systemd[22054]: Stopping Kopia server...
May 05 20:25:20 icebox kopia[22269]: error closing active connection: error closing SFTP client: EOF
May 05 20:25:20 icebox systemd[22054]: Stopped Kopia server.
May 05 20:25:20 icebox systemd[22054]: kopia.service: Consumed 407ms CPU time over 16min 15.264s wall clock time, 85M memory peak.
May 05 20:30:03 icebox systemd[22583]: Started Kopia server.
May 05 20:30:12 icebox kopia[22592]: SERVER ADDRESS: http://10.1.1.1:51515
May 05 20:30:12 icebox kopia[22592]: Open the address above in a web browser to use the UI.
May 05 20:30:48 icebox kopia[22592]: Shutting down HTTP server ...
May 05 20:30:48 icebox systemd[22583]: Stopping Kopia server...
May 05 20:30:48 icebox systemd[22583]: Stopped Kopia server.
May 05 20:30:48 icebox systemd[22583]: kopia.service: Consumed 273ms CPU time over 44.862s wall clock time, 84.3M memory peak.
May 06 17:56:01 icebox systemd[29850]: Started Kopia server.
May 06 17:56:10 icebox kopia[29859]: SERVER ADDRESS: http://10.1.1.1:51515
May 06 17:56:10 icebox kopia[29859]: Open the address above in a web browser to use the UI.
May 06 17:56:11 icebox kopia[29859]: Running quick maintenance...
May 06 17:56:19 icebox kopia[29859]: Compacting an eligible uncompacted epoch...
May 06 17:56:19 icebox kopia[29859]: Advancing epoch markers...
May 06 17:56:19 icebox kopia[29859]: Finished quick maintenance.
May 06 17:57:29 icebox kopia[29859]: Shutting down HTTP server ...
May 06 17:57:29 icebox systemd[29850]: Stopping Kopia server...
May 06 17:57:30 icebox systemd[29850]: Stopped Kopia server.
May 06 17:57:30 icebox systemd[29850]: kopia.service: Consumed 464ms CPU time over 1min 29.234s wall clock time, 148M memory peak.
May 06 21:05:21 icebox systemd[30998]: Started Kopia server.
May 06 21:05:31 icebox kopia[31008]: SERVER ADDRESS: http://10.1.1.1:51515
May 06 21:05:31 icebox kopia[31008]: Open the address above in a web browser to use the UI.
May 06 21:05:32 icebox kopia[31008]: Running full maintenance...
May 06 21:05:41 icebox kopia[31008]: GC found 82 unused contents (123.9 KB)
May 06 21:05:41 icebox kopia[31008]: GC found 0 unused contents that are too recent to delete (0 B)
May 06 21:05:41 icebox kopia[31008]: GC found 295050 in-use contents (79 GB)
May 06 21:05:41 icebox kopia[31008]: GC found 12 in-use system-contents (6.3 KB)
May 06 21:05:41 icebox kopia[31008]: GC undeleted 0 contents (0 B)
May 06 21:07:01 icebox kopia[31008]: Compacting an eligible uncompacted epoch...
May 06 21:07:02 icebox kopia[31008]: Advancing epoch markers...
May 06 21:07:02 icebox kopia[31008]: Attempting to compact a range of epoch indexes ...
May 06 21:07:02 icebox kopia[31008]: Cleaning up unneeded epoch markers...
May 06 21:07:03 icebox kopia[31008]: Cleaning up old index blobs which have already been compacted...
May 06 21:07:11 icebox kopia[31008]: Cleaned up 0 logs.
May 06 21:07:11 icebox kopia[31008]: Finished full maintenance.
I’m aware that there is the flag --shutdown-grace-period on kopia server start, but I expected the server to be always on in the background to run snapshots at the specified time.
Here are my two questions:
- Why is the kopia server shutting itself down?
- How is it restarting when systemd has no restart policy?