As the title says, I have /var and /var/log on separate partitions.
On shutdown, I get the error, that umount /var/log, and later umount /var failed.
My question is:
How to debug this issue?
If it counts, I am running Debian Stretch.
So far I was running around searching the web, it turned up an issue with journald logging in /var/log to the very last moment, however, on my system the journald logs go to /run.
Which means, there is something else hogging the /var.
1) Ideally, I would stop the shutdown process at the point, where the umount errors turn up, open a shell, and issue an lsof, or just put in there somewhere a script that does the same. However, I am not knowledgeable enough, how should I do this?
I have a vague idea that I should have an init.d script, with no requirement of local_fs, and put it in rc0 and rc6 with K99, then it will hopefully execute in the right time, and write me some output in a logfile.
Or maybe the rc levels do not have that fine control, and I should create a script, and a systemd unit to run it.
Anyway, the problem here, even if I tried that, I would not know, if it executed at the right time, so I would have no idea, whether what I see in the logs, is from before, after, on spot, when the error happens...?
2) Alternatively, I could check, what is writing in /var/log on a normal, rc2 running system with lsof, then find all of their startup scripts/methods, and make sure, they have a requirement of having /var and /var/log mounted.
Also making sure that I don't create a shutdown dependency loop.
I would rather pinpoint the problem first, then start to blindly overwrite my system config.
A) Then, this is kinda hijacking the question, but maybe there is a setting, probably for /etc/fstab that says: "for the umount order, treat /var, /var/log the same as /".