Kozea / Radicale

A simple CalDAV (calendar) and CardDAV (contact) server.

Home Page:https://radicale.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Problem running as service with systemd as a user

taf-neutrino opened this issue · comments

Radicale version: 3.2.1
OS: Pi OS Lite 64-bit
Hardware: Raspberry Pi Zero 2 W
Radicale works properly by the radicale user, while I have trouble configuring as a service with systemd as a user.

I show you when I start manually by the radical user:

admin@pizero:~ $ sudo su - radicale
radicale@pizero:~ $ radicale
[..] [INFO] Loaded default config
[..] [INFO] Skipped missing config file '/etc/radicale/config'
[..] [INFO] Loaded config file '/home/radicale/.config/radicale/config'
[..] [INFO] Starting Radicale
[..] [INFO] auth type is 'radicale.auth.htpasswd'
[..] [INFO] auth htpasswd encryption is 'radicale.auth.htpasswd_encryption.bcrypt'
[..] [INFO] storage type is 'radicale.storage.multifilesystem'
[..] [INFO] rights type is 'radicale.rights.owner_only'
[..] [INFO] web type is 'radicale.web.internal'
[..] [INFO] hook type is 'radicale.hook.none'
[..] [INFO] permit delete of collection: True
[..] [INFO] Listening on '10.24.0.2:5232'
[..] [INFO] Radicale server ready

I tried to enable the service as described in the instructions:

admin@pizero:~ $ systemctl --user enable radicale
Failed to enable unit: Unit file radicale.service does not exist.

I tried with other instructors managing to register the service but, I have problems.

admin@pizero:~ $ sudo systemctl -M radicale@ --user enable radicale.service
Created symlink /home/radicale/.config/systemd/user/default.target.wants/radicale.service → /home/radicale/.config/systemd/user/radicale.service.
admin@pizero:~ $ sudo systemctl -M radicale@ --user start radicale.service
admin@pizero:~ $ sudo systemctl -M radicale@ --user status radicale.service
● radicale.service - A simple CalDAV (calendar) and CardDAV (contact) server
     Loaded: loaded (/home/radicale/.config/systemd/user/radicale.service; enabled; preset: enabled)
     Active: active (running) since Sun 2024-07-07 16:06:22 CEST; 8s ago
   Main PID: 5061
      Tasks: 1 (limit: 174)
        CPU: 929ms
     CGroup: /user.slice/user-1001.slice/user@1001.service/app.slice/radicale.service
             └─5061 python3 -m radicale

I can't read journalctl.

admin@pizero:~ $ journalctl -M radicale@ --user --unit radicale.service
Using the --machine= switch requires root privileges.
admin@pizero:~ $ sudo journalctl -M radicale@ --user --unit radicale.service
Failed to open root directory: The name org.freedesktop.machine1 was not provided by any .service files

I add elements of my configuration.

radicale@pizero:~/.config/radicale $ ls -la
total 16
drwxr-xr-x 2 radicale radicale 4096 Jul  5 22:34 .
drwxr-xr-x 4 radicale radicale 4096 May 19 12:52 ..
-rwxr-xr-x 1 radicale radicale 3073 May 22 19:46 config
-rwxr-xr-x 1 radicale radicale   71 May 22 19:47 users

config:

..
htpasswd_filename = ~/.config/radicale/users
..
[storage]
type = multifilesystem
filesystem_folder = ~/var/radicale/collections

User creation and data folder:

# user admin
sudo adduser --gecos "" --disabled-password radicale
sudo adduser admin radicale

sudo mkdir -p /data/radicale/collections
sudo chown radicale:radicale /data/radicale
sudo chown radicale:radicale /data/radicale/collections
sudo chmod -R 755 /data/radicale
sudo chmod -R 750 /data/radicale/collections

# user radicale
sudo su - radicale
ln -s /data  ~/.var

Starting "radicale" as a user with systemd was never tested so far, why not starting "radicale" as a system service using the anyhow created system user "radicale"? This is well tested.

Ok thanks.