[Pkg-systemd-maintainers] Bug#740880: systemctl enable ... segfaults on initscript without LSB header, even if native unit is there

Bernhard Schmidt berni at birkenwald.de
Wed Mar 5 18:34:27 GMT 2014


Package: systemd
Version: 204-7
Severity: minor

Hi,

very minor annoyance, some commercial tools (i.e. Atlassian Confluence 
in this case) install init scripts without LSB headers. This breaks 
systemctl enable confluence.service even if a native systemd unit file
is installed, because it calls update-rc.d to sync the status, update-rc.d
fails and systemctl segfaults.

==> /etc/init.d/confluence <==
#!/bin/bash

# Confluence Linux service controller script
cd "/opt/atlassian/confluence/bin"

case "$1" in
    start)
        ./start-confluence.sh
        ;;
    stop)
        ./stop-confluence.sh
        ;;
    restart)
        ./stop-confluence.sh
        ./start-confluence.sh
        ;;
    *)
        echo "Usage: $0 {start|stop|restart}"
        exit 1
        ;;
esac

==> /etc/systemd/system/confluence.service <==
[Unit]
Description=Confluence Team Collaboration Software
After=network.target

[Service]
Type=forking
ExecStart=/opt/atlassian/confluence/bin/start-confluence.sh
ExecStop=/opt/atlassian/confluence/bin/stop-confluence.sh

[Install]
WantedBy=multi-user.target


root at web:~# systemctl enable confluence.service
Synchronizing state for confluence.service with sysvinit using update-rc.d...
Executing /usr/sbin/update-rc.d confluence defaults
insserv: warning: script 'K01confluence' missing LSB tags and overrides
insserv: warning: script 'confluence' missing LSB tags and overrides
Executing /usr/sbin/update-rc.d confluence enable
update-rc.d: error: confluence Default-Start contains no runlevels, aborting.
Segmentation fault

(gdb) bt full
#0  __GI___libc_free (mem=0x4000400000007) at malloc.c:2892
        ar_ptr = <optimized out>
        p = <optimized out>
        hook = 0x0
#1  0x00007ffff79a2ab8 in dbus_error_free () from /lib/x86_64-linux-gnu/libdbus-1.so.3
No symbol table info available.
#2  0x00000000004112bf in ?? ()
No symbol table info available.
#3  0x0000000000405636 in ?? ()
No symbol table info available.
#4  0x00007ffff6d38995 in __libc_start_main (main=0x404d00, argc=3, ubp_av=0x7fffffffebe8, init=<optimized out>,
    fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fffffffebd8) at libc-start.c:276
        result = <optimized out>
        unwind_buf = {cancel_jmp_buf = {{jmp_buf = {0, 6816848600422769768, 4220355, 140737488350176, 0, 0,
                -6816848601064315800, -6816864304616479640}, mask_was_saved = 0}}, priv = {pad = {0x0, 0x0, 0x7fffffffec08,
              0x7ffff7ffe1e8}, data = {prev = 0x0, cleanup = 0x0, canceltype = -5112}}}
        not_first_call = <optimized out>
#5  0x00000000004065ec in ?? ()
No symbol table info available.


The culprit is pretty clear, but maybe there is something to be improved in
error handling here, segfaults are always bad.

Thanks,
Bernhard




More information about the Pkg-systemd-maintainers mailing list