On Mon, Apr 20, 2020 at 02:40:36PM +0300, Panu Matilainen wrote:
On 4/20/20 1:07 PM, Zbigniew Jędrzejewski-Szmek wrote:
On Mon, Apr 20, 2020 at 10:38:18AM +0300, Panu Matilainen wrote:
On 4/17/20 5:09 PM, Zbigniew Jędrzejewski-Szmek wrote:
[Service] Type=oneshot ExecStart=rpmdb --rebuilddb ExecStartPost=rm -f /var/lib/rpm/.rebuilddb
[Install] WantedBy=basic.target
(Service units have default dependency on basic.target, so if this is to be ordered before basic.target, it needs DefaultDependencies=no.)
I guess the question is rather, is running before basic.target actually reasonable or even desireable? At the very least, we'd need to also add
RequiresMountsFor=/var /var/tmp
...because obviously /var needs to be there for this. And that makes me wonder what else is missing that we'd need.
/var and /var/tmp would be ordered before local-fs.target, so the dependency on sysinit.target should be enough to handle this.
For local /var yes, but basic.target has this:
# We support /var, /tmp, /var/tmp, being on NFS, but we don't pull in # remote-fs.target by default, hence pull them in explicitly here. Note that we # require /var and /var/tmp, but only add a Wants= type dependency on /tmp, as # we support that unit being masked, and this should not be considered an error. RequiresMountsFor=/var /var/tmp Wants=tmp.mount
Not that BDB rpmdb on NFS is supported, except for read-only mounts maybe...
Indeed, I stand corrected.
Zbyszek