manage import_files --watch Does not work with systemd
I have a service file set up to start scanning a directory to scan a folder for new music. The command works when I run it, but not when launched by systemd.
funkwhale-server-import.service:
[Unit]
Description=Funkwhale application server importer
After=funkwhale-server.service
PartOf=funkwhale.target
[Service]
Restart=on-failure
RestartSec=10
#User=funkwhale # Get not in sudoers file error
#WorkingDirectory=/srv/funkwhale/api # Doesn't help
#EnvironmentFile=/srv/funkwhale/config/.env # Doesn't help
ExecStart=/srv/funkwhale/manage import_files 79b4a8f2 /srv/funkwhale/data/music/pool/ --recursive --in-place --noinput --async --watch
[Install]
WantedBy=multi-user.target
systemctl status output:
Dec 03 18:05:52 FunkWhale systemd[1]: Started Funkwhale application server importer.
Dec 03 18:05:52 FunkWhale sudo[24021]: root : TTY=unknown ; PWD=/ ; USER=funkwhale ; COMMAND=/srv/funkwhale/virtualenv/bin/python /srv/funkwhale/api/manage.py import_files 79b4a8f2 /srv/funkwhale/data/music>
Dec 03 18:05:52 FunkWhale sudo[24021]: pam_unix(sudo:session): session opened for user funkwhale by (uid=0)
Dec 03 18:05:55 FunkWhale manage[24022]: 2020-12-03 18:05:55,640 funkwhale_api.config INFO Loaded env file at /srv/funkwhale/config/.env
Dec 03 18:05:55 FunkWhale manage[24022]: 2020-12-03 18:05:55,641 funkwhale_api.config INFO Running with the following plugins enabled: funkwhale_api.contrib.scrobbler
normal command output when run as sudo:
2020-12-03 18:10:49,966 funkwhale_api.config INFO Loaded env file at /srv/funkwhale/config/.env
2020-12-03 18:10:49,966 funkwhale_api.config INFO Running with the following plugins enabled: funkwhale_api.contrib.scrobbler
Checking imported paths against settings.MUSIC_DIRECTORY_PATH
For details, please refer to import reference 'cli-2020-12-03T18:11:06.680245+00:00' or URL [snip]
Watching for changes at /srv/funkwhale/data/music/pool…
Can anyone help me?