Bug#780675: systemd: segfault in systemd when running systemctl daemon-reload
Robert Pumphrey
rob.pumphrey at gmail.com
Wed Mar 18 15:29:05 GMT 2015
On 17/03/15 22:13, Michael Biebl wrote:
> Am 17.03.2015 um 23:02 schrieb Robert Pumphrey:
>
>> I have identified a duff init.d script (one of our own that previously
>> worked in wheezy) that is at the root of this problem. I have removed
>> the script, rebooted and the I can now run systemctl daemon-reload
>> withough a seg fault.
>> This bug may just indicate that systemd poorly handles a bad init
>> script. Please let me know if you would like details of our broken
>> script, otherwise, I am happy for this to be closed.
>
> If you can share this init script, this would be appreciated.
> systemd certainly shouldn't die because of such a faulty init script and
> I'm actually surprised it does, since the SysV support is basically done
> in an external generator. So there must be something very fishy with the
> generated unit.
>
> As said, if you can attach the faulty init script, that would be great.
>
> Michael
>
>
I have reproduced this on a clean install of Jessie running on a virtual
machine using 32bit i686 arch.
1. Install Debian from netinst
2. put the following into /etc/init.d/firewall
#!/bin/bash
### BEGIN INIT INFO
# Provides: iptables
# Required-Start: $network $remote_fs $syslog
# Required-Stop: $network $remote_fs $syslog
# Should-Start: iptables
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
### END INIT INFO
#####################################################################
###
### Firewall rules
###
#####################################################################
case "$1" in
start)
echo "start"
;;
stop)
echo "stop"
;;
restart)
echo "restart"
;;
*)
echo "Usage: /etc/init.d/firewall {start|stop|restart}"
exit 1
;;
esac
3. chmod u+x /etc/init.d/firewall
4. update-rc.d firewall defaults
5. reboot
6. login as root
7. systemctl --system daemon-reload
then we see:
Message from syslogd at joule at Mar 18 14:10:40 ...
kernel:[ 27.526029] systemd[1]: segfault at b739cdac ip b739cdac sp
bf9af36c error 15
Failed to execute operation: Connection reset by peer
Also of note are the following entries in dmesg:
[ 1.075782] systemd[1]: Found ordering cycle on firewall.service/start
[ 1.075788] systemd[1]: Found dependency on firewall.service/start
[ 1.075793] systemd[1]: Breaking ordering cycle by deleting job
firewall.service/start
[ 1.075799] systemd[1]: Job firewall.service/start deleted to break
ordering cycle starting with firewall.service/start
Also note that the problem is not reproducible if the Provides: and
Should-Start: name match the init script name, so I guess mismatch in
the script name and header is at the root of the problem.
More information about the Pkg-systemd-maintainers
mailing list