Comments (26)
Right now local-fs.target doesn't seem to work for waiting for all mount points to be mounted. So, services like minidlna or docker or nfs will start before the filesystem with its database is mounted. If we created a target (/lib/systemd/system/omv-fs.target for example) that looked something like:
[Unit]
Description=Wait for OMV filesystems target
Requires=multi-user.target
Wants=local-fs.target
After=local-fs.target $(systemctl list-units --type=mount | grep /srv | awk '{ print $1 }' | tr '\n' ' ')
Then other services could have overrides added to wait/require this target to make sure they didn't start before the filesystems were mounted.
from openmediavault-minidlna.
Description of issue/question
After a reboot, minidlna doesn't serve any content.
Steps to reproduce issue
Reboot the OMV server and try to access content through UPnP:
pi@omv-nas:~ $ service minidlna status ● minidlna.service - MiniDLNA lightweight DLNA/UPnP-AV server Loaded: loaded (/lib/systemd/system/minidlna.service; enabled; vendor preset: enabled) Active: active (running) since Sun 2020-12-13 20:03:51 CET; 1h 56min ago Docs: man:minidlnad(1) man:minidlna.conf(5) Process: 733 ExecStart=/usr/sbin/minidlnad -f $CONFIGFILE -P /run/minidlna/minidlna.pid $DAEMON_OPTS (code=exited, status=0/SUCCESS) Main PID: 902 (minidlnad) Tasks: 2 (limit: 1430) CGroup: /system.slice/minidlna.service └─902 /usr/sbin/minidlnad -f /etc/minidlna.conf -P /run/minidlna/minidlna.pid -r Dec 13 20:03:47 omv-nas systemd[1]: Starting MiniDLNA lightweight DLNA/UPnP-AV server... Dec 13 20:03:51 omv-nas minidlnad[733]: [2020/12/13 20:03:51] minidlna.c:631: error: Media directory "V,/srv/dev-disk-by-label-omvmaster/Video/" not accessible [No such file or directory] Dec 13 20:03:51 omv-nas minidlnad[733]: [2020/12/13 20:03:51] minidlna.c:631: error: Media directory "A,/srv/dev-disk-by-label-omvmaster/Music/" not accessible [No such file or directory] Dec 13 20:03:51 omv-nas minidlnad[733]: [2020/12/13 20:03:51] minidlna.c:631: error: Media directory "P,/srv/dev-disk-by-label-omvmaster/Photos/" not accessible [No such file or directory] Dec 13 20:03:51 omv-nas systemd[1]: Started MiniDLNA lightweight DLNA/UPnP-AV server.
Obviously the minidlna service should depend on the media directories to be available. Mine are on two external USB drives.
Versions report
Si el usuario minidlna no puede acceder a las carpetas donde se encuentra nuestro contenido multimedia, definido en la directriz media_dir, habrá que añadirlo a los grupos pertinentes. En nuestro ejemplo, todas las carpetas pertenecen al grupo llamado jose que tiene permisos de lectura y ejecución.
ls -la
jose@jose-pc:~/PELICULAS$ ls -la
drwxrwxr-x 2 jose jose 4096 mar 16 15:29 .
drwxr-x--- 35 jose jose 4096 mar 16 17:16 ..
-rw-rw-r-- 1 jose jose 576804311 mar 16 10:40 '65 millones atras al borde extincion.mp4'
-rw------- 1 jose jose 878084096 mar 16 14:35 jj.mp4
-rw-rw-r-- 1 jose jose 1698000847 mar 16 12:56 'Pantera Negra Wakanda por siempre.mp4'
$ sudo gpasswd -a minidlna jose
Esto soluciono el problema
from openmediavault-minidlna.
The plugin doesn't maintain the unit file for minidlna. I guess I could add an override file but if local-fs.target doesn't work, it would have to be this somewhat ugly hack - https://github.com/OpenMediaVault-Plugin-Developers/openmediavault-omvextrasorg/blob/master/usr/sbin/omv-installdocker#L310.
from openmediavault-minidlna.
@ryecoaaron We are ninyaing each other. As I wrote in the OMV repo: please close one of the reports. I don't know where you want to continue the discussion.
from openmediavault-minidlna.
@jpo234 I did delete my message from the openmediavault issue but I can't close that one. You can continue here.
from openmediavault-minidlna.
IMO using a systemd override is the only solution to fix that downstream. But in the end this should be fixed finally upstream in the minidlna Debian package or the project itself.
from openmediavault-minidlna.
Is there a systemd target that says "all file systems ready for use"? The hackish solution that @ryecoaaron pointed to seems unreliable. All unit files would have to be regenerated, if the user adds an additional external mount...
from openmediavault-minidlna.
Is there a systemd target that says "all file systems ready for use"? The hackish solution that @ryecoaaron pointed to seems unreliable. All unit files would have to be regenerated, if the user adds an additional external mount...
I fear there is no final solution for that because file systems may be mounted on demand via systemd nowadays (that's not the case for OMV, but nevertheless it is somewhat async), thus they are not available at a specific time.
from openmediavault-minidlna.
It is hackish but not unreliable. It has been working for people for docker. The worst thing that can happen is you add a new filesystem that it isn't waiting for. That could be added to a listener to keep it up to date. Only the minidlna unit override file would have to be regenerated. Not a big deal.
from openmediavault-minidlna.
That could be added to a listener to keep it up to date.
I'm unfamiliar with the systemd vocabulary, bur listener sounds intriguing. IMHO the right solution would be to tell minidlna that a new data filesystem just became available (as opposed to plethora of non-data filesystems). Right now this would have to restart minidlna. Can this be done purely from the unit files? Does systemd already call listeners when a mount completed? That would fix the async issue that @votdev mentioned.
from openmediavault-minidlna.
Listeners are an OMV function. When a filesystem is added (has to be done via OMV web interface), it would update the override file and do a systemctl daemon-reload. If you are adding filesystems outside of OMV, then you are out of luck. The only way to do that would be to script it and run via cron. Either way, minidlna would not have to be restarted unless you are changing the minidlna config file.
from openmediavault-minidlna.
New to the project.
I face this problem as well. On every reboot, I lose all access to minidlna shares.
I was able to manually add an edit to the minidlna.service as an override.
systemctl edit minidlna.service
Added
[Unit]
RequiresMountsFor=/srv/{UUID name of the media drive}
See https://www.freedesktop.org/software/systemd/man/systemd.unit.html Systemd.Unit man page
RequiresMountsFor=¶
Takes a space-separated list of absolute paths. Automatically adds dependencies of type Requires= and After= for all mount units required to access the specified path.Mount points marked with noauto are not mounted automatically through local-fs.target, but are still honored for the purposes of this option, i.e. they will be pulled in by this unit.
Not sure if this helps.
from openmediavault-minidlna.
That is the fix I was suggesting. Already doing that for docker.
from openmediavault-minidlna.
I wonder if there is a way to define a target that waits for the shared folders to be mounted so that the other omv targets could wait on one central dependency. Basically a separate unit that does nothing but the
RequiresMountsFor=/srv/whatever
from openmediavault-minidlna.
@votdev What do you think about creating a target that is updated any time the fstab module is run that would contain an After and/or Requires listing all filesystems? Then plugins such as this one could add overrides to run After this new target. I am doing something similar for docker in omvextras (it is waiting for mount unit files) https://github.com/OpenMediaVault-Plugin-Developers/openmediavault-omvextrasorg/blob/master/usr/sbin/omv-installdocker#L310
from openmediavault-minidlna.
@votdev What do you think about creating a target that is updated any time the fstab module is run that would contain an After and/or Requires listing all filesystems? Then plugins such as this one could add overrides to run After this new target. I am doing something similar for docker in omvextras (it is waiting for mount unit files) https://github.com/OpenMediaVault-Plugin-Developers/openmediavault-omvextrasorg/blob/master/usr/sbin/omv-installdocker#L310
Target for what? OMV does not have a systemd unit file for fstab. Could you please describe your idea more detailed?
from openmediavault-minidlna.
Right now local-fs.target doesn't seem to work for waiting for all mount points to be mounted. So, services like minidlna or docker or nfs will start before the filesystem with its database is mounted. If we created a target (/lib/systemd/system/omv-fs.target for example) that looked something like:
[Unit]
Description=Wait for OMV filesystems target
Requires=multi-user.target
Wants=local-fs.target
After=local-fs.target $(systemctl list-units --type=mount | grep /srv | awk '{ print $1 }' | tr '\n' ' ')Then other services could have overrides added to wait/require this target to make sure they didn't start before the filesystems were mounted.
Could you please open an issue to discuss that there? If there is no other solution to fix that, i'm fine to give it a try after various tests. I don't want to run into the same fiasco like we had with the shared folders unit file.
What is the output of systemctl list-units --type=mount
in your example?
from openmediavault-minidlna.
I will open an issue.
from openmediavault-minidlna.
openmediavault/openmediavault#932
from openmediavault-minidlna.
Any news? There were a number of minidlna updates lately and fixing my config after every update gets old really fast...
from openmediavault-minidlna.
The problem is still there. In the forum I was given the tip to add a waiting time to minidlna.service
[Service]
StartLimitInterval=300s
ExecStartPre=/bin/sleep 30
from openmediavault-minidlna.
@jpo234 What config are you fixing after every update?
@synaomen As I have mentioned before, this is not a plugin issue. It is a minidlna issue. I don't like the sleep for 5 mins fix and won't be adding it to the plugin. If that works on your system, use it.
from openmediavault-minidlna.
@ryecoaaron @synaomen I think I posted this before: I'm launching minidlna After the quota check:
After=network.target systemd-quotacheck.service
Checking the disk quotas obviously requires the disks to be accessible.
from openmediavault-minidlna.
@jpo234 If you use systemctl edit to create the override, you shouldn't have to fix that every time there is an update.
from openmediavault-minidlna.
@ryecoaaron Thanks for the tip. Minidlna now works even after
sudo apt install --reinstall minidlna
sudo shutdown -r now
BTW, doing systemctl list-dependencies systemd-quotacheck.service --all --reverse
shows that this does indeed do the right thing and wait until the external disks are mounted. Maybe it's the best we can do right now.
from openmediavault-minidlna.
closing due to age.
from openmediavault-minidlna.
Related Issues (20)
- Minidlna does not start automatically even if enabled HOT 4
- URGENT! minidlna change user:group of all /var/log HOT 2
- File name problem: 90openmediavault-minidlna HOT 3
- Resize Album Artwork HOT 1
- Support DSD files HOT 3
- minidlna shows pictures and music even not chosen HOT 5
- placement of Log files seems inconsistent. HOT 3
- Any upgrade plan to 1.3.0 HOT 2
- logrotation of minidlna not working properly
- Minidlna not share
- [improvement] preselected interface HOT 2
- Log file of MiniDLNA just bomb shelled my root HOT 5
- fs.inotify.max_user_watches should be increased because otherwise MiniDLNA complains HOT 1
- very ressource CPU when minidlna work HOT 7
- mkv not recognized HOT 6
- "received signal 15, good-bye" HOT 1
- inotify warning in log HOT 2
- New options support HOT 2
- Advanced/personnal options field HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from openmediavault-minidlna.