in its postinstall script. As this causes rsyslog to be restarted a
few times in a row it sometimes results in rsyslog not functioning.
Am 26.10.22 um 11:49 schrieb Jędrzej Dudkiewicz:[...]
I'm sorry if it was answered earlier, but I *really* couldn't find
anything about it.
I have few packages that are installed as part of a larger system on
Debian running on BeagleBone. These packages frequently (for some
strange reason - I'm not the only developer) modify files that go to
the /etc/rsyslog.d/ directory. These files are not part of
sometimes all of them. Because of this each package contains the
following:
systemctl restart rsyslog
in its postinstall script. As this causes rsyslog to be restarted a
few times in a row it sometimes results in rsyslog not functioning.
This shouldn't be a problem in theory.
That said, rsyslog could be part of the upgrade process, so maybe is in
an inconsistent state when you trigger the restart.
Would be interested to know more about the specific failures you
encountered.
Thus, my question:
Is there a way to restart rsyslog only once, after all packages are installed? I hope for something similar to "dh $@ --with-systemd" in "rules" file (but "dh -l" does not show anything that looks like it
should work). My guess is that it should possible to somehow combine
"dh $@ --with-systemd" to achieve what I want, but I don't even know
where should I start.
The rsyslog package already offers a dpkg trigger which does
`invoke-rc.d rsyslog try-restart || true`
This trigger is activated by packages installing files into /etc/rsyslog.d
But you can activate that trigger explicitly as well via
dpkg-trigger --now-await rsyslog
So, if your package ships a file in /etc/rsyslog.d/ everything should
work ootb. If you create the file dynamically via maintscripts, you need
to add an explicit dpkg trigger in your maintscripts.
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 307 |
Nodes: | 16 (2 / 14) |
Uptime: | 45:33:54 |
Calls: | 6,910 |
Files: | 12,377 |
Messages: | 5,429,451 |