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
Sat Jun 8 09:33:36 UTC 2024


I have a script that I run from /etc/init.d which starts an OKI
scanner daemon.  It's as supplied by OKI but with the addition of:-

    export LD_LIBRARY_PATH=/usr/local/libexec/okicxfreeze

The OKI scanner software is old and needs python 2.x so I built a
'frozen' version of it that I have installed in /usr/local, hence the
above addition.

The script is a pretty standard sort of start/stop/restart script like
many others in /etc/init.d.  It worked quite OK in xubuntu 22.04 but
for some reason when run at system start-up time it crashes in 24.04. 

If I run it from the command line then it works perfectly, so the
crash is a nuisance but not a showstopper.

The script creates /dev/okiscand which allows the scanner to be driven
from other utility scripts.


The crash file in /var/crash tells me very little about why the script
crashed, the first few lines are:-

    ProblemType: Crash
    Architecture: amd64
    CrashCounter: 1
    CurrentDesktop: XFCE
    Date: Sat Jun  8 10:15:00 2024
    DistroRelease: Ubuntu 24.04
    ExecutablePath: /usr/libexec/okimfpdrv/scand
    ExecutableTimestamp: 1609257450
    ProcCmdline: /usr/libexec/okimfpdrv/scand
    ProcCwd: /etc/init.d
    ProcEnviron:
     LANG=en_US.UTF-8
     LANGUAGE=en_US
     LC_COLLATE=C
     LC_CTYPE=en_GB.utf8
     LD_LIBRARY_PATH=<set>
     PATH=(custom, no user)
     SHELL=/bin/bash
     TERM=xterm-256color

... and later:-

     voluntary_ctxt_switches:       16
     nonvoluntary_ctxt_switches:    0
     x86_Thread_features:
     x86_Thread_features_locked:
    Signal: 6
    SignalName: SIGABRT
    Uname: Linux 6.8.0-35-generic x86_64
    UserGroups: N/A
    _HooksRun: no


I have the full _usr_libexec_okimfpdrv_scand.0.crash file if anyone
could use it to see what went wrong.

Is there anything else I can do to diagnose this?

-- 
Chris Green



More information about the ubuntu-users mailing list