How to debug a crash in a /etc/init.d script? Works OK when run from command line, worked in 22.04.

Chris Green cl at isbd.net
Tue Jun 11 08:33:08 UTC 2024


On Mon, Jun 10, 2024 at 04:54:53PM +0100, Colin Watson wrote:
> On Sat, Jun 08, 2024 at 01:11:21PM +0100, Chris Green wrote:
> > On Sat, Jun 08, 2024 at 12:02:43PM +0200, Ralf Mardorf via ubuntu-users wrote:
> > > 2. Since it worked before, it could be a race condition. Systemd could
> > > be running the init script before the dependencies are ready for use.
> > 
> > Yes, that's what I've been thinking is the most likely cause.  I
> > suspect that a time delay in a /etc/init.d script is not a good idea
> > though.  I'll have to try a wrapper script that returns immediately
> > after starting a script with a delay in it.
> 
> systemd-sysv-generator supports specifying dependencies via LSB headers.
> See systemd-sysv-generator(8) and
> https://refspecs.linuxbase.org/LSB_3.1.1/LSB-Core-generic/LSB-Core-generic/initscrcomconv.html.
> 
> (However, systemd-sysv-generator is deprecated, so to be future-proof
> you should convert this into a proper systemd service.  It should end up
> much shorter and simpler.)
> 
Yes, you're right, I may as well create a proper systemd startup
rather than faffing around with the /etc/init.d script.

-- 
Chris Green




More information about the ubuntu-users mailing list